Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

The Tower of Hanoi: Difference between revisions

From ZeroWiki
imported>Unknown
No edit summary
 
(Repair batch-0003 pages from live compare)
 
Line 1: Line 1:
==== Recurrent Problems - The Tower of Hanoi ====
==== Recurrent Problems - The Tower of Hanoi ====
T<sub>n</sub> is the minimum number of moves that will transfer n disks from one peg to another under Lucas's rules.
T<sub>n</sub> is the minimum number of moves that will transfer n disks from one peg to another under Lucas's rules.


===== small cases =====
===== small cases =====
T&lt;sub&gt;0&lt;/sub&gt; = 0,  T&lt;sub&gt;1&lt;/sub&gt; = 1,  T&lt;sub&gt;2&lt;/sub&gt; = 3 .....
T<sub>0</sub> = 0,  T<sub>1</sub> = 1,  T<sub>2</sub> = 3 .....


===== mathematical expression =====  
===== mathematical expression =====  
'''T&lt;sub&gt;0&lt;/sub&gt; = 0,  T&lt;sub&gt;n&lt;/sub&gt; = 2T&lt;sub&gt;n - 1&lt;/sub&gt; + 1, for n > 0'''
'''T<sub>0</sub> = 0,  T<sub>n</sub> = 2T<sub>n - 1</sub> + 1, for n > 0'''


===== closed form =====
===== closed form =====
'''T&lt;sub&gt;n&lt;/sub&gt; = 2&lt;sup&gt;n&lt;/sup&gt; - 1, for n >= 0'''
'''T<sub>n</sub> = 2<sup>n</sup> - 1, for n >= 0'''

Latest revision as of 00:29, 27 March 2026

Recurrent Problems - The Tower of Hanoi

Tn is the minimum number of moves that will transfer n disks from one peg to another under Lucas's rules.

small cases

T0 = 0, T1 = 1, T2 = 3 .....

mathematical expression

T0 = 0, Tn = 2Tn - 1 + 1, for n > 0

closed form

Tn = 2n - 1, for n >= 0