AI Search · Exam notes

Games: Minimax, Best Strategy, Alpha-Beta, SSS*

One games comprehension per paper, three to four sub-questions on one tree: strategy for MAX? best strategy leaves? pruned or unaffected leaves? SSS* solved leaves? One chain answers all of them: solve minimax first, then read everything else off those values.

Points 1 to 4 are the rules. Point 5 applies them to the 2024T2 tree. Point 6 has two more trees to solve with a pen.

1. Basics and minimax

ShapePlayerRule (bottom-up)
SquareMAX, wants large valueswrite the max of the children
CircleMIN, wants small valueswrite the min of the children

Fill values bottom-up before answering anything else. Example: MAX over 68 and 30 gives 68; MIN over 48 and 68 gives 48. Root is always MAX here.

2. Strategy and best strategy

Strategy: a subtree where MAX keeps one child and MIN keeps all children. Test each option and kill it if a MAX node keeps two children, a MIN node drops one, or it spans two root branches.

Best strategy: walk down from the root carrying its minimax value. MAX takes the max child, MIN takes everything. Example: root 56 comes from the right child; right MIN keeps I and the J/K node; that MAX picks J (78 beats 22). Leaves: I, J.

3. Alpha-beta pruning

Walk left to right, depth first, carrying alpha (best MAX is guaranteed) and beta (best MIN is guaranteed). The moment alpha ≥ beta, cut the remaining children. Their leaves are never inspected.

  1. MAX node: update alpha per child; alpha ≥ beta cuts the rest.
  2. MIN node: update beta per child; alpha ≥ beta cuts the rest.
  3. A node entered with alpha already ≥ beta is cut whole, no leaf inside inspected.
  4. The first child is always inspected in full. Only later children can be cut.

Example: MIN has beta 48 from leaf A. Its MAX child returns 68 from leaf B, so 68 ≥ 48 cuts leaf C.

4. SSS* solved leaves

SSS* searches partial strategies best-first and marks examined leaves SOLVED. The exam asks only for the final SOLVED set. Tie-breaker: deepest node first, then leftmost.

Cross-check from the 2024T3 tree: leaves called unaffected by perfect play are exactly the ones SSS* never marks SOLVED.

5. Worked example: 2024T2 FN, Q61 to Q64

5a. The tree as a table (solve from this, then check the animation)

NodeTypeChildrenMinimax value
RMAX (root)M1, M2, M356
M1MINA=48, X148
X1MAXB=68, C=3068
M2MIND=20, X220
X2MAXN1, N288
N1MINE=42, F=7642
N2MING=88, H=9888
M3MINI=56, X356
X3MAXJ=78, K=2278

Cover the animation. First fill the minimax column yourself, then derive strategy, pruning, and solved sets. Official answers: strategy: A,B and D,G,H; best: I,J; pruned: C,E,F,G,H,K; SSS* solved: A,D,I,J.

5b. Animation: one tree, four modes

Step 0 | square = MAX, circle = MIN, faded = pruned, thick = best or solved, black = evaluated

Why this step

Status at this step

5c. The four questions

Leaves A to K with values in the table above. Tie-breaker: same best cost goes to the deepest node, then the leftmost of the deepest.

  1. Which of the following is a strategy for the MAX player? Options: A,B / A,D,I / D,G,H / C,H,K.
  2. List the leaf nodes in the best strategy for MAX, in alphabetical order.
  3. List the leaf nodes pruned by Alpha-Beta, in alphabetical order.
  4. List the leaf nodes solved (SOLVED status) by SSS*, in alphabetical order.

5d. Solution

  1. Minimax. X1 = 68. M1 = 48. N1 = 42. N2 = 88. X2 = 88. M2 = 20. X3 = 78. M3 = 56. R = 56.
  2. Strategy. A,B valid (left branch, X1 keeps B). A,D,I spans branches, dead. D,G,H valid (middle branch, X2 keeps N2, N2 keeps G and H). C,H,K spans branches, dead. Answer: A,B and D,G,H.
  3. Best. R takes M3 (56). M3 keeps I and X3. X3 takes J (78). Leaves: I,J.
  4. Alpha-beta. M1: A sets beta 48, B sets alpha 68, cut C. M2: D sets beta 20, X2 entered with 48 ≥ 20, cut E,F,G,H wholesale. M3: I sets beta 56, J sets alpha 78, cut K. Pruned: C,E,F,G,H,K.
  5. SSS*. SOLVED: A,D,I,J (official).

6. Practice: two more real trees

Fill minimax values yourself, then answer with a pen before opening the answer.

Tree P1: 2024T1 FN, Q104 to Q107 (leaves A to J)

NodeTypeChildrenMinimax value
RMAX (root)M1, M2, M354
M1MINA=18, X118
X1MAXB=98, C=7098
M2MIND=54, X254
X2MAXE=80, N80
NMINF=92, G=6262
M3MINH=32, X332
X3MAXI=50, J=7474

Q: Strategy? Options: A,C / A,D,H / D,F,G / E,I,J. Best strategy? Pruned by Alpha-Beta? SOLVED by SSS*?

Step 0

Why this step

Tracker

Answer P1 (all official)

Strategy: A,C and D,F,G. A,D,H and E,I,J span branches, dead. Best: D,E (R takes M2 at 54, X2 takes E at 80). Pruned: C,F,G,I,J (C cut at X1; F,G cut at X2 entry; I,J cut at X3 entry). SSS*: A,D,E,H (official).

Tree P2: 2024T3 FN, Q66 to Q69 (leaves A to H)

NodeTypeChildrenMinimax value
RMAX (root)M1, M249
M1MINA=56, B=4949
M2MINX4, G=14, H=6314
X4MAXN3, F=2828
N3MINC=35, D=21, E=4221

Q: Strategy? Options: A,C,F / C,D,E,G,H / F,G,H / G,H. Best strategy? Leaves not affecting the value with perfect play? SOLVED by SSS*?

Step 0

Why this step

Tracker

Answer P2 (all official)

Strategy: C,D,E,G,H and F,G,H. A,C,F spans branches, dead. G,H drops a MIN child, dead. Best: A,B (R takes M1 at 49). Unaffected: D,E,G,H (official, equals the complement of the SSS* set). SSS*: A,B,C,F (official).

Tree P3: eval assignment that maximises pruning (leaves A to D take values 1, 2, 3, 4)

A path from the MAX root reaches a small subtree. Leaves A to D take distinct evals from \(\{1,2,3,4\}\). Pick the assignment that prunes the most leaves, then report minimax value, cut counts, and pruned leaves. Two real variants below; their subtree shapes differ, so read the root shape first.

VariantSubtree shapeEntry bounds
FN (Q8 to Q11)MIN root (circle), two MAX children (squares); A,B left, C,D rightalpha = 1, beta = 3
AN (Q8 to Q11)MAX root (square), two MIN children (circles); A,B left, C,D rightalpha = 2, beta = 4

Cut rule used on both: the first leaf under each middle node is always inspected. At a MAX child, a leaf at or above beta triggers a beta-cut and its sibling is pruned. At a MIN child, a leaf at or below alpha triggers an alpha-cut and its sibling is pruned. Exhausting all 24 assignments by script gives exactly 4 optimal ones per variant, matching the official keys.

FN walk: assignment 4,2,3,1, alpha = 1, beta = 3

Step 0

AN walk: assignment 1,3,2,4, alpha = 2, beta = 4

Step 0

Answer P3 (all official, script-verified)

FN assignments: 3,1,4,2 and 3,2,4,1 and 4,1,3,2 and 4,2,3,1. Take 4,2,3,1: left MAX sees A = 4, which is at or above beta 3, so beta-cut, B pruned. Root MIN tightens beta to 3. Right MAX sees C = 3, at or above 3, so beta-cut, D pruned. Minimax 3, cuts 0 alpha and 2 beta, pruned B,D. All four assignments give the same triple.

AN assignments: 1,3,2,4 and 1,4,2,3 and 2,3,1,4 and 2,4,1,3. Take 1,3,2,4: left MIN sees A = 1, at or below alpha 2, so alpha-cut, B pruned. Right MIN sees C = 2, at or below 2, so alpha-cut, D pruned. Minimax 2, cuts 2 alpha and 0 beta, pruned B,D. All four assignments give the same triple.

Exam trap: the two variants prune the same leaves (B,D) but with opposite cut types, because the middle layer flips from MAX to MIN. Always mark squares MAX and circles MIN before simulating.

Tree P4: mid-flight N that forces a cutoff (odd/even evals)

Older papers ask a shorter variant: alpha-beta is mid-flight down a path from the MAX root, and you pick the eval of the frontier node N (from a fixed parity set) that prunes N's siblings, then name the cut type. Rule: read the operative bound off the path (MAX ancestors set alpha, MIN ancestors set beta). N at a MAX node needs an eval at or above beta (beta-cut); N at a MIN node needs an eval at or below alpha (alpha-cut). Only in-range values of the right parity count.

Step 0

Why this step

Tracker

Answer P4 (all official, script-verified)

Odd variant (path 5,17,7,11,9,N; odd evals below 15): N = 11 or 13, Beta Cutoff. The MIN ancestor holds beta at 11, so N at its MAX node cuts iff N is at or above 11; the odd in-range values doing that are exactly 11 and 13.

Even variant (path 2,14,4,10,N; even evals below 15): N = 2 or 4, Alpha Cutoff. The MAX ancestor holds alpha at 4, so N at its MIN node cuts iff N is at or below 4; the even in-range values doing that are exactly 2 and 4.

7. Exam checklist (write this on the rough sheet)

  1. Mark squares MAX, circles MIN. Fill minimax bottom-up first: max at squares, min at circles.
  2. Strategy test: MAX keeps one child, MIN keeps all. Kill options that span root branches or drop a MIN child.
  3. Best strategy: walk down from the root carrying its value; MAX takes the max child, MIN takes everything.
  4. Alpha-beta: left to right, carry alpha and beta, cut the rest the moment alpha ≥ beta. First child is always inspected.
  5. SSS*: answer is the SOLVED leaf set; tie-break deepest, then leftmost. Cross-check: solved plus unaffected covers all leaves.