recategorized by
3,159 views
5 votes
5 votes
______ is the number of moves of the smallest disc in Tower of Hanoi implementation where the tower consisting of 17 discs (numbered from 0 to 16)

Answer given:  $2^{16}$ = 65536
Please explain
recategorized by

5 Answers

0 votes
0 votes

If no. of rods are 3 :-

(i) no. of function calls will be ----> 2^(n+1)   -   1   =   2^18 - 1

(ii) no. of movements  -----> 2^n   -  1   = 2^17 -1 

(iii) to add on to your knowledge there is  a modified version of  tower of hanoi ie we stop the recursion when we encounter only 1 disk left

in that case no. of function calls ----> 2^n   - 1          

 

BUT the question has asked for the total no. of movements of the smallest disk only and not total no. of movements and i guess it will be  ( 2^n -1 )/2  = math.ceil (2^16 - 0.5 ) = (2^16) 

you can try it out with 3 disk and calc the no. of movements of small disk and chk with the formula

Related questions

11 votes
11 votes
1 answer
2
dd asked Oct 31, 2016
2,893 views
In the tower of Hanoi $x , y , z$ are the positions and we are to move 10 disks from $x$ to $y$. What are the $128$th and $768$th moves ?(A) $x\rightarrow y$ and $x\right...
0 votes
0 votes
0 answers
4
iarnav asked May 27, 2017
658 views
how to Write a program in C which implements tower of Hanoi using recursion? and please explain lines of code if possible.It 'll be a great help.