GATE Previous Year Questions: Adversarial Search
Question 1 GATE CS 2004
Q: Consider the following game tree. MAX moves first. What value does the root node get using the minimax algorithm?
MAX
/ | \
MIN MIN MIN
/\ /\ /\
5 3 8 2 4 6
Options: (A) 3 (B) 4 (C) 5 (D) 6
Solution
Step 1 — Evaluate MIN nodes:
- Left MIN = min(5, 3) = 3
- Middle MIN = min(8, 2) = 2
- Right MIN = min(4, 6) = 4
Step 2 — Evaluate MAX root: max(3, 2, 4) = 4
Answer: (B) 4
Question 2 GATE CS 2011
Q: In the following game tree, how many leaf nodes will be pruned by alpha-beta pruning (left-to-right traversal)?
MAX
/ \
MIN MIN
/ \ \ / \ \
5 3 9 2 8 1
Options: (A) 0 (B) 1 (C) 2 (D) 3
Solution
Traverse left-to-right:
Left MIN: Visit 5, then 3 → min so far = 3. Visit 9 → min = 3.
No pruning here (all children visited).
Back at MAX: α = 3
Right MIN: Visit 2 → v = 2.
v = 2 ≤ α = 3 → α cutoff! Prune leaves 8 and 1.
Pruned nodes: 8, 1
Back at MAX: v = max(3, 2) = 3.
Answer: (C) 2
Question 3 GATE CS 2015
Q: The best-case time complexity of alpha-beta pruning on a game tree with branching factor b and depth d is:
Options: (A) O(bd) (B) O(bd/2) (C) O(b2d) (D) O(d · b)
Solution
With perfect move ordering (best moves examined first at every node), alpha-beta pruning achieves optimal pruning. The number of leaf nodes evaluated reduces from bd to approximately bd/2.
Intuition: At MAX nodes, after finding the best move, subsequent children at sibling MIN nodes can be pruned. This effectively halves the exponent.
Answer: (B) O(bd/2)
Question 4 GATE DA 2023
Q: In the following game tree with chance nodes (coin flip: H with P=0.5, T with P=0.5), what is the value at the root? MAX moves first.
MAX
/ \
CHANCE CHANCE
/ \ / \
(H) (T) (H) (T)
P=0.5 P=0.5 P=0.5 P=0.5
| | | |
MIN MIN MIN MIN
/\ /\ /\ /\
4 8 6 2 3 9 7 1
Solution
Step 1 — MIN nodes:
MIN-1 = min(4,8) = 4 MIN-2 = min(6,2) = 2
MIN-3 = min(3,9) = 3 MIN-4 = min(7,1) = 1
Step 2 — CHANCE nodes:
Left CHANCE = 0.5×4 + 0.5×2 = 2 + 1 = 3.0
Right CHANCE = 0.5×3 + 0.5×1 = 1.5 + 0.5 = 2.0
Step 3 — MAX root:
max(3.0, 2.0) = 3.0
Answer: 3.0
Question 5 GATE CS 2019
Q: Consider the following game tree. What is the optimal move for MAX at the root, and what is the guaranteed payoff?
MAX (root)
/ | \
MIN(A) MIN(B) MIN(C)
/ \ / \ / \
7 2 5 8 9 1
Options:
(A) Move to A, payoff 2 (B) Move to B, payoff 5 (C) Move to C, payoff 1 (D) Move to A, payoff 7
Solution
- MIN(A) = min(7, 2) = 2
- MIN(B) = min(5, 8) = 5
- MIN(C) = min(9, 1) = 1
MAX chooses: max(2, 5, 1) = 5 → Move to B.
Answer: (B) Move to B, payoff 5
Note: MAX cannot assume the opponent will make mistakes. Even though C contains the highest leaf (9), MIN at C would choose 1.
Question 6 GATE CS 2017
Q: Apply alpha-beta pruning (left-to-right) to the following tree. Which leaf values are NOT evaluated?
MAX (root)
/ \
MIN(L) MIN(R)
/ \ / \
MAX(LL) MAX(LR) MAX(RL) MAX(RR)
/ \ / \ / \ / \
3 5 2 9 8 1 7 4
Solution
Traverse left-to-right:
MAX(LL): visit 3, then 5 → value = 5
MIN(L): v = 5, β = 5
MAX(LR): visit 2 → v = 2, α = 2
visit 9 → v = 9, α = 9
9 ≥ β(5)? Yes! β cutoff.
But wait — 9 is already visited. LR returns 9.
MIN(L) = min(5, 9) = 5. Returns 5.
MAX(root): α = 5.
MIN(R): α from parent = 5
MAX(RL): visit 8 → v = 8, α = 8.
8 ≥ β(+∞)? No.
visit 1 → v = max(8,1) = 8.
Returns 8.
MIN(R): v = 8, β = 8.
MAX(RR): visit 7 → v = 7, α = 5 (from root).
visit 4 → v = max(7,4) = 7.
Returns 7.
MIN(R): v = min(8,7) = 7. Returns 7.
MAX(root): max(5,7) = 7.
No leaves are pruned in this tree (no cutoff occurred
that prevented leaf evaluation). All 8 leaves evaluated.
Answer: No leaf nodes are pruned. This occurs because the move ordering is not favorable for pruning. If the tree had leaves in a different order, pruning would likely occur.
Question 7 GATE DA 2024
Q (Numerical Answer Type): A game tree has uniform branching factor 2 and depth 4. In the best case, how many leaf nodes does alpha-beta pruning evaluate?
Solution
Total leaves without pruning: 24 = 16
Best-case formula for even depth: 2bd/2 − 1 = 2 × 22 − 1 = 2 × 4 − 1 = 7
Alternatively: b⌈d/2⌉ + b⌊d/2⌋ − 1 = 22 + 22 − 1 = 4 + 4 − 1 = 7
Answer: 7
Key Takeaways for GATE
- Minimax backup: max at MAX nodes, min at MIN nodes, starting from leaves.
- Alpha-beta: track α (MAX’s best) and β (MIN’s best); prune when α ≥ β.
- Best-case alpha-beta: O(bd/2) — halves the exponent.
- Expectiminimax: weighted average at CHANCE nodes.
- Always trace left-to-right unless stated otherwise.
- Count pruned nodes carefully — a pruned subtree includes all descendants.