The recurrence relation capturing the optimal execution time of the problem with discs is
View worked solution
Answer: D
To solve the Towers of Hanoi problem with discs from a source peg to a destination peg using an auxiliary peg, we follow these optimal steps:
- Step 1: Move the top discs from the source peg to the auxiliary peg. This requires moves.
- Step 2: Move the largest (-th) disc directly from the source peg to the destination peg. This requires exactly move.
- Step 3: Move the discs from the auxiliary peg to the destination peg. This requires another moves.
Summing the moves for these steps, the total number of moves is given by:
With the base case (or ).
Therefore, the correct recurrence relation is , which corresponds to Option D.
Free practice · Your answers on this page are not saved.
