logo

Towers of Hanoi: Recursive Algorithm and Real-World Applications

   

Added on  2022-11-13

11 Pages3021 Words321 Views
 | 
 | 
 | 
TOWERS OF HANOI 1
TOWERS OF HANOI
Name
Class name
Professor name
Institution
State
Date
Introduction
Towers of Hanoi: Recursive Algorithm and Real-World Applications_1

TOWERS OF HANOI 2
The tower of Hanoi puzzle was invented in 1883 by Edouard Lukas and is
widely applicable in computer science and discrete mathematics. The towers of
Hanoi problem are analyzed through the incorporation of a different number of discs
(Klahr and Kotovsky 2013). Considering the analysis, all the exercises aims at
effecting the movement of the discs from one peg to another peg following the
conditions stated in the preceding analysis. The discs utilized in the analysis of the
problem has different radii. The discs are numbered in an increasing order (Danesi
2004). This will, therefore, play an essential role in ensuring total adherence to the
conditions stated during the analysis of the algorithm in finding the solution to the
problem. The steps taken for each unique minimum solution is denoted by the
function 2^n-1 (Joyce & Weems, 2016). The description of the steps will be
achieved recursively through the employment of different conditions for all the
steps for the algorithm processes. Denoting the number of moves as Mn(o), the
recurrence relation will be noted by the following function.
Mn(0) =Mo(n-1)+1+Mo(n-1) for n>0. Considering the case when Mo (0)
=2^n-1. Solutions to the puzzle of the towers of Hanoi problem can be achieved
through the consideration of variations to conditions stated in the towers of Hanoi
problem. As analyzed in the above statements, it is worth noting that the towers of
Hanoi problem can be solved by putting into considerations the above-stated
conditions. The problem thus played an integral role in arriving at the best possible
solution for the problem. The problem has applications on drawing of a deeper
understanding of discrete mathematics concepts and the understanding of most
computer programming concepts and codes.
Towers of Hanoi algorithm problem is often used in computer algorithm
introductory texts for the demonstration of the strengths of recursive processes. To
ensure that the algorithm can work effectively so that the tasks can be solved
(Anderson et al. 2015). The original solutions that were presented for dealing with
the towers of Hanoi problem included the iterative algorithm processes. These
solutions deemed to be less mysterious in comparison to the recursive solutions
that have been initially employed (Danesi 2004). The movement of the smallest disc
is usually ensured in a cyclic order. A transparent and efficient algorithm may be
arrived at through a suitable representation of the towers of Hanoi problem. Bit-
string encoding of the disc moves will play a useful role in the examination of the
towers of Hanoi problem. Through this encoding, constructions can be made in
correlation to the forward iterative algorithm processes (Chen et al., 2015). The bit
string forms an integral part in the analysis of the algorithms utilized for finding the
solution for towers of Hanoi problem.
The problem definition
The towers of Hanoi are a problem where three pegs p1, p2, and p3 and n
number of discs ranging from D1, D2, D3, D4.........Dn, is placed on a peg with the
disc D1 on top of the pyramid. The discs increase from D1 to Dn. The problem
solution aims at ensuring the movement of the disc to pj from pi. The value of i is
not taken as equal to value of i. The solution of the problem is subjectable to the
following conditions.
Towers of Hanoi: Recursive Algorithm and Real-World Applications_2

TOWERS OF HANOI 3
The disc placed at the top of the tower Is the only disc which can be moved
from one peg to another.
At any time, the smaller disc must always rest on top of the larger disc.
Movement must be ensured to only a single disc at any given time.
Real world application of the towers of Hanoi problem
Even though the analysis of the math employs the utilization of recreational math.
Future use of the towers of Hanoi will employ most real-world applications (Spector,
2015). Finding the solution to the towers of Hanoi helps in increasing the level of
brain activity as it helps in building neural pathways and also in forging new
connections to the prefrontal lobe. When the brain is engaged in finding a solution
to the problem of the towers of Hanoi, brain activity is significantly increased, and
this plays an essential role in promoting time management, making more complex
arguments and in the presentation of a business plan (Chen et al., 2015). It is also
worth noting that the solution to the towers of Hanoi problem can bring
entertainment to those individuals interested in the problem.
Real world applications of the problem go beyond physical and mental benefits. The
puzzle is also applicable in certain specific jobs. A psychologist can effectively use
the towers of Hanoi puzzle to draw out psychological findings and research work
relating to problem-solving skills examination for different individuals (Hinz et al.,
2013). Through the calculation of moves and strategies, individuals are always in a
perfect position of improving their levels of problem-solving skills (Hinz et al. 2013).
This will significantly play an important role in outcomes predictions among the
activities engaged by such individual persons. Another real-world application of the
puzzle is in computer programming and algorithms (Tarasuik and Kaufman 2017).
The problem is widely used in reducing the amount of time required to find the
solution of given computer problems. The amount necessary for program creation is
also reduced through the utilization of the problem-solving concepts of Towers of
Hanoi.
Problem solution
The solution technique employed here is the recursive game technique.
Recursion of a function occurs when that function recalls itself (Cull et al. 2013).
Recursive processes are used in finding solutions to problems that comprises of
other minor issues of the same kind. Pseudocode for a recursive process for a given
function XX can is illustrated below.
The same recursive technique is also applicable in finding the solution to the puzzle
of the towers of Hanoi. In provision for the recursive analysis of the towers of Hanoi
problem, the preceding diagram can be employed in the analysis of the recursive
process for the towers of Hanoi.
Towers of Hanoi: Recursive Algorithm and Real-World Applications_3

TOWERS OF HANOI 4
The target aims at the movement of the three discs from the peg A to peg B. The
use of the recursive process is thus utilized in the performance of the task. Disc 1 is
moved from the peg A to peg C while the disc 2 is moved from the peg A to peg B
(Hinz et al., 2013). The final process involves the movement of the disc I from peg c
to peg B. The process is simple and quite entertaining for the individuals involved in
the process. The same process can also be applied when three discs are now
involved.
The solution of the problem can only be achieved through the exposure of the disc
3. This can only be achieved through the movement of the two-disc 1 and 2 to peg
Towers of Hanoi: Recursive Algorithm and Real-World Applications_4

End of preview

Want to access all the pages? Upload your documents or become a member.