1 / 2

# Recurrence Relation for the Towers of Hanoi - PowerPoint PPT Presentation

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

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

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

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

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 +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