All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Towers of Hanoi (Posted on 2003-09-07) Difficulty: 3 of 5
You have three small poles and five hoops - XS, S, M, L, XL (as in extra small, small, medium, large and extra large). They are placed on pole 1 in order, with largest at the bottom.

You can move one hoop at a time, and the hoops you are not moving have to be on a pole. You also cannot place a hoop on top of a smaller one. How can you move the hoops so that they are in the same order as they are now, but on pole 3?

See The Solution Submitted by Lewis    
Rating: 3.0667 (15 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: Holy Hula Hoops! | Comment 4 of 21 |
(In reply to Holy Hula Hoops! by Eric)

If the smallest is always designated 1, and you always start moving that (and the other odd numbers) to pole 3 (the target pole), and start off the even ones to pole 2, then, in the case of an even starting number of hoops, they will wind up on the wrong hoop.

Take the simplest even case: two hoops. Moving hoop 1 to pole 3, then hoop 2 to pole 2 then hoop 1 to pole 2 has moved them to the wrong pole.

If we want to say that even numbered hoops should start out toward pole 2 then the numbering should be from the bottom (largest) hoop. Then it works out correctly: if there are an even number of hoops the top hoop will have an even number; if there are an odd number of hoops the top hoop will have an odd number.

  Posted by Charlie on 2003-09-07 11:14:04

Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2019 by Animus Pactum Consulting. All rights reserved. Privacy Information