Q3 — Games: Alpha-Beta Pruning Puzzle
Design the leaf values yourself: with window (1,3) the best you can do is kill B and D, and four assignments achieve it.
The Question
Consider a game tree with the root node as MAX, where an arbitrary path from the root reaches the subtree shown in the figure.
Each leaf node A to D takes a UNIQUE EVAL VALUE from the set . Alpha-Beta algorithm is entering the subtree with and ; find an optimal eval assignment (for nodes A to D) that maximizes the number of leaves pruned; find the minimax value, the type of cuts and the leaves pruned for that assignment.
| # | Question | Official answer |
|---|---|---|
| 3.1 | 3,1,4,2 / 3,2,4,1 / 4,1,3,2 / 4,2,3,1 | |
| 3.2 | The minimax value of the subtree for the optimal eval assignment is __________ . | 3 |
| 3.3 | 0,2 | |
| 3.4 | B,D / D,B |
The Topic in 60 Seconds
Structure read off the figure: the subtree root is a MIN node (it inherits bounds from its MAX ancestors); its two square children are MAX nodes over leaf pairs.
- MAX cutoff: a MAX child stops once its running value reaches — remaining leaves die.
- After a child returns , the MIN root raises before opening the next child; an empty window still evaluates one leaf (to learn the bound) but cuts the rest.
Deep-dive: browse the Concepts section for Alpha-Beta.
Designing the assignment
Goals: prune as many of the four leaves as possible while keeping every value distinct from .
Left square: call it first with window . If its FIRST leaf already reads , the MAX cutoff fires immediately and the sibling is never read:
Right square: root's has risen to , so the window handed down is — empty or razor-thin. The first leaf must still be read (to learn the bound), and it too will sit :
Constraints assembled:
That yields exactly assignments — the four keyed answers:
Any assignment with reads both left leaves (no cut); any with reads both right leaves. Two cuts is the maximum — you can never prune the FIRST leaf under a freshly opened child because its parent's value is still unknown.
3.2 — Minimax value → 3
Take the representative assignment :
All four keyed assignments give Root where ✓.
3.3 — Cut types → 0, 2
Counting by the bound that did the cutting:
| Cut | Trigger | Type |
|---|---|---|
| B | running value at a MAX node | beta-type |
| D | same, in the second square | beta-type |
Zero alpha-type cuts (no MIN-node cutoff ever fires here — the root never lowers below ), two beta-type cuts → 0, 2.
3.4 — Leaves pruned → B, D
As derived: the second leaf under each square dies unread. First leaves are indispensable — they establish their parent's value.
Interactive trace
Tricks & Tips
Answers: 3.1 3,1,4,2 / 3,2,4,1 / 4,1,3,2 / 4,2,3,1 · 3.2 3 · 3.3 0,2 · 3.4 B,D