Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Tower of Hanoi
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Cyclic Hanoi === In Cyclic Hanoi, we are given three pegs (A, B, C), which are arranged as a circle with the clockwise and the counterclockwise directions being defined as A β B β C β A and A β C β B β A, respectively. The moving direction of the disk must be clockwise.<ref>{{cite journal |first=T. D. |last=Gedeon |title=The Cyclic Towers of Hanoi: An Iterative Solution Produced by Transformation |journal=The Computer Journal |volume=39 |issue=4 |year=1996 |doi=10.1093/comjnl/39.4.353 |pages=353β356}}</ref> It suffices to represent the sequence of disks to be moved. The solution can be found using two mutually recursive procedures: To move ''n'' disks '''counterclockwise''' to the neighbouring target peg: # move ''n'' β 1 disks '''counterclockwise''' to the target peg # move disk #''n'' one step clockwise # move ''n'' β 1 disks '''clockwise''' to the start peg # move disk #''n'' one step clockwise # move ''n'' β 1 disks '''counterclockwise''' to the target peg To move ''n'' disks '''clockwise''' to the neighbouring target peg: # move ''n'' β 1 disks '''counterclockwise''' to a spare peg # move disk #''n'' one step clockwise # move ''n'' β 1 disks '''counterclockwise''' to the target peg Let C(n) and A(n) represent moving n disks clockwise and counterclockwise, then we can write down both formulas: {| | || {{nowrap|1=C(n) = A(nβ1) n A(nβ1)}} || and || {{nowrap|1=A(n) = A(nβ1) n C(nβ1) n A(nβ1).}} |- | style="padding:1ex 3ex;"| |- | Thus || C(1) = 1 || and || A(1) = 1 1, |- | || C(2) = 1 1 2 1 1 || and || A(2) = 1 1 2 1 2 1 1. |} The solution for the Cyclic Hanoi has some interesting properties: # The move-patterns of transferring a tower of disks from a peg to another peg are symmetric with respect to the center points. # The smallest disk is the first and last disk to move. # Groups of the smallest disk moves alternate with single moves of other disks. # The number of disks moves specified by C(n) and A(n) are minimal.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Tower of Hanoi
(section)
Add topic