Solving Recurrence Relations with Generating Functions - faculty

263 downloads 463 Views 131KB Size Report
Solving Recurrence Relations with Generating Functions. The sequence of numbers 1,1,2,3,5,8,13, .... is known as the Fibonacci sequence. We can describe the ...
Solving Recurrence Relations with Generating Functions The sequence of numbers 1,1,2,3,5,8,13, .... is known as the Fibonacci sequence. We can describe the sequence in terms of a recurrence relation. Let an denote the n’th term in this sequence (where n = 0, 1, 2, 3, . . . ). Then we can define the sequence as: a0 = 1, a1 = 1 and an = an−1 + an−2 for n ≥ 2. How do we find a formula for an ? Let G(x) = a0 + a1 x + a2 x2 + · · · + an xn + · · · be the generating function for the sequence. Then

G(x) = 1 + x + = 1+x+ = 1+x+

∞ X

an xn

n=2 ∞ X

(an−1 + an−2 )xn

n=2 ∞ X

n

an−1 x +

n=2

∞ X

an−2 xn

n=2 2

3

= 1 + x + (a1 x + a2 x + · · · ) + (a0 x2 + a1 x3 + a2 x4 + · · · ) = 1 + x + x(a1 x + a2 x2 + · · · ) + x2 (a0 + a1 x + a2 x2 · · · ) = 1 + x + x(G(x) − 1) + x2 G(x)

Therefore, G(x) = 1 + x + x(G(x) − 1) + x2 G(x). From this, we obtain 1 −1 that G(x) = 1−x−x 2 = x2 +x−1 . −1 What is the expansion for x2 +x−1 ? The roots of −x2 + x + 1 = 0 are x=

√ −1± 5 . 2

Let α1 =

√ −1+ 5 2

and α2 =

√ −1− 5 . 2

Then

−1 −1 1 1 1 = = ( − ). +x−1 (x − α1 )(x − α2 ) α1 − α2 x − α2 x − α1 √ 1 1 Given that α1 − α2 = 5 it follows that G(x) = √15 ( x−α − x−α ). We also 2 1 have G(x) =

x2

1 x − α1

= −

1 1 1 x x2 ( ) = − (1 + + + ···) α1 1 − αx1 α1 α1 α12

1 x − α2

= −

1 1 1 x x2 ( ) = − (1 + + + · · · ). α2 1 − αx2 α2 α2 α22 1

Since G(x) = 0, 1, 2, 3, . . . .

−1 (x−α1 )(x−α2 ) ,

it follows that an =

√1 5



1 αn+1 1



1



αn+1 2

, n =

Example Solve for an given that a0 = 0, a1 = 6 and an = −3an−1 + 10an−2 + 3 · 2n , for n ≥ 2. Solution Let G(x) = Then G(x) = 6x + = 6x +

∞ X n=2 ∞ X

P∞

n=0 an x

n

be the generating function for a0 , a1 , a2 , . . . .

an xn −3an−1 + 10an−2 + 3 · 2n )xn

n=2 ∞ X

= 6x − 3

an−1 xn + 10

n=2

∞ X

an−2 xn − 3

n=1

∞ X

2n xn

n=2

= 6x − 3x(a1 x + a2 x2 + · · · ) + 10x2 (a0 + a1 x + a2 x2 + · · · ) + 3((2x)2 + (2x)3 + (2x)4 + · · · ) = 6x − 3xG(x) + 10x2 G(x) + 3 · (2x)2 (1 + (2x) + (2x)2 + · · · ). From the above, we see that G(x) = 6x + G(x)(−3x + 10x2 ) + 12x2 · Therefore,

12x2 1 − 2x 12x2 6x + . 1 + 3x − 10x2 (1 − 2x)(1 + 3x − 10x2 )

G(x)(1 + 3x − 10x2 ) = 6x + G(x) =

Note that 1 + 3x − 10x2 = (1 − 2x)(1 + 5x). Therefore G(x) =

1 1−2x .

6x 12x2 + . (1 − 2x)(1 + 5x) (1 − 2x)2 (1 + 5x)

Using partial fractions, we obtain that 1 2 1 5 1 = · + · . (1 − 2x)(1 + 5x) 7 (1 − 2x) 7 1 + 5x From this, we also obtain that 1 2 1 10 1 25 1 = · + · + . (1 − 2x)2 (1 + 5x) 7 (1 − 2x)2 49 1 − 2x 49 1 + 5x 2

Therefore 

   2 1 1 10 1 5 1 25 1 2 2 G(x) = 6x +12x + . + + 7 1 − 2x 7 1 + 5x 7 (1 − 2x)2 49 1 − 2x 49 1 + 5x   1 1 The coeff. of xn in 6x 72 1−2x + 57 1+5x equals 6× coeff. of xn−1 in  5 1 2 1 6 27 · 2n−1 + 57 · (−5)n−1 . 7 1−2x + 7 1+5x which equals   1 10 1 25 1 The coeff. of xn in 12x2 72 (1−2x) equals 12× coeff. 2 + 49 1−2x + 49 1+5x  1 10 1 25 1 2 n−2 + 10 2n−2 + 25 (−5)n−2 . of xn−2 in 27 (1−2x) 2 + 49 1−2x + 49 1+5x which equals 12 7 (n − 1) · 2 49 49 Putting the above together, we obtain that     2 10 n−2 25 2 n−1 5 n−1 n−2 n−2 ·2 + · (−5) +12 (n − 1) · 2 + 2 + (−5) , n ≥ 2. an = 6 7 7 7 49 49

3