Exploring the Limits of the Towers of Hanoi Problem

  • Thread starter asdf60
  • Start date
  • Tags
    Limits
In summary, the conversation was about the famous Towers of Hanoi problem and whether there exists an initial configuration of the disks on three pegs that requires more than 2^n-1 moves to construct a tower on the rightmost peg. The conversation also touched on the proof of the classic solution and different algorithms for solving the problem. The participants also discussed the origin of the problem and whether one of them was Vietnamese. One participant had already solved the problem and the other asked for clarification on their nationality.
  • #1
asdf60
81
0
Here's an interesting question about the famous Towers of Hanoi problem. Is there any initial configuration of the disks on three pegs that requires more than 2^n-1 moves (to construct a tower on the rightmost peg)?
 
Mathematics news on Phys.org
  • #2
This almost sounds like a homework problem! Have you thought about the question at all? Do you know (well) the proof that the classic solution works in 2^n - 1 steps?
 
  • #3
No I assure you it's not a homework problem. heck, there's no school now!
Yes I do know the classic proof...
 
  • #4
asdf60 said:
Here's an interesting question about the famous Towers of Hanoi problem. Is there any initial configuration of the disks on three pegs that requires more than 2^n-1 moves (to construct a tower on the rightmost peg)?


?? That's a peculiar question but the answer should be obvious. The standard Towers of Hanoi problem has all disks on one peg and it is fairly easy to prove that it then takes 2^n-1 moves to move them all to another peg.

Suppose you started with all the disks on one peg and then move the top disk. How many moves are required to get from that configuration to the end?
 
  • #5
I assert that the proof for your special case is almost identical to the proof for the classical problem.
 
  • #6
Here's a link to a http://thinks.com/java/hanoi/hanoi.htm
 
Last edited by a moderator:
  • #7
It's clear to me now that it is always less than 2^n-1, but I don't think that it's obvious, to me at least.

HallsofIvy, I don't really see where you're going with that...
 
  • #8
I think that HoI is suggesting you formulate a recurrence relation.
 
  • #9
asdf60 said:
It's clear to me now that it is always less than 2^n-1, but I don't think that it's obvious, to me at least.
HallsofIvy, I don't really see where you're going with that...

I think your original problem requires you to formulate an argument to show that any (valid) initial configuration will require at most the same number of moves required in the standard Tower initial configuration (i.e. all disk on the same post). You stated that it is now clear to you that it is true but I suggest that you write it out so others can verify if your logic is correct.

Regarding the "standard" Tower problem, Halls is simply pointing out how the "classic proof" is done. You say you "know the classic proof" but you haven't shown it. If you need help on that part, say so! :)
 
  • #10
hi, is there an iterative algorithm to solve the tower of hanoi problem. i know the recursive one:

1. move n-1 discs from peg A to peg B.
2. mobe the nth disc to peg C.
3. move n-1 discs from peg B to peg C.

but what is the iterative algorithm (if there is any)?

thanks in advance to anyone who can help.
 
  • #11
Actually, what I was pointing out is that the original question was "Is there any initial configuration of the disks on three pegs that requires more than 2^n-1 moves (to construct a tower on the rightmost peg)?" where the "initial configuration of the disks on the three pegs" for the classical problem, that requires 2^n-1 moves, has all n disk on the "leftmost peg".

My point in my original response was: suppose you have already made the first move in the classical solution: isn't that a configuration which now requires 2^n- 2 moves? For that matter, suppose you have an "initial configuration" in which all except the smallest disk are already on the rightmost peg. Isn't that an "initial configuration" which will now require only one move?

Unless I am misunderstanding, the answer is obviously "yes, there exist initial configurations which require fewer than 2^n-1 moves".
 
  • #12
He was asking if there was an initial configuration needing *more* than 2^n-1 moves. Less is pretty obvious like you say!
 
  • #13
Dang! One of these days, I'm going to have to learn to distinguish between "more" and "less"!
 
  • #14
asdf60 said:
Here's an interesting question about the famous Towers of Hanoi problem. Is there any initial configuration of the disks on three pegs that requires more than 2^n-1 moves (to construct a tower on the rightmost peg)?
Hi ,Did you solve your problem ? Are you a vietnamese :biggrin:
 
  • #15
yes, i solved the problem, and no, I'm not viatnamese. why do you ask?
 
  • #16
asdf60 said:
yes, i solved the problem, and no, I'm not viatnamese. why do you ask?

HINT: Where is Hanoi? :uhh:
 
  • #17
heh I'm sorry, i forgot all about the problem
are you a vet?
 

1. What is the Towers of Hanoi problem?

The Towers of Hanoi problem is a mathematical puzzle that consists of three rods and a number of disks of different sizes. The objective of the puzzle is to move all the disks from one rod to another, following these three rules: only one disk can be moved at a time, a larger disk cannot be placed on top of a smaller disk, and all disks must be moved to the third rod without any intermediate steps.

2. How many moves does it take to complete the Towers of Hanoi problem?

The minimum number of moves required to complete the Towers of Hanoi problem with n disks is 2^n - 1. This means that for a puzzle with 3 disks, it would take 7 moves, for 4 disks it would take 15 moves, and so on.

3. What is the significance of the Towers of Hanoi problem?

The Towers of Hanoi problem is significant because it helps us understand the concept of recursion and the power of algorithms. It also has real-world applications in computer science, such as in data structure and data sorting algorithms.

4. How can the Towers of Hanoi problem be solved?

The Towers of Hanoi problem can be solved using a recursive algorithm, which breaks down the problem into smaller subproblems until they can be easily solved. The algorithm for this problem is known as the "Tower of Hanoi algorithm."

5. Are there any variations of the Towers of Hanoi problem?

Yes, there are many variations of the Towers of Hanoi problem, including the Towers of Hanoi with more than 3 rods, different starting and ending configurations, and different rules for moving the disks. These variations can make the problem more challenging and require different approaches to solve.

Similar threads

  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
25
Views
5K
Replies
14
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Programming and Computer Science
Replies
8
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
7K
  • Programming and Computer Science
Replies
5
Views
2K
  • General Math
Replies
4
Views
4K
  • General Math
Replies
1
Views
1K
Back
Top