17
1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

Embed Size (px)

Citation preview

Page 1: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

1

Linear Recurrence Relations

Part I

Jorge Cobb

The University of Texas at Dallas

Page 2: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

2

Solving recurrence relations Setting up a recurrence relation is important –

it corresponds to modeling a problem Solving it (providing a sequence that satisfies

the recurrence) is also needed Sometimes, this can be done through

iteration/induction For certain types of recurrence relations,

there are systematic methods for solving them

Page 3: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

3

Linear recurrence relations of degree k

an = c1an-1 + c2an-2 + ... + ckan-k with c1,c2,...,ck real numbers and ck≠0

Linear: The right-hand side is a sum of weighted previous

terms of the sequence – the weights do not depend on the sequence (but not necessarily constant, may be a function of n)

Page 4: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

4

an = c1an-1 + c2an-2 + ... + ckan-k with c1,c2,...,ck real numbers and ck≠0

Homogeneous: No terms appear on the right hand side that are not

multiples of a previous term

Of degree k: The recurrence goes back k terms, i.e., the earliest

previous term on the right hand side is an-k

Constant coefficients: The multipliers of the previous terms are all constants, not

functions that depend on n

Linear homogeneous recurrence relations of degree k with constant coefficients

Page 5: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

5

Classifying recurrences

an=2an-1 + an-22

an=an-1an-2

an=an-1+an-2

an=1.05an-1

an=nan-1

an=2an-1+1

an=an-1+an-4

Classification doesn’t depend on initial values

Not linear

Non-homogeneous

Not linearYes, degree 2

Coefficients are not constant

Yes, degree 1

Yes, degree 4

Page 6: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

6

First degree linear homogeneous recurrence relations with const. coef.

an = c1an-1

Recall the compound interest example Through iterative expansion, an = c1an-1 = c1(c1an-2) = c1

2an-2 = c12(c1an-3) =

c13an-3 = ... = c1

na0

Page 7: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

7

Approach for a general solution

an = c1an-1 + c2an-2 + ... + ckan-k

Pretend that there is a solution of the form an=rn for some constant r

rn = c1rn-1 + c2rn-2 + ... + ckrn-k

rk – c1rk-1 – c2rk-2 - ... – ck-1r – ck = 0 This is the characteristic equation of the

recurrence relation; the numbers r that satisfy it are the characteristic roots of the recurrence relation

Page 8: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

8

Second degree linear homogeneous recurrence relations

Assumptions

Recurrence relation: an = c1an-1 + c2an-2 Characteristic equation has two distinct roots r1, r2.

Theorem 1

{an} is a solution of the recurrence

if and only if

{an} is of the form an = b1r1n + b2r2

n for all n≥0, and for some constants b1, b2

Page 9: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

9

Proving Theorem 1 We need to prove both directions:

If {an} is a solution, then it must be of the form an= b1r1

n + b2r2n

for some appropriately chosen constants b1

and b2

If {an} is of the form an= b1r1

n + b2r2n

for all n≥0, then it must be a solution.

We prove the second one first (harder )

Page 10: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

10

Proving Theorem 1, first part Show an = b1r1

n + b2r2n, n≥2, is a solution

Because r2 – c1r – c2 = 0 and r1 and r2 are roots,

Therefore,

)()(

)()(

2212

222112

11

222

2112

122

1111

2211

crcrbcrcrb

rbrbcrbrbc

acaca

nn

nnnn

nnn

22221

21211 , rcrcrcrc

nn

nnn

rbrb

rrbrrba

2211

22

222

21

211

Page 11: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

11

Proving Theorem 1, first part

What about n=1 and n=0?

These are just the initial conditions of our solution

210

220

110

2211122

1111

bbrbrba

rbrbrbrba

Page 12: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

12

Proving Theorem 1, second part

Show that if {an} is a solution it must be of the form an = b1r1

n + b2r2n (we must find b1 and b2)

Note: a second-degree linear homogeneous recurrence has a unique solution {an} if a0 and a1 are specified

Because there is a single way to generate the terms an from the two initial values

Therefore, if we show that there is a solution of the form an = b1r1

n + b2r2n, n ≥0, that satisfies the initial

values a0 and a1, this must be the solution that was given to us, and we are done.

Page 13: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

13

Proving Theorem 1, second part

We first show that there are b1 and b2 such that b1r1

0 + b2r20 = a0 and b1r1

1 + b2r21 = a1

These simplify to b1 + b2 = a0

b1r1 + b2r2 = a1, (two linear equations, two unknowns)

12

1012101212122120 )()(

rr

raabraabrrarbrba

12

120

12

1011020

12

1010201 rr

ara

rr

raarara

rr

raaabab

201 bab

Page 14: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

14

Consider the sequence {a’n}, where a’n = b1r1

n + b2r2n, and a’0 = a0, a’1 = a1

From the first part of the theorem, we have shown that a’n = b1r1

n + b2r2n is a solution for any b1

and b2

We have shown (previous slide) that b1 and b2 can be chosen so that the satisfy a’0 = a0, a’1 = a1

Thus, {a’n} is a solution, just like {an}, and with the same initial conditions.

However, the initial conditions determine the rest of the sequence.

Hence, {a’n} = {an} and {an} is in the desired form.

Proving Theorem 1, second part

Page 15: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

15

Notes about the proof

Our proof of the second part also serves as the means to find the solution

It depended on r1 ≠ r2

The characteristic roots r1 and r2 may be complex numbers (the proof and the solution are still valid)

Page 16: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

16

Example solution

an = an-1 + 2an-2, a0=2 and a1=7 Characteristic equation

r2 – r – 2 = 0 The quadratic formula for ax2+bx+c = 0,

gives roots r1=(1-(3))/2=-1 and r2=(1+(3))/2 = 2

a

acbbx

2

42

Page 17: 1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas

17

Example solution

Therefore,

33

9

)1(2

)1(27

12

1012

rr

raab

13

3

)1(2

722

12

1201

rr

arab

nnnnnnn rbrba )1(2323)1(12211