Recurrence relation for the towers of hanoi
Download
1 / 2

Recurrence Relation for the Towers of Hanoi - PowerPoint PPT Presentation


  • 255 Views
  • Updated 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.

Related searches for Recurrence Relation for the Towers of Hanoi

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 l.jpg
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 l.jpg

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