Season 3 • Episode 18 • The Tower of Hanoi

Download (0)

Full text

(1)

Season 3Episode 18The Tower of Hanoi

0

The Tower of Hanoi

Season 3

Episode 18 Time frame 2 periods

Prerequisites :

Introdutiontoproofbyindution.

Objectives :

Understandtheusefulnessofindutioninalgorithms.

Materials :

CardboardtowersofHanoi.

Beamer.

WoodentowerofHanoi.

1 – Find the shortest number of moves for n ∈ { 2 , 3 , 4 }. 25 mins

Studest work in pairsorgroupsof three tond awayto movethetowertoits destination.Numberof

movesareompared.

2 – Study the movements 30 mins

Answerto thefollowingquestions:

Wheretomovetherstdisk?

Is itpossibletodesribeasimplealgorithmsolvingthepuzzle?

Whatisthelowestpossiblenumberofmovesfora

n

diskstower?

3 – The formula for n disks 35 mins

Prove the general formula for the number of moves for the

n

disks tower. Then, use it to answer the questionfromthelegend:whenwill theend oftheworldtakeplae?

4 – Graph representation 20 mins

Thegraphofallpossiblemovesisshownfor

n = 2

,

n = 3

and

n = 4

.RelationwiththeSierpinskitriangle

(2)

The Tower of Hanoi

Season 3

Episode 18 Document Lesson

ThepuzzlewasinventedbytheFrenhmathematiianÉdouardLuasin1883.It'sbasedonaVietnamese

orIndianlegendaboutatemplewhihontainedalargeroomwiththreetime-wornpostsinitsurrounded

by64 golden disks.The priestsof Brahma,atingouttheommand ofananientprophey,havebeen

movingthesedisksfromtherstpost tothethird,in aordanewiththefollowingrules:

Onlyonediskmaybemovedat atime.

Eahmoveonsistsoftakingtheupperdiskfromoneofthepostsandslidingitontoanotherpost,on

topoftheotherdisksthatmayalreadybepresentonthat post.

Nodiskmaybeplaedontopofasmallerdisk.

Aordingtothelegend,whenthelastmoveofthepuzzleisompleted,theworldwillend.Itisnotlear

whether Luasinventedthislegendorwasinspiredbyit.

Simple solution to the puzzle

The followingproedure yields thelowestpossiblenumberofmovesto moveanynumberof disksfrom

therstposttothethird.

Ifthenumberofdisksisodd,startbymovingthesmallestdisktothedestinationpost.Ifthe

numberofdisksiseven,startbymovingthesmallestdisk totheintermediarypost.

Then, alternate movesbetweenthe smallestpiee and a non-smallest piee. When moving

the smallestpiee, always move it in the samediretion (either to the left orto the right,

aordingtoyourrstmove,butbeonsistent).Ifthereisnotowerin thehosendiretion,

moveitto theopposite end. Whenthe turnis tomovethe non-smallestpiee,there isonly

onelegalmove.

The lowest number of moves

Theorem 1

The lowest number of moves necessary to move a n disks tower is 2 n − 1 .

Proof.Let'sprovethisresultbyindution.

Basis : First,onsider the

1

-disk situation.Then,thelowest numberof movesisobviously

1 = 2 1 − 1

,

sothepropertyistrue.

Indutive step: Then, suppose that we have proved the lowest number of moves needed to move a

k

disks toweris

2 k

, for anaturalnumber

k

. Let'slook at the

k + 1

disks tower.Tomoveit to

thedestination post, we must rstmove the

k

disks at the topof the tower to theintermediary post, then move the largestdisk to the destination post, then move the

k

disks tower from the intermediaryposttothedestinationpost.Aordingtoourindutionhypothesis,thetotalnumber

ofmovesforthisproedure is

(2 k − 1) + 1 + (2 k − 1) = 2 × 2 k − 1 = 2 k +1 − 1 .

Sothepropertyistrueforthe

k + 1

diskstower.

Conlusion : Sineboththebasisandtheindutivestephavebeenproved,ithasnowbeenprovedby

mathematialindution thatthepropertyholdsforallnatural

n

.

The end of the world

Ifthelegendweretrue,andifthepriestswereabletomovedisksat arateofoneperseond,usingthe

smallestnumberofmoves,it would takethem

2 64 − 1

seondsorroughly600billionyearsto movethe

(3)

Season 3Episode 18The Tower of Hanoi

2

Document 1

CardboardtowersofHanoi

Figure

Updating...

References

Related subjects :