recurrence relation for the towers of hanoi
Download
Skip this Video
Download Presentation
Recurrence Relation for the Towers of Hanoi

Loading in 2 Seconds...

play fullscreen
1 / 2

Recurrence Relation for the Towers of Hanoi - PowerPoint PPT Presentation


  • 253 Views
  • Uploaded on

Recurrence Relation for the Towers of Hanoi. N No.Moves 1 1 2 3 3 7 4 15 5 31. Given: T(1) = 1 T(n) = 2 T( n-1 ) +1. T(n) = 2 T( n-1 ) +1. T(n) = 2 +1. T(n) = 2 [ 2 T(n-2) + 1 ] +1.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Recurrence Relation for the Towers of Hanoi' - aziza


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
recurrence relation for the towers of hanoi
Recurrence Relation for the Towers of Hanoi

N No.Moves

1 1

2 3

3 7

4 15

5 31

Given: T(1) = 1

T(n) = 2 T( n-1 ) +1

slide2

T(n) = 2 T( n-1 ) +1

T(n) = 2 +1

T(n) = 2 [ 2 T(n-2) + 1 ] +1

T(n) = 2 [ 2 + 1 ] +1

T(n) = 2 [ 2 [ 2 T(n-3) + 1 ]+ 1 ] +1

T(n) = 2 [ 2 [ 2 [ 2 T( n-4 ) + 1 ] + 1 ]+ 1 ] +1

T(n) = 24 T ( n-4 ) + 15

. . .

T(n) = 2k T ( n-k ) + 2k - 1

Since n is finite, k -> n. Therefore,

lim T(n) k -> n = 2n - 1

ad