# How to alpha-beta pruning to expectiminimax

I have this problem above and I'm trying to think of how to apply alpha-beta pruning to the above. The algorithm states that on you're opponents turn the (expecti turn) you just return the lowest value, but does that mean you apply the probabilities to those values? So for the far left you'd get 2 as the largest value then multiply that by 0.5, but then that set's $$\\beta$$ in the expecti node to $$0.5*2=1$$ and when it goes into the branch to the right it's comparing values without the probabilities applied to it when updating $$\beta$$.

• I don't understand the current title "How to alpha-beta pruning to expectiminimax" because a "verb" is missing. Please, edit your post to fix this.
– nbro
Commented May 4, 2021 at 10:18

The internet doesnt seem to have easily accessible resources on this topic. In my newbie opinion, it should not be possible to prune any nodes. Expectiminimax takes the weighted average of the children, so it would need to consider all leaf values in order to do so. There is no node which can be ignored, as it will an operand in a sum. Now lets say the left subtree was bigger, in the right subtree you evaluated the first min node and it is smaller: well since the second min node can contribute to the sum making it bigger, it cannot be ignored. Now lets say the first min node on the right subtree was bigger, well since the second term adds or reduces(reduces in this case) weight it still has to be considered to get the final value.

Since all the nodes are checked and added together with appropriate weights under chance nodes, I highly doubt there is any advantage of alpha-beta pruning here since it would take the same number of steps as regular expectiminimax. Perhaps if the tree was larger and the chance nodes were central, more nodes could have been pruned out.

• This is dead wrong. If we know the maximum and minimum value a node can have, we can estimate the max/min expected value of a chance node and prune there. Commented Dec 15, 2023 at 17:51
• @thecoolwinter I am talking about the question at hand, not in general. If you have an answer, please provide it. Except you cant because this question cannot be solved by pruning Commented Feb 13 at 18:32
• @thecoolwinter I am talking about the question at hand, not in general. If you have an answer, please provide it. Except you cant because this question cannot be solved by pruning Commented Feb 13 at 18:32

I know I'm a bit late, but here is a response from the book "Artifical Intelligence, A Modern Approach" from Russel and Norvig: "It may have occured to you that something like alpha-beta pruning could be applied to game trees with chance nodes. It turns out that you can. The analysis for MIN and MAX nodes is unchanged, but we can also prune chance nodes, using a bit of ingenuity. At first sight, it might seem impossible to find an upper bound on the value of a chance node before looking at all its children, because the value of a chance node is the average of it's children's value, and in order to compute the average of a set of numbers, we must look at all the numbers. But if we put bounds on the possible values of the utility function, then we can arrive at bounds for the average without looking at every number. For example, say that all utility values are between -2 and +2; then the value of leaf nodes is bounded, and in turn we can place an upper bound on the value of a chance node without looking at all its children".

alpha-beta-prunning algorithm is using for improve performance and reject the options, which not consist the condition - or it's possible to set some factors of probability to take into consideration or not.

This algorithm work on tree structure - and if there are a lot of levels (10-20) - It allows you to eliminate paths - which will logically not be used - saving memory and computing resources.

In this particular case - for finding the minimum value it works like this:

First branch:

• Go to B
• Go to D - and there is 2 and 3 - so return the min 2
• Go From B to E - and choose 5 - the minimal value in B points is actually 3 - so there isn't need for checking the next - cause everything below E, will be higher than D (3)

Second branch:

• Go to
• Go to F - and check 0 and 1
• If C have 1 - than not necessary to go to G - cause 1 is the smaller.

The given sequence is a simplification - and in the case of this algorithm there are also layers - min & max

Implementation, however, is a more complex matter - unless we do copy and paste :-)

https://gist.github.com/exallium/1446104/5109388cfc21578f555dcac0ba54da680326af7b

• This answer describes the application of alpha-beta pruning to minimax, not to expectiminimax. Commented Jul 29, 2021 at 14:20
• Hi, Whats the difference? Commented Jul 29, 2021 at 14:25
• Alpha-beta pruning for minimax doesn't specify what to do with chance nodes. Commented Jul 31, 2021 at 12:10