Consider the given tree below. Calculate the value at the root of the tree…

2021

Consider the given tree below. Calculate the value at the root of the tree using alpha‐beta pruning algorithm.

  1. A.

    3

  2. B.

    5

  3. C.

    6

  4. D.

    9

Attempted by 90 students.

Show answer & explanation

Correct answer: B

Key insight: Traverse the tree left-to-right applying alpha-beta pruning. The root is a Max node.

  • Step 1: Evaluate the left subtree (Min). Visit its left Max-child: max(3,5) = 5. This returns 5 to the Min node.

  • Step 2: At the left Min parent, beta becomes 5. Evaluate its right Max-child: first child is 6. Since this Max-child already yields 6 which is >= beta (5), alpha-beta prunes the sibling 9. The right Max-child would be at least 6, so the Min parent keeps min(5,6) = 5. Thus the entire left subtree returns 5.

  • Step 3: Back at the root (Max), alpha becomes 5. Evaluate the right subtree (Min) with alpha = 5. Visit its left Max-child: max(1,2) = 2. The Min parent now has beta = 2.

  • Step 4: Since beta (2) is <= alpha (5), alpha-beta prunes the right Max-child subtree (values 0 and -1) entirely. So the right subtree returns 2.

  • Step 5: The root (Max) chooses max( left subtree 5, right subtree 2 ) = 5.

Pruned leaves/subtrees: leaf 9 is pruned during evaluation of the left subtree; the entire right sibling subtree with leaves 0 and -1 is pruned during evaluation of the right subtree.

Final answer: 5

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor