I’m a student living and studying in IIT Patna. I am a student of Computer Science and Engineering. I like IOT(Internet of Things), android app development, Web Development and Mathematics(specially Probability). I love working on my Arduino UNO.

Friday, 16 December 2016

Exploring Tower of Hanoi - 2

Intro from my last blog : This is more of an article than a blog but it is my exploration. On solving for different n's , I found that the bottom disk always moves only once. Similarly, second disk from the bottom moves 2 times. Third from the bottom always moves 4 times. And so on, they form the series => 1, 2, 4, 8, ... , 2^(n - 1) . The sum of these is of course equal to 2^n - 1 which was already mentioned above.

Suppose that our movement about the towers is restricted. We have three towers named A, B and C. Our n disks of different sizes are on tower A and we need to transfer disks to tower C via B. But we can only send disks from A to B, from B to C and from C to A. All other movement is restricted. What will be the minimum moves for this problem ?

In the original Tower of Hanoi problem, moving disk from any tower to any other tower will have the same number of minimum moves. But in this problem, moving disk from A to C and from A to B will have different number of minimum moves.

Let us assume that we need M( n ) moves for moving n disks from A to C.

Now we need to calculate N(n - 1). But before that, what is the difference between N( n ) and M( n ). M( n ) is the number of moves to move n disks from A to C. N( n ) is the number of moves to move n disks from A to B.