Top Banner
Chapter 6 Recurrence and Solution
14

Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

Chapter 6

Recurrence and Solution

Page 2: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

6.2Recurrence Relation

6.3Solve Homogeneous Recurrence

6.4Solve Nonhomogeneous Recurrence

Page 3: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

1 2 3

1 2 3

1 2 3

6.2Recurrence Relation

Page 4: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

1 2 3

1 2 3

1 2 3

Page 5: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

1 2

( ) 2 ( 1) 1

2[ 2 ( 2) 1] 1

2 2 1

2 1

n n

n

T n T n

T n

Page 6: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

Example 2 Region partition for n lines.

Page 7: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

( ) ( 1) , 0R n R n n n

( ) ( 2) 1

(0) 1 2 1

( 1) 1

2

R n R n n n

R n n

n n

Page 8: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

6.3Solve Homogeneous Recurrence

Try . Is that O.K.?

Yes!

0 1 1 2( ) ( )n nnF C r C r

1 1 2 20 1 1 2 0 1 1 2 0 1 1 2

1 2 1 20 1 1 1 1 2 2 2

2 2 2 20 1 1 1 1 2 2 2

( ) ( ) [ ( ) ( ) ] [ ( ) ( ) ]

[ ] [ ]

[ 1] [ 1]

0

n n n n n n

n n n n n n

n n

C r C r C r C r C r C r

C r r r C r r r

C r r r C r r r

Definition:

Fibonacci Sequence: 0,1,1,2,3,5,8,…

Fibonacci Sequence: 021 nnn FFF

Page 9: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

Characteristic Equation:

Using boundaries: and

012 rr

2

511

r

2

512

r

0 11 5 1 5

2 2

n n

nF C C

00 F 11 F

Page 10: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

We have 0100 CCF

1 0 11 5 1 5 1

2 2F C C

5

10 C

5

11

C

1 11 5 1 55 52 2

n n

nF

Page 11: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

e.g. 3.3 (NTU) Solve with and1 26 9n n nT T T 0 5T 1 6T

1 2 3r r

nnn nCCT 33 10

0 0

1 1 1

5

5 3 1 3 15 3 6

T C

T C C

nnn nT 3335

Page 12: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

6.4Solve Nonhomogeneous Recurrence

Example 1 Solve with and 1 22 4n n nT T T 0 2T 1 3T

( ) ( )p h

n n nT T T ( )pnT C

)()( hn

pnn TTT

( ) ( ) ( ) ( )1 1 2 22 4h p h p

n n n nT T T T

Page 13: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

Uisng

We have

Let , we have

It yields , and then we have

( )( )1hh

n nT T ( )22 0h

nT

( ) ( )( )1 22 4p pp

n n nT T T

CT pn )( 42 CCC

2C

0 1 2 ( 1) 2

p hn n n

n n

T T T

C C

Page 14: Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.

Finally, we have

0 0 1 2 2T C C

1 0 12 2 3T C C

From

3 2 ( 1) 2n nnT