- Joined
- Sep 20, 2022
- Messages
- 230
- Reaction score
- 38
Recently there was a post about the brute force method. The thread was deleted for some reason, but it did contain an interesting conjecture about the Towers of Hanoi.
I will restate it here, this is not my idea.
The list of the pegs used in the recursive solution, has a simple pattern, and so a non recursive program is easy to make.
12 13 23 12 13 23 ...
It is easy to test (for small cases, up to 16 discs) but I'm having trouble proving it for all cases.
Any ideas?
The reason I think this idea has merit is because if someone challenged me to solve the towers with 5 discs, I would have tried to apply the usual algorithm, lost track of the stack, and failed to solve a child's toy.
I will restate it here, this is not my idea.
The list of the pegs used in the recursive solution, has a simple pattern, and so a non recursive program is easy to make.
12 13 23 12 13 23 ...
It is easy to test (for small cases, up to 16 discs) but I'm having trouble proving it for all cases.
Any ideas?
The reason I think this idea has merit is because if someone challenged me to solve the towers with 5 discs, I would have tried to apply the usual algorithm, lost track of the stack, and failed to solve a child's toy.