Question: 5 . ( 1 0 points ) We discussed an algorithm to solve the Tower of Hanoi problem in class. The approach we discussed for
points
We discussed an algorithm to solve the Tower of Hanoi problem in class. The approach we
discussed for optimally moving n disks from peg A to peg B using peg C can be illustrated
as shown below: Moven
A B
C
Moven
Move last disk
Moven
Steps are numbered from to
Therefore, number of moves in Moven is:
Now consider the following variant of the Tower of Hanoi problem. To the original problem,
let us add a new condition: Each disk move now must be performed only in the clockwise
direction ie A B B C or C A So for example, if I have to move a disk from A
to C then that will involve a minimum of two moves first from A to B and then from B to
C; but from C to A needs only one move. All the old conditions from the original version of
the problem still apply ie you cannot move a larger disk on top of a smaller disk
Under this new problem formulation:
Let Qn denote the minimum number of moves required to transfer n disks from A B
using C
Let Rn denote the minimum number of moves to transfer n disks from A C
clockwise using B
Prove that:
Qn
n
Rn n
Rn
n
Qn Qn n
Hint : To provide the proof you may need to first come up with a corresponding algorithm
under the new clockwise condition. That should give you the mathematical recurrence shown
above. Please illustrate your algorithm in the form of a figurefollowing the example of the
figure shown above in the question, for the original version of the problem.
Hint: If Rn is the number of moves required to move n disks from peg A to peg C using
B then how many moves will be needed to move n disks from peg B to peg A using C
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
