Sunday, October 28, 2018

Tower of Hanoi Simulation Example with Solution and Mathmatical Induction

Tower of Hanoi L - rule:
1. must move one disk at a time;
2. a larger disk cannot be on top of any smaller disks at any time
3. do it in as few moves as possible
2 Disks
3 Disk

4 Disk

Mathematical induction is a general way to prove that some statement
about the integer is true for all n0. First, we prove the statement
when has its smallest value, n0; this is called the basis. Then we prove the
statement for n > n0, assuming that it has already been proved for all values
between nand 1, inclusive; this is called the induction. Such proof
gives in_nitely many results with only a _nite amount of work.
Recurrences are ideally set up for mathematical induction. In our case,
for example,  follows easily from  The basis is trivial, since T=
2-0. And the induction follows for n > 0 if we assume that holds
when is replaced by 1:
T2Tn-1
    2(2n-1) + 1
     21 :
Hence (1.2) holds for as well. Good! Our quest for Thas ended successfully.


Most Popular

Football