CSCE 235

Handout 19: Induction and Recurrence for Tower of Hanoi

Assigned April 7, 2002 

 

Induction

 

For the Tower of Hanoi problem with 3 pegs and n disks, we know that the number of moves to solve the problem is .  Now, using Mathematical Induction, show that  for all , , where  is the number of moves to solve a Tower of Hanoi problem with 3 pegs and n disks.

 

First, we want to show that the basis is true.  When n = 1, .  Thus, we have shown that the basis is true by inspection.

 

Then, we want to show that the induction step is true.  Given that the kth proposition, , is true, we want to show that the (k+1)th proposition  is true.  We know that .  So, if we can show that  is true, then we are done.  Here is how:

 

.

 

We have shown that induction step is true.

 

Thus, by the Principle of Mathematical Induction, we have shown that  is true for all .

 

*  

 

Recurrence

 

Solve the recurrence relation +1 by computing the explicit formula, given that , and .  The explicit formula is .

 

Here is the trick that we use to do this.  If we include the initial setup of the puzzle as one move, that means,  and .  We also have .  Now, we can try to solve for the explicit formula.  We now have  where a = 2 and b = 0, and  and .  Solving the characteristic equation, we have  or .  Thus, and .  Since we have two solutions, we have (see Handout 18):

 

.

 

Since , .  Thus, .  Or, if we ignore  and treat the problem as if we have one distinct solution, then we have (see Handout 18):

 

 

Since we are now including the initial position as one move, we know that  and .   So, we have:

 

 

Solving the above equations for the constants, we have  = 1, and  = 0.  Thus, we have !

 

Now, we need to finish the trick.  Remember that  is the result of counting the initial setup of the puzzle as one move.  So, now we need to take that move out to obtain :

 

.

 

*