Fun Logic Puzzle

Anonymous

Veteran
Joined
May 31, 2010
Messages
303
I just stumbled upon this puzzle: http://www.mazeworks.com/hanoi/index.htm

It says that the Tower of Hanoi is a well-known programming puzzle, so maybe some people on the forums already know about it. I love it, and so far have optimally solved up to eight rings.

Play it, tell what you think. :)
 
I figured a simple algorithm for this over 40 years ago.
For the game shown at that site, if the total number of rings is even, then be sure to always move the smallest ring on every other turn in the clockwise direction. (If the total number of rings is odd, then it should go anti-clockwise.) On the intermediate turns, the move is forced. So, just keep moving the smallest ring the correct direction on alternate moves, and you will get the minimal solution.
 
I figured a simple algorithm for this over 40 years ago.
For the game shown at that site, if the total number of rings is even, then be sure to always move the smallest ring on every other turn in the clockwise direction. (If the total number of rings is odd, then it should go anti-clockwise.) On the intermediate turns, the move is forced. So, just keep moving the smallest ring the correct direction on alternate moves, and you will get the minimal solution.

wow!
I kinda noticed this one:
the move is forced
but I'm too sleepy to figure out the rest! it's 2:23 am here!
 
It's a really simple matter of reducing each one to a smaller tower- after you finish seven or eight, the five and four ones semm trivial lol.

Edit: My point is that seven, eight, nine etc. aren't as impossibly hard as they seem.
 
It might be interesting to note that for \( n \) rings, the (conjectured) minimum number of moves required is \( 2^n -1 \), and this is achieved by the algorithm already mentioned above.
 
My "trick" is that whenever I have to choose something, it's practically always the smallest ring that goes first. You look for the pile you're currently moving, and figure where you want it to go; it doesn't matter if it's all the rings or just some. If it's an odd number of rings in the pile to move, you move the small ring to where the whole pile should go, and if it's an even number of rings, you move it to where you don't want the pile to end up.

It isn't hard really, and doing like 20 rings wouldn't be hard, just take time. It's like cubes! When you've solved 7x7, you can solve any numbered cube, it just takes time.
 
I agree with you in theory, but it's not really feasible to do that many rings. For instance, the 12 ring puzzle requires over 4000 moves.
I think I'm just going to stick with nine.
 
I agree with you in theory, but it's not really feasible to do that many rings. For instance, the 12 ring puzzle requires over 4000 moves.
I think I'm just going to stick with nine.

It isn't impossible to do them, it just takes a lot longer.

The Tower of Hanoi is pretty easy, but it gets boring after a few times.
 
It might be interesting to note that for \( n \) rings, the (conjectured) minimum number of moves required is \( 2^n -1 \), and this is achieved by the algorithm already mentioned above.

Yes.

There is an interesting variation in which you can only move rings to *adjacent* pegs - no moving from left to right or back for instance - and you must move the entire stack from the left peg to the right peg. This variation takes \( 3^n-1 \) moves for n rings and is slightly trickier to keep track of.
 
There is an interesting variation in which you can only move rings to *adjacent* pegs - no moving from left to right or back for instance - and you must move the entire stack from the left peg to the right peg. This variation takes \( 3^n-1 \) moves for n rings and is slightly trickier to keep track of.

Wow, I never thought to try that variation! That does sound neat, will have to give this a go. Trying to work out the process for 4 discs, and it already seems very interesting!

Chris
 
Back
Top