Friday, March 29, 2019

Tower of Hanoi Solutions

loom of Hanoi Solutions footThe Tower of Hanoi is a puzzle popularized in 1883 by Edouard Lucas, a French scientist famous for his study of the Fibonacci sequence. However, this puzzles roots are from an ancient novel of a Hindu temple. The legend states that there is a secret means in a hidden temple that contains three large blasts. angiotensin-converting enzyme of these poles has 64 golden harrows stacked upon it, each phono graph recording macrocosm little then the disk underneath it, with the biggest disk at the bottom. Since the beginning of time, monks retain been trying to shift the 64 disks onto the third peg. The monks as well as can l unitysome(prenominal) imparting the disks if the following rules are followed. First, the monks can only unravel one disk at a time, and second, they cannot put larger disks on excrete of smaller disks. Once all 64 disks are shifted to the third peg, the area will end. After encountering this puzzle (in a simpler form) at a knowledge fair a couple years ago and seeing it on occasion even today in an engineering classroom environment, I immovable that this was the perfect opportunity to examine this puzzle at a deeper level.(A sanctioned rendition of a 3 disk tower) AimMy aim is to look for the discordent principles that read to the answer to the legend how much time would it ascertain for the world to end?Finding an Optimal StrategyIn sanctify to get closer to solving this puzzle, the goal will be to attend the most efficient way to get 64 disks onto the third peg. To interrupt grasp the mathematical concepts and patterns when solving the tower, it would be easier to look at a simpler version of the puzzle, such as the following 3 disk example.double star Code (Standard immemorial Code)We can relate the pattern seen above to double star code, specifically Standard Gray Code. Standard Gray Code is a binary numeral system where two successive values differ in only one (binary) digit. Using th is method may cause us closer to being able to solve the 64 disk tower. If we relate the example in Figure 1 with Standard Gray Code, victimization 3 binary digits, we are left with something like this000 tonus 1001 ill-use 2011Step 3010Step 4110Step 5111Step 6101Step 7100Step 8For example, Step 1 is examinen by the three digits 000. The next tempo is 001, changing the digit that corresponds with the smallest disk, which means disk 1 is the first of all disk to cause in the solution. And to continue, Step 2 is 011, showing that now the middle (second) disk is being moved. This method could lead us to the solution of a 64 disk tower, as it would show which disk to move however, the flaw in this method is that even though the binary digits can show which disk has moved, it does not show where to move it. There are always two possibilities for each disk, and when we factor in the 64 other disks, the calculations get extremely tedious and suboptimal as a solution.Recursive PatternT he next viable solution is conclusion a algorithmic pattern to determine how many moves it would take to solve the puzzle, depending on the get along of disks. A recursive pattern uses information from the previous step to examine the next. In dictate to move n amount of disks from peg 1 to peg 3, we can again refer to Figure 1. The first step is transferring n-1 disks from peg 1 to peg 3. We assign a varying to the number of moves this takes, in this case, M. Next, transfer the middle disk to peg 2 (step 3) and finally, transfer the remaining disks from peg 3 to peg 2 (step 4). When you move n amount of disks to any peg, the number of moves will be the same, no matter which direction you choose to go.From this, we can take a chance an equation to finding the moves needed for any number of disks 2M + 1, where M equals the number of moves needed to transfer n-1 disks from peg 1 to peg 2.This brings up another flaw to the problem. In order to find how many moves needed to trans fer 64 disks, we also need to calculate the number of moves for 63, 62, 61, etc amount of disks as well. Because of this, the recursive pattern cannot be used to find the time it takes before the world ends. However, what the recursive pattern can do is generate numbers that lead into a non recursive pattern. of Disks of Moves2M + 1112(0) + 1 = 1232(1) + 1 = 3372(3) + 1 = 74152(7) + 1 = 155312(15) + 1 = 31From hedge 2, we can see that the third column represents a geometric progression that can help us find a formula for a non-recursive pattern.Non-Recursive Pattern (Explicit Pattern)When looking back at Table 2, there is a direct correlation that can be do from the number of disks and the number of moves. Recognizing that there is a geometric progression, one could understand the pattern that is being used though the power of two. of Disks of Moves121 1 = 1222 1 = 3323 1 = 7424 1 =15525 1 =31Therefore the function to find the number of steps with any number of disks would b e 2n 1, with n being the of disks.Just to further prove that 2n 1 is the correct function, we can graph 2n 1 and compare to the number of disks and moves in Table 2.It completely fits the selective information points, confirming the relation between the points and the function. Now we can just stopple in the function 264 1 = 590,000,000,000 yearsConclusionIn order to move 64 disks from the first peg to the third, the monks would need over 590 million years, assuming that they can move one disk per second. The function 2n 1 was found by recognizing the geometric progressions in the recursive formula and using it in an explicit pattern. This function can be used to find the most optimal number of moves it would take to move any number of disks to the third peg.BibliographyBogomolny, Alexander. Tower of Hanoi. Tower of Hanoi. N.p., n.d. Web. 3 Mar. 2017. .Johnson, P. Sam, Recurrence Relations And Their Solutions (Problem Tower Of Hanoi), 2015 December 26, and 1/1. Information on Subsets of a Set. N.p., n.d. Web. 3 Mar. 2017. .Longman, Addison Wesley. Millers numeral Ideas, 9th rendering Web Site Chapter 4 Internet Project. Millers mathematicsematical Ideas, 9th Edition Web Site Chapter 4 Internet Project. Pearson Education, n.d. Web. 3 Mar. 2017.Math, Dr. Ask Dr. Math FAQ Tower of Hanoi. Mathforum.org. Drexel University, n.d. Web. 3 Mar. 2017.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.