Abstract
Any sequence of legal moves leads the Towers of Hanoi puzzle to an arrangement from which the final configuration must be built up. A recursive algorithm which finishes off the puzzle is considered and, assuming a uniform distribution on the possible unfinished situations, the density function of the number of moves it takes is derived.
Similar content being viewed by others
References
M.D. Atkinson, The cyclic towers of Hanoi, Inf. Proc. Lett. 13, 3 (1981)118.
R.R.W. Ball, Mathematical Recreations and Essays (McMillan, London, 1892).
P. Buneman and L. Levy, The towers of Hanoi problem, Inf. Proc. Lett. 10, 4 (1980)243.
R.W. Floyd and R.L. Rivest, Expected time bounds for selection, Commun. ACM 18, 3 (1975)165.
P.J. Hayes, A note on the towers of Hanoi problem, Comput J. 20(1977)282.
R.M. Karp, The probabilistic analysis of some combinatorial search algorithms, in: Algorithms and Complexity: New Directions and Recent Results, ed. J.F. Traub (Academic Press, New York, 1976) p. 1.
R.M. Karp, Probabilistic analysis of partitioning algorithms for the Traveling Salesman problem in the plane, Maths. Oper. Res. 2(1977)209.
F. Scarioni and M.G. Speranza, Probabilistic analysis of an error-correcting algorithm for the Towers of Hanoi puzzle, Inf. Proc. Lett. 18, 2 (1984)99.
R. Sedgewick, The analysis of Quicksort programs, Acta Inf. 7, 4 (1977)327.
P.M. Spira, A new algorithm for finding all shortest paths in a graph of positive arcs in average time o(n logn), SIAM J. Comput. 2, 1 (1973)28.
T.R. Walsh, The towers of Hanoi revisited: moving the rings by counting the moves. Inf. Proc. Lett. 15, 2 (1982)64.
T.R. Walsh, Iteration strikes back (at the cyclic Towers of Hanoi), Inf. Proc. Lett. 16, 2 (1983)91.
T.R. Walsh, A case for iteration, to appear in: Congressus Numerantium.
D. Wood, The Towers of Brahma and Hanoi revisited, J. of Recreational Math. 14(1981)17.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Scarioni, F., Speranza, M.G. The density function of the number of moves to complete the Towers of Hanoi puzzle. Ann Oper Res 1, 291–303 (1984). https://doi.org/10.1007/BF01874394
Issue Date:
DOI: https://doi.org/10.1007/BF01874394