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

Home > Algorithms
Towers of Hanoi variation (Posted on 2005-05-03) Difficulty: 3 of 5
There are some poles, and on the first pole are some rings, each a different size. The sizes of the rings increases from the top to the bottom of the pole. The only allowable move is to take the top ring from any pole and place onto another pole. You cannot place a ring on top of another ring unless the other ring is exactly one size bigger. You can make as many moves as you like.

Your goal is to move all the rings onto the second pole, in the same order. What is the highest number of rings that can be moved when there are N poles? How can you move this many rings?

See The Solution Submitted by Tristan    
Rating: 4.0000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): solution (I think) | Comment 9 of 14 |
(In reply to re: solution (I think) by Jer)

You are right, Jer.  I was wasting a pole in my algorithm. 

During the first portion of move I was using:

a->1, b->2, c->3, b->3, a->3.

I should have done:

a->1, b->2, a->2, c->1, d->3, c->3, a->1, b->3, a->3.

That gives 1 more ring.

I'm starting to think that after the second pole, each subsequent pole adds 2 more rings to the total than the previous pole did, so for 1 empty pole you get 1, 2 empty poles you get 2 (total of 3 rings), 3 empty poles gets you 4 more (7 total), 4 empty poles gets you 6 more (13 total).

I don't know if you get 2 more or three more when you add the 5th empty pole, and I'm too lazy/busy-at-work right now to figure it out.
  Posted by Erik O. on 2005-05-03 18:20:50

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


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

Chatterbox:
Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information