Thursday, February 4, 2010

Tower of Hanoi

I must say, it was quite difficult!



My strategy was to watch the first couple seconds of the solution and then figure out the rest!



I've solved 4 disks and currently just solved 5 disks!



It is amusing yet difficult! (\#o_o)/


5 Disks:


The minimum moves for the 5 disks is 31. The first move you should do is move the smallest ring to far right. This is different from the 4 disks where you first move the smallest ring to the middle. I think for 6 disks you would move the smallest ring to the middle. So this suggests that when you have an odd number of rings, you would move the smallest ring to the far right. When you have an even number or rings, you would move the smallest ring to the middle.


Your objective would be to move the last ring to the right. In order to do that, you would have to move the rings above it away. What I found out is, when you move the rings properly they will always end up in the middle! Strange isn't it? Though the first moves are different, all the rings above the last ring will always end up in the middle. X_X


Once you move the last ring to the far right then your next objective would be to isolate the 4th ring. Another interesting thing I found out is when you have four rings in the middle and the last ring on the far right you would move the smallest ring to the empty left space. For the 4 disks, you would move the smallest ring with the last ring. This game is mostly about precision and if you make the right choices or if you make the unnecessary choices.


Formula. Okay. It is quite hard to figure out the formula but here we go.


No. of Disks No. of Moves
1 1
2 3
3 7
4 15
5 31


Observing the table, I've found out that all the minimum number of moves are all odds. This means it doesn't matter if you have an even number of disks because in the end you will have an odd number of moves. Here is a formula that will determine the number of moves. 2^n-1=No. of Moves. n will represent No. of Disks. Eg. 2^3-1=7, 2^4=16-1=15


It is a good formula ne?


Some good points when trying to solve the Tower of Hanoi


- First goal is to move the last ring to the right


-When you have moved the last ring to the right, check if your number of moves is half of the minimum moves required. This means that the next moves you make are heavy important. :D


-Let's say I'm trying to solve the 4 Disks and that I have successfully moved the last ring to the right. Half of the 15 would be 7. What I also found out was if you made the right choices then when you were half-way done it would be an odd number. It it was an even number half-way through or if the number of moves you have made was over half of the minimum moves required then restart. >.<


-Always move the smallest to a space available where it won't interfere with the movement of the other rings below it. This will be quite helpful.


Here is a picture of my personal experience with the dreadful 5 Disks!












1 comment:

  1. sjdfla;ual ghvlasvlasglsdhlfk;asvfhsodvhoashvo;sd;goaseh;agk;.lcknvh;sdio;awhbo;hsdg;akls;af;oiagh;dnb;asasdfgasghSWEGASWGHAs

    ReplyDelete