Expectiminimax

Author

Clayton Cafiero

Published

2026-06-22

Non-determinism and expectiminimax

So far, we’ve investigated games that are entirely deterministic, but many games are not entirely deterministic, that is, they incorporate some element of change.

Most (perhaps all) card games have some element of chance even if only by shuffling before dealing. However, we’ll continue to investigate non-determinstic, fully-observable games.

Consider backgammon (if you don’t know all the rules, that’s OK, I’ll hit the high points and if you like you can visit https://backgammon.com/ if you don’t have a board handy). Every move in backgammon is preceded by a roll of the dice and the moves available to the player are a function of the board position and the number of pips on each die. For example, if one were to roll 3-4 (a three on one die and a four on the other) they could move one piece three places and one piece, perhaps the same piece, four places. This assumes that no moves are blocked by certain configurations of opposing pieces.

There are many other games in which available moves or outcomes of contests depend on the roll of a die or dice: Yahtzee, Sorry!, Parcheesi, or “dungeon”-type games (often with polyhedral dice that have fewer or more than six faces). Consider also childrens’ games like Candy Land, The Game of Life, or Chutes and Ladders. These use a spinning wheel to determine how many spaces a player may move.

Clearly, minimax alone cannot do the job. Minimax has no mechanism for handling random events like the rolling of dice or the spinning of a wheel.

So what will we do? We will add a new kind of node to our game tree—chance nodes.

  • Chance nodes represent chance operations.
  • Each chance node will have two or more children.
  • The probability of reaching each child is indicated on the edge connecting child and chance node.
  • Because these represent probabilities the sum of edge weights over all children of a chance node must sum to one.
  • The value of the chance node is the sum of the values of child nodes weighted by their respective probabilities, that is

v_i = \sum\limits_{j=1}^c v_jp_j

where v_i is the value of the chance node, j indexes children, c is the number of children, the v_j are the values of child nodes, and the p_j are the edge weights. It must be the case for \sum p_j = 1 for any chance node.

Chance nodes shown as squares; probabilities indicated on edges


Demonstration of computed values for chance nodes


How did we arrive at the values for the chance nodes? Recall that these are weighted sums, and the weights are the probabilities associated with each child.

\begin{align*} \frac{1}{6} \times 12 + \frac{2}{3} \times 9 + \frac{1}{6} \times 3 &= 2 + 6 + 0.5 = 8.5, \\[2em] \frac{1}{6} \times -18 + \frac{2}{3} \times 21 + \frac{1}{6} \times 6 &= -3 + 14 + 1 = 12, \end{align*}


and notice that \frac{1}{6} + \frac{2}{3} + \frac{1}{6} = 1.

Test your comprehension

  1. Why isn’t roulette a good candidate for expectiminimax?

  2. Why must chance nodes have at least two children?

  3. Imagine we have a game where after a given player makes a move, two fair (and indistinguishable) coins are tossed to determine possible moves. There are three possibilities: HH, HT or TH (indistinguishable), and TT. The branching factor for moves is two. Draw a game tree with MAX to move, showing chance nodes, and one move for each player. You needn’t construct the entire tree, since there will be repeated structures. Just show enough to convince yourself you understand how a complete tree would be constructed.

Copyright © 2023–2026 Clayton Cafiero

No generative AI was used in producing drafts of this material. This was written the old-fashioned way. AI was used to rewrite existing pseudocode in LaTeX to produce standalone *.tex files for rendering, and for revisions toward satisfying WCAG 2.1 AA-level accessibility standards as required by UVM policy. AI may also have been used to proofread selected human-written prose. Claude 2.1 with model Sonnet 4.6. Revisions, if any, were performed by the author. AI was not used in generating any code whatsoever. All code samples and starter code are by the author only.