Trace a two-ply minimax game tree

Keep the names of states and actions distinct. · 201 words

A two-ply game tree has two moves from the root, or starting node, to a leaf, meaning a final outcome. Consider an AI choosing a card, then a human choosing a token. The AI's root is a maximizing (Max) node because it wants the highest payoff. With red, the human can take 8 points or 3; as a minimizing (Min) node, the human makes that branch worth 3. With blue, the human can take 5 points or 4, making that branch worth 4. At the root, Max compares 3 and 4 and chooses blue. Payoffs are read from the AI's point of view.

Now let the AI be a goalkeeper. It chooses left or right, then a kicker chooses a side. A save gives the AI +6 points. A goal gives -3. If the keeper chooses left, the kicker can produce +6 by shooting left or -3 by shooting right. The minimizing kicker selects -3, so the left branch is -3. If the keeper chooses right, the kicker also selects -3 rather than +6, so that branch is -3. Max sees a tie and may choose either side. The trace checks the opponent's best reply, then the AI's best root move.

Check your recall

In the card game, what are the values of the red and blue branches after the human's move, and which card does the AI choose?

Check your answer

The red branch has value 3 because the human chooses the 3-point token. The blue branch has value 4 because the human chooses the 4-point token. The AI compares 3 and 4 at its Max node and chooses blue.

Sources and credits

Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.