Anda di halaman 1dari 221

Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations

R S Selvaraj
Department of Mathematics
NIT Warangal

for
II B.Tech. CSE
of
VNRVJIET

21 & 22.10.2016

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Presentation Overview

1 Sequences

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Presentation Overview

1 Sequences
2 Recurrence Relations

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Presentation Overview

1 Sequences
2 Recurrence Relations
3 Generating Functions of sequences

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Presentation Overview

1 Sequences
2 Recurrence Relations
3 Generating Functions of sequences
4 Solving Recurrence Relations

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Presentation Overview

1 Sequences
2 Recurrence Relations
3 Generating Functions of sequences
4 Solving Recurrence Relations
by Generating Functions

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Presentation Overview

1 Sequences
2 Recurrence Relations
3 Generating Functions of sequences
4 Solving Recurrence Relations
by Generating Functions
by the Method of Characteristic Roots

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Definition

A sequence of elements from a set S is a function f : W∗ → S

[W∗ ⊆ set of all whole numbers = {0, 1, 2, 3, . . .}]

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Definition

A sequence of elements from a set S is a function f : W∗ → S

[W∗ ⊆ set of all whole numbers = {0, 1, 2, 3, . . .}]


The sequence can be listed as f (0), f (1), f (2), . . .

or

can be listed as f0 , f1 , f2 , . . .

or

can be denoted as {fn }

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Definition

A sequence of elements from a set S is a function f : W∗ → S

[W∗ ⊆ set of all whole numbers = {0, 1, 2, 3, . . .}]


The sequence can be listed as f (0), f (1), f (2), . . .

or

can be listed as f0 , f1 , f2 , . . .

or

can be denoted as {fn }


If the sequence is denoted as {an } or {sn } then it refers the
function a : W∗ → S or s : W∗ → S

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Examples

Consider the sequence {an } where an = n1 :

1 1 1
Here the sequence is 1, , , , . . .
2 3 4

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Examples

Consider the sequence {an } where an = n1 :

1 1 1
Here the sequence is 1, , , , . . .
2 3 4
Consider the sequence {an } where an = 3n :

Here the sequence is 1, 3, 9, 27, . . .

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Examples

Consider also a sequence {an } listed as:

1, 10, 11, 100, 101, 110, 111, . . .

CAN YOU find out what is the nth term an ?

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Examples

Consider also a sequence {an } listed as:

1, 10, 11, 100, 101, 110, 111, . . .

CAN YOU find out what is the nth term an ?


The above an represents the binary representation of the positive
integer n with no leading zeros

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Sequences - Examples

Consider also a sequence {an } listed as:

1, 10, 11, 100, 101, 110, 111, . . .

CAN YOU find out what is the nth term an ?


The above an represents the binary representation of the positive
integer n with no leading zeros
Consider also a sequence {an } listed as:

1, 1, 2, 3, 5, 8, 13, . . .

CAN YOU find out what is the nth term an ?

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Definition

A RECURRENCE RELATION for the sequence {an } is an


equation that expresses the nth term an in terms of one or more
of the previous terms of the sequence

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Definition

A RECURRENCE RELATION for the sequence {an } is an


equation that expresses the nth term an in terms of one or more
of the previous terms of the sequence
For example, in the sequence 1, 3, 9, 27, 87 . . .,

each term is 3 times the previous term

and so an = 3an−1 , n ≥ 1 with a0 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Definition

A RECURRENCE RELATION for the sequence {an } is an


equation that expresses the nth term an in terms of one or more
of the previous terms of the sequence
For example, in the sequence 1, 3, 9, 27, 87 . . .,

each term is 3 times the previous term

and so an = 3an−1 , n ≥ 1 with a0 = 1


Consider the Fibonacci sequence 1, 1, 2, 3, 5, 8, 13, . . .,

here each term an is the sum of previous two terms

and so an = an−1 + an−2 , n ≥ 2, with a0 = 1, a1 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Recall the sequence an = n1 :

1 1 1
1, , , , . . .
2 3 4
CAN you construct a Recurrence relation on an ?

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Recall the sequence an = n1 :

1 1 1
1, , , , . . .
2 3 4
CAN you construct a Recurrence relation on an ?
(n−1)an−1
Here, it must be an = n
, n ≥ 2 with a1 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Recall the sequence an = n1 :

1 1 1
1, , , , . . .
2 3 4
CAN you construct a Recurrence relation on an ?
(n−1)an−1
Here, it must be an = n
, n ≥ 2 with a1 = 1
Now, consider a sequence

1, 7, 19, 43, 91, 187, . . .

CAN you construct a Recurrence relation on an ?

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Recall the sequence an = n1 :

1 1 1
1, , , , . . .
2 3 4
CAN you construct a Recurrence relation on an ?
(n−1)an−1
Here, it must be an = n
, n ≥ 2 with a1 = 1
Now, consider a sequence

1, 7, 19, 43, 91, 187, . . .

CAN you construct a Recurrence relation on an ?


Here, it must be an = 2an−1 + 5, n ≥ 1 with a0 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Now, consider a sequence

1, 2, 6, 15, 31, 56, . . .

CAN you construct a Recurrence relation on an ?

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Now, consider a sequence

1, 2, 6, 15, 31, 56, . . .

CAN you construct a Recurrence relation on an ?


Here, it must be an = an−1 + n2 , n ≥ 1 with a0 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations - Examples continued...

Now, consider a sequence

1, 2, 6, 15, 31, 56, . . .

CAN you construct a Recurrence relation on an ?


Here, it must be an = an−1 + n2 , n ≥ 1 with a0 = 1

Thus, a recurrence relation looks like:

an = c1 an−1 + c2 an−2 + . . . + ck an−k + f (n), n ≥ k,

with initial conditions a0 = l0 , a1 = l1 , . . . , ak−1 = lk−1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Inhomogeneous and homogeneous Recurrence Relations

Linear Recurrence Relations with constant coefficients - c0 , c1 , . . .

Inhomogeneous Recurrence relations (kth order) :

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,

with initial conditions a0 = l0 , a1 = l1 , . . . , ak−1 = lk−1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Inhomogeneous and homogeneous Recurrence Relations

Linear Recurrence Relations with constant coefficients - c0 , c1 , . . .

Inhomogeneous Recurrence relations (kth order) :

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,

with initial conditions a0 = l0 , a1 = l1 , . . . , ak−1 = lk−1

Homogeneous Recurrence relations (if f (n) = 0):

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = 0, n ≥ k,

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 1

an − 5an−1 + 4an−2 − an−3 = n2

This is a third order linear recurrence relation with constant


coefficients

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 1

an − 5an−1 + 4an−2 − an−3 = n2

This is a third order linear recurrence relation with constant


coefficients
It is inhomogeneous because of the n2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 1

an − 5an−1 + 4an−2 − an−3 = n2

This is a third order linear recurrence relation with constant


coefficients
It is inhomogeneous because of the n2
Suppose we are given the initial conditions
a1 = 1, a2 = 2, a3 = 3; then we can find sequentially the next
few elements of the sequence:

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 1

an − 5an−1 + 4an−2 − an−3 = n2

This is a third order linear recurrence relation with constant


coefficients
It is inhomogeneous because of the n2
Suppose we are given the initial conditions
a1 = 1, a2 = 2, a3 = 3; then we can find sequentially the next
few elements of the sequence:
a4 = 5(3) − 4(2) + 1 + 32 = 17,

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 1

an − 5an−1 + 4an−2 − an−3 = n2

This is a third order linear recurrence relation with constant


coefficients
It is inhomogeneous because of the n2
Suppose we are given the initial conditions
a1 = 1, a2 = 2, a3 = 3; then we can find sequentially the next
few elements of the sequence:
a4 = 5(3) − 4(2) + 1 + 32 = 17,
a5 = 5(17) − 4(3) + 2 + 42 = 91 and so on.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 2

an − 2an−1 an−2 = n2

This is a second order recurrence relation

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 2

an − 2an−1 an−2 = n2

This is a second order recurrence relation


It is inhomogeneous because of the n2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 2

an − 2an−1 an−2 = n2

This is a second order recurrence relation


It is inhomogeneous because of the n2
But it is NOT LINEAR because of the product an−1 an−2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 2

an − 2an−1 an−2 = n2

This is a second order recurrence relation


It is inhomogeneous because of the n2
But it is NOT LINEAR because of the product an−1 an−2
Suppose we are given the initial conditions a1 = 1, a2 = 2; Still
we can find sequentially the next few elements of the sequence:

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 2

an − 2an−1 an−2 = n2

This is a second order recurrence relation


It is inhomogeneous because of the n2
But it is NOT LINEAR because of the product an−1 an−2
Suppose we are given the initial conditions a1 = 1, a2 = 2; Still
we can find sequentially the next few elements of the sequence:
a3 = 2(2)(1) + 32 = 13,

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 2

an − 2an−1 an−2 = n2

This is a second order recurrence relation


It is inhomogeneous because of the n2
But it is NOT LINEAR because of the product an−1 an−2
Suppose we are given the initial conditions a1 = 1, a2 = 2; Still
we can find sequentially the next few elements of the sequence:
a3 = 2(2)(1) + 32 = 13,
a4 = 2(13)(2) + 42 = 68 and so on.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 3

an − nan−1 − 3an−2 = 0

This is a second order recurrence relation

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 3

an − nan−1 − 3an−2 = 0

This is a second order recurrence relation


It is homogeneous because of the 0 in the RHS

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 3

an − nan−1 − 3an−2 = 0

This is a second order recurrence relation


It is homogeneous because of the 0 in the RHS
It is LINEAR but the coefficient of an−1 is not a constant

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 3

an − nan−1 − 3an−2 = 0

This is a second order recurrence relation


It is homogeneous because of the 0 in the RHS
It is LINEAR but the coefficient of an−1 is not a constant
Suppose we are given the initial conditions a1 = 1, a2 = 2; Still
we can find sequentially the next few elements of the sequence:

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 3

an − nan−1 − 3an−2 = 0

This is a second order recurrence relation


It is homogeneous because of the 0 in the RHS
It is LINEAR but the coefficient of an−1 is not a constant
Suppose we are given the initial conditions a1 = 1, a2 = 2; Still
we can find sequentially the next few elements of the sequence:
a3 = 9,

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 3

an − nan−1 − 3an−2 = 0

This is a second order recurrence relation


It is homogeneous because of the 0 in the RHS
It is LINEAR but the coefficient of an−1 is not a constant
Suppose we are given the initial conditions a1 = 1, a2 = 2; Still
we can find sequentially the next few elements of the sequence:
a3 = 9,
a4 = 42 and so on.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 4

an = an−1 + an−2

This is a second order recurrence relation [FIBONACCI


sequence]

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 4

an = an−1 + an−2

This is a second order recurrence relation [FIBONACCI


sequence]
It is homogeneous

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 4

an = an−1 + an−2

This is a second order recurrence relation [FIBONACCI


sequence]
It is homogeneous
But it is LINEAR with constant coefficients

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 4

an = an−1 + an−2

This is a second order recurrence relation [FIBONACCI


sequence]
It is homogeneous
But it is LINEAR with constant coefficients
Suppose we are given the initial conditions a1 = 1, a2 = 2; we
can find sequentially the next few elements of the sequence:

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 4

an = an−1 + an−2

This is a second order recurrence relation [FIBONACCI


sequence]
It is homogeneous
But it is LINEAR with constant coefficients
Suppose we are given the initial conditions a1 = 1, a2 = 2; we
can find sequentially the next few elements of the sequence:
a3 = 3,

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

RR Example - 4

an = an−1 + an−2

This is a second order recurrence relation [FIBONACCI


sequence]
It is homogeneous
But it is LINEAR with constant coefficients
Suppose we are given the initial conditions a1 = 1, a2 = 2; we
can find sequentially the next few elements of the sequence:
a3 = 3,
a4 = 5 and so on.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Towers of Hanoi Problem

Towers of Hanoi
There are 3 pegs: X, Y, Z and n circular disks of increasing diameter
on one peg X, with the largest disk on the bottom.
These disks are to be transferred onto peg Z using Y as an auxiliary or
intermediary peg such that

Determine the number of moves needed.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Towers of Hanoi Problem

Towers of Hanoi
There are 3 pegs: X, Y, Z and n circular disks of increasing diameter
on one peg X, with the largest disk on the bottom.
These disks are to be transferred onto peg Z using Y as an auxiliary or
intermediary peg such that
only one disk can be moved at a time

Determine the number of moves needed.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Towers of Hanoi Problem

Towers of Hanoi
There are 3 pegs: X, Y, Z and n circular disks of increasing diameter
on one peg X, with the largest disk on the bottom.
These disks are to be transferred onto peg Z using Y as an auxiliary or
intermediary peg such that
only one disk can be moved at a time
no disk can be placed on the top of a smaller disk
Determine the number of moves needed.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1
Assume n ≥ 2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1
Assume n ≥ 2
Consider top n − 1 disks on peg X and move to peg Y using Z

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1
Assume n ≥ 2
Consider top n − 1 disks on peg X and move to peg Y using Z
It takes an−1 moves to transfer the top n − 1 disks to Y using Z

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1
Assume n ≥ 2
Consider top n − 1 disks on peg X and move to peg Y using Z
It takes an−1 moves to transfer the top n − 1 disks to Y using Z
Now, only the largest disk is left in peg X; move it to Z; so 1
move

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1
Assume n ≥ 2
Consider top n − 1 disks on peg X and move to peg Y using Z
It takes an−1 moves to transfer the top n − 1 disks to Y using Z
Now, only the largest disk is left in peg X; move it to Z; so 1
move
Now, transfer the n − 1 disks in Y to Z using X in an−1 moves.
JOB DONE!

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - Towers of Hanoi Problem

Solution
Let an denote the number of moves needed to move from peg X
to peg Z using peg Y
Clearly, a1 = 1
Assume n ≥ 2
Consider top n − 1 disks on peg X and move to peg Y using Z
It takes an−1 moves to transfer the top n − 1 disks to Y using Z
Now, only the largest disk is left in peg X; move it to Z; so 1
move
Now, transfer the n − 1 disks in Y to Z using X in an−1 moves.
JOB DONE!
Total number of moves is
an = an−1 + 1 + an−1 = 2an−1 + 1, n ≥ 2 with a1 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

A Computer Science counting problem


CS counting problem
Suppose that in a given prog. language, we wish to count the no. of
valid expressions that are formed using only the ten digits 0, 1, . . . , 9
and the four arithmetic operations +, −, ÷, ×. Conditions are

For example,

How many such valid expressions of length n are there in this


language?
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

A Computer Science counting problem


CS counting problem
Suppose that in a given prog. language, we wish to count the no. of
valid expressions that are formed using only the ten digits 0, 1, . . . , 9
and the four arithmetic operations +, −, ÷, ×. Conditions are
each valid expression ends in a digit

For example,

How many such valid expressions of length n are there in this


language?
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

A Computer Science counting problem


CS counting problem
Suppose that in a given prog. language, we wish to count the no. of
valid expressions that are formed using only the ten digits 0, 1, . . . , 9
and the four arithmetic operations +, −, ÷, ×. Conditions are
each valid expression ends in a digit
2 valid expressions can be combined by using the 4 arithmetic
operations

For example,

How many such valid expressions of length n are there in this


language?
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

A Computer Science counting problem


CS counting problem
Suppose that in a given prog. language, we wish to count the no. of
valid expressions that are formed using only the ten digits 0, 1, . . . , 9
and the four arithmetic operations +, −, ÷, ×. Conditions are
each valid expression ends in a digit
2 valid expressions can be combined by using the 4 arithmetic
operations
arithmetic operations should not occur consecutively or in
succession
For example,

How many such valid expressions of length n are there in this


language?
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

A Computer Science counting problem


CS counting problem
Suppose that in a given prog. language, we wish to count the no. of
valid expressions that are formed using only the ten digits 0, 1, . . . , 9
and the four arithmetic operations +, −, ÷, ×. Conditions are
each valid expression ends in a digit
2 valid expressions can be combined by using the 4 arithmetic
operations
arithmetic operations should not occur consecutively or in
succession
For example,
1 + 2, 5 × 980, 3 + 5 ÷ 0 − 3429 × 3 are all valid

How many such valid expressions of length n are there in this


language?
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

A Computer Science counting problem


CS counting problem
Suppose that in a given prog. language, we wish to count the no. of
valid expressions that are formed using only the ten digits 0, 1, . . . , 9
and the four arithmetic operations +, −, ÷, ×. Conditions are
each valid expression ends in a digit
2 valid expressions can be combined by using the 4 arithmetic
operations
arithmetic operations should not occur consecutively or in
succession
For example,
1 + 2, 5 × 980, 3 + 5 ÷ 0 − 3429 × 3 are all valid
but 3 + −68, 980 − ÷ × 30, 3 + 56− are not valid;
How many such valid expressions of length n are there in this
language?
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - CS Counting Problem

Solution

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - CS Counting Problem

Solution
Let an denote the number of valid expressions of length n.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution - CS Counting Problem

Solution
Let an denote the number of valid expressions of length n.
Then

an = 10an−1 + 40an−2 , n ≥ 2, a0 = 0; a1 = 10

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Recurrence Relations

Finding a formula for the nth term of the sequence generated by


a recurrence relation is called solving the recurrence relation

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Recurrence Relations

Finding a formula for the nth term of the sequence generated by


a recurrence relation is called solving the recurrence relation
Such a formula is called an explicit (or closed-form) formula

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Recurrence Relations

Finding a formula for the nth term of the sequence generated by


a recurrence relation is called solving the recurrence relation
Such a formula is called an explicit (or closed-form) formula
One technique for finding an explicit formula for the sequence
defined by a recurrence relation is backtracking (or
substitution)

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving RRs by backtracking (or substitution)

Solve an = an−1 + 3, n ≥ 2 with initial condition a1 = 2

an = an−1 + 3
= [an−2 + 3] + 3 = an−2 + 2(3)
= [an−3 + 3] + 2(3) = an−3 + 3(3)
.
= ..
= an−(n−1) + (n − 1)(3) = a1 + (n − 1)(3)
= 2 + (n − 1)3 = 3n − 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Major Methods of solving Recurrence Relations

Two important methods of solving recurrence relations are:

1 Method of generating functions

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Major Methods of solving Recurrence Relations

Two important methods of solving recurrence relations are:

1 Method of generating functions

2 Method of characteristic roots and undetermined coefficients

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function of sequences - Definition

The generating function G(x) of a sequence a0 , a1 , a2 , a3 , . . . is


the power series

X
G(x) = a0 + a1 x + a2 x2 + a3 x3 + . . . = an xn
n=0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function of sequences - Definition

The generating function G(x) of a sequence a0 , a1 , a2 , a3 , . . . is


the power series

X
G(x) = a0 + a1 x + a2 x2 + a3 x3 + . . . = an xn
n=0

Thus, an = coefficient of xn in G(x)

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function of sequences - Definition

The generating function G(x) of a sequence a0 , a1 , a2 , a3 , . . . is


the power series

X
G(x) = a0 + a1 x + a2 x2 + a3 x3 + . . . = an xn
n=0

Thus, an = coefficient of xn in G(x)


Although, G(x) is called the generating function, it is not a
function in the usual sense (since we do not specify the domain
and codomain)

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function of sequences - Definition

The generating function G(x) of a sequence a0 , a1 , a2 , a3 , . . . is


the power series

X
G(x) = a0 + a1 x + a2 x2 + a3 x3 + . . . = an xn
n=0

Thus, an = coefficient of xn in G(x)


Although, G(x) is called the generating function, it is not a
function in the usual sense (since we do not specify the domain
and codomain)
It is simply an algebraic device which is amenable to algebraic
manipulation.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function of sequences - Definition

The generating function G(x) of a sequence a0 , a1 , a2 , a3 , . . . is


the power series

X
G(x) = a0 + a1 x + a2 x2 + a3 x3 + . . . = an xn
n=0

Thus, an = coefficient of xn in G(x)


Although, G(x) is called the generating function, it is not a
function in the usual sense (since we do not specify the domain
and codomain)
It is simply an algebraic device which is amenable to algebraic
manipulation.
We use it to solve Recurrence Relations

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 1

Find the generating function G(x) of 30 , 31 , 32 , . . .

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 1

Find the generating function G(x) of 30 , 31 , 32 , . . .

G(x) = 30 + 31 x + 32 x2 + 33 x3 + . . .
= 1 + 3x + (3x)2 + (3x)3 . . .
= (1 − 3x)−1
1
=
1 − 3x

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 2

Find the generating function G(x) of 1, 2, 3, 4, . . .

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 2

Find the generating function G(x) of 1, 2, 3, 4, . . .

G(x) = 1 + 2x + 3x2 + 4x3 + . . .


= (1 − x)−2
1
=
(1 − x)2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 3a

Find the generating function of G(x) of the recurrence relation


an = 2an−1 , n ≥ 1 with a0 = 5

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 3a

Find the generating function of G(x) of the recurrence relation


an = 2an−1 , n ≥ 1 with a0 = 5

G(x) = a0 + a1 x + a2 x2 + a3 x3 + . . .
= a0 + 2a0 x + 22 a0 x2 + 23 a0 x3 + . . .
= a0 (1 + 2x + (2x)2 + (2x)3 . . .)
1
= a0
1 − 2x
5
=
1 − 2x

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 3b

Find the generating function of G(x) of the recurrence relation


an = 2an−1 , n ≥ 1 with a0 = 5

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 3b

Find the generating function of G(x) of the recurrence relation


an = 2an−1 , n ≥ 1 with a0 = 5
Multiply both sides by xn andPsum it from n = 1 to ∞ as n must
be ≥ 1 (Recall that G(x) = ∞ n
n=0 an x )

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 3b

Find the generating function of G(x) of the recurrence relation


an = 2an−1 , n ≥ 1 with a0 = 5
Multiply both sides by xn andPsum it from n = 1 to ∞ as n must
be ≥ 1 (Recall that G(x) = ∞ n
n=0 an x )


X ∞
X
n
an x = 2an−1 xn (put m = n − 1)
n=1 n=1

X ∞
X
m+1
G(x) − a0 = 2 am x = 2x am xm = 2xG(x)
m=0 m=0
G(x) − 2xG(x) = a0
5
G(x) =
1 − 2x

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 4 - of Fibonacci Sequence


Find the generating function of G(x) of the Fibonacci recurrence
relation fn − fn−1 − fn−2 = 0, n ≥ 2 with f0 = 1, f1 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 4 - of Fibonacci Sequence


Find the generating function of G(x) of the Fibonacci recurrence
relation fn − fn−1 −P fn−2 = 0, n ≥ 2 with f0 = 1, f1 = 1
Recall that G(x) = ∞ n=0 fn x
n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 4 - of Fibonacci Sequence


Find the generating function of G(x) of the Fibonacci recurrence
relation fn − fn−1 −P fn−2 = 0, n ≥ 2 with f0 = 1, f1 = 1
Recall that G(x) = ∞ n=0 fn x
n


X ∞
X ∞
X
fn x n − fn−1 xn − fn−2 xn = 0
n=2 n=2 n=2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 4 - of Fibonacci Sequence


Find the generating function of G(x) of the Fibonacci recurrence
relation fn − fn−1 −P fn−2 = 0, n ≥ 2 with f0 = 1, f1 = 1
Recall that G(x) = ∞ n=0 fn x
n


X ∞
X ∞
X
fn x n − fn−1 xn − fn−2 xn = 0
n=2 n=2 n=2


X ∞
X ∞
X
( fn xn − f0 − f1 x) − x fn−1 xn−1 − x2 fn−2 xn−2 = 0
n=0 n=2 n=2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 4 - of Fibonacci Sequence


Find the generating function of G(x) of the Fibonacci recurrence
relation fn − fn−1 −P fn−2 = 0, n ≥ 2 with f0 = 1, f1 = 1
Recall that G(x) = ∞ n=0 fn x
n


X ∞
X ∞
X
fn x n − fn−1 xn − fn−2 xn = 0
n=2 n=2 n=2


X ∞
X ∞
X
( fn xn − f0 − f1 x) − x fn−1 xn−1 − x2 fn−2 xn−2 = 0
n=0 n=2 n=2

G(x) − 1 − x − x(G(x) − f0 ) − x2 G(x) = 0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Generating Function - example 4 - of Fibonacci Sequence


Find the generating function of G(x) of the Fibonacci recurrence
relation fn − fn−1 −P fn−2 = 0, n ≥ 2 with f0 = 1, f1 = 1
Recall that G(x) = ∞ n=0 fn x
n


X ∞
X ∞
X
fn x n − fn−1 xn − fn−2 xn = 0
n=2 n=2 n=2


X ∞
X ∞
X
( fn xn − f0 − f1 x) − x fn−1 xn−1 − x2 fn−2 xn−2 = 0
n=0 n=2 n=2

G(x) − 1 − x − x(G(x) − f0 ) − x2 G(x) = 0

1
G(x) =
1 − x − x2
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving an RR by Generating Functions


1. Solve the RR an+2 − an+1 − 6an = 0, given that a0 = 2, a1 = 1
Recall that G(x) = ∞ n
P
n=0 an x

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving an RR by Generating Functions


1. Solve the RR an+2 − an+1 − 6an = 0, given that a0 = 2, a1 = 1
Recall that G(x) = ∞ n
P
n=0 an x


X ∞
X ∞
X
n n
an+2 x − an+1 x − 6 an xn = 0
n=0 n=0 n=0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving an RR by Generating Functions


1. Solve the RR an+2 − an+1 − 6an = 0, given that a0 = 2, a1 = 1
Recall that G(x) = ∞ n
P
n=0 an x


X ∞
X ∞
X
n n
an+2 x − an+1 x − 6 an xn = 0
n=0 n=0 n=0

∞ ∞
1 X n+2 1X
an+2 x − an+1 xn+1 − 6G(x) = 0
x2 n=0
x n=0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving an RR by Generating Functions


1. Solve the RR an+2 − an+1 − 6an = 0, given that a0 = 2, a1 = 1
Recall that G(x) = ∞ n
P
n=0 an x


X ∞
X ∞
X
n n
an+2 x − an+1 x − 6 an xn = 0
n=0 n=0 n=0

∞ ∞
1 X n+2 1X
an+2 x − an+1 xn+1 − 6G(x) = 0
x2 n=0
x n=0

1 1
(G(x) − a0 − a1 x) − (G(x) − a0 ) − 6G(x) = 0
x2 x

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving an RR by Generating Functions


1. Solve the RR an+2 − an+1 − 6an = 0, given that a0 = 2, a1 = 1
Recall that G(x) = ∞ n
P
n=0 an x


X ∞
X ∞
X
n n
an+2 x − an+1 x − 6 an xn = 0
n=0 n=0 n=0

∞ ∞
1 X n+2 1X
an+2 x − an+1 xn+1 − 6G(x) = 0
x2 n=0
x n=0

1 1
(G(x) − a0 − a1 x) − (G(x) − a0 ) − 6G(x) = 0
x2 x
2−x
G(x) =
1 − x − 6x2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution continued...

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

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution continued...

2−x 2−x
G(x) = =
1−x− 6x2 (1 − 3x)(1 + 2x)
Split G(x) into partial fractions

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution continued...

2−x 2−x
G(x) = =
1−x− 6x2 (1 − 3x)(1 + 2x)
Split G(x) into partial fractions

1 1
G(x) = +
1 − 3x 1 + 2x
= (1 − 3x) + (1 + 2x)−1
−1

= [1 + 3x + (3x)2 + . . .] + [1 − (2x) + (2x)2 − . . .]

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution continued...

2−x 2−x
G(x) = =
1−x− 6x2 (1 − 3x)(1 + 2x)
Split G(x) into partial fractions

1 1
G(x) = +
1 − 3x 1 + 2x
= (1 − 3x) + (1 + 2x)−1
−1

= [1 + 3x + (3x)2 + . . .] + [1 − (2x) + (2x)2 − . . .]

P∞
Recall that G(x) = n=0 an xn

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solution continued...

2−x 2−x
G(x) = =
1−x− 6x2 (1 − 3x)(1 + 2x)
Split G(x) into partial fractions

1 1
G(x) = +
1 − 3x 1 + 2x
= (1 − 3x) + (1 + 2x)−1
−1

= [1 + 3x + (3x)2 + . . .] + [1 − (2x) + (2x)2 − . . .]

P∞
Recall that G(x) = n=0 an xn
Therefore, an = Coefficient of xn in G(x) = 3n + (−1)n 2n
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions −1 3
You will get G(x) = 1−x
2
+ 2
1−3x

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions −1 3
You will get G(x) = 1−x
2
+ 2
1−3x
1
SOLUTION should be an = 2
(3n+1 − 1)

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions −1 3
You will get G(x) = 1−x
2
+ 2
1−3x
1
SOLUTION should be an = 2
(3n+1 − 1)

2 Solve an = 4an−1 − 4an−2 + 4n , n ≥ 2, with a0 = 2,


a1 = 8

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions −1 3
You will get G(x) = 1−x
2
+ 2
1−3x
1
SOLUTION should be an = 2
(3n+1 − 1)

2 Solve an = 4an−1 − 4an−2 + 4n , n ≥ 2, with a0 = 2,


a1 = 8
1+(1−4x)2
You should get G(x) = (1−2x)2 (1−4x)
; Then split into partial
fractions

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions −1 3
You will get G(x) = 1−x
2
+ 2
1−3x
1
SOLUTION should be an = 2
(3n+1 − 1)

2 Solve an = 4an−1 − 4an−2 + 4n , n ≥ 2, with a0 = 2,


a1 = 8
2
1+(1−4x)
You should get G(x) = (1−2x) 2 (1−4x) ; Then split into partial
fractions
4 2
You will get G(x) = 1−4x − (1−2x) 2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solve the following RRs by method of Generating


Functions

1 Solve an = 3an−1 + 1, n ≥ 1, with a0 = 1


1
You should get G(x) = (1−x)(1−3x)
; Then split into partial
fractions −1 3
You will get G(x) = 1−x
2
+ 2
1−3x
1
SOLUTION should be an = 2
(3n+1 − 1)

2 Solve an = 4an−1 − 4an−2 + 4n , n ≥ 2, with a0 = 2,


a1 = 8
2
1+(1−4x)
You should get G(x) = (1−2x) 2 (1−4x) ; Then split into partial
fractions
4 2
You will get G(x) = 1−4x − (1−2x) 2

SOLUTION should be an = 4n+1 − (n + 2)2n+1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Method of Characteristic Roots


RECALL:
Inhomogeneous Recurrence relations (kth order) :
c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,
with initial conditions a0 = l0 , a1 = l1 , . . . , ak−1 = lk−1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Method of Characteristic Roots


RECALL:
Inhomogeneous Recurrence relations (kth order) :
c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,
with initial conditions a0 = l0 , a1 = l1 , . . . , ak−1 = lk−1

Homogeneous Recurrence relations (if f (n) = 0):


c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = 0, n ≥ k,

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Method of Characteristic Roots


RECALL:
Inhomogeneous Recurrence relations (kth order) :
c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,
with initial conditions a0 = l0 , a1 = l1 , . . . , ak−1 = lk−1

Homogeneous Recurrence relations (if f (n) = 0):


c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = 0, n ≥ k,

Theorem
General solution is given by an = SH + PSINH
where SH = general solution of Homogeneous LRR
and PSINH = a particular solution of INhomogeneousLRR.
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

SH : How to solve the kth order Homogeneous LRRs?

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = 0, n ≥ k,

Characteristic Equation
The Characteristic Equation of the above LRR is given by

c0 αk + c1 αk−1 + c2 αk−2 + . . . + ck = 0

Let the characteristic roots be α1 , α2 , . . . , αk

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

SH : How to solve the kth order Homogeneous LRRs?


CASE: 1 - Distinct Roots
If α1 , α2 , . . . , αk are distinct real roots, then the solution is

SH = A1 αn1 + A2 αn2 + A3 αn3 + . . . + Ak αnk

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

SH : How to solve the kth order Homogeneous LRRs?


CASE: 1 - Distinct Roots
If α1 , α2 , . . . , αk are distinct real roots, then the solution is

SH = A1 αn1 + A2 αn2 + A3 αn3 + . . . + Ak αnk

CASE: 2 - Repeated Roots


If a root say α1 repeats with multiplicity m, then the solution is

SH = (A1 nm−1 +A2 nm−2 +. . .+Am )αn1 +Am+1 αnm+1 +. . .+Ak αnk

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

SH : How to solve the kth order Homogeneous LRRs?


CASE: 1 - Distinct Roots
If α1 , α2 , . . . , αk are distinct real roots, then the solution is

SH = A1 αn1 + A2 αn2 + A3 αn3 + . . . + Ak αnk

CASE: 2 - Repeated Roots


If a root say α1 repeats with multiplicity m, then the solution is

SH = (A1 nm−1 +A2 nm−2 +. . .+Am )αn1 +Am+1 αnm+1 +. . .+Ak αnk

CASE: 3 - Complex Roots


If α1 , α2 are complex roots and α1 = reiθ , α2 = re−iθ , then the
solution is

SH = rn (A1 cos nθ + A2 sin nθ) + A3 αn3 + . . . + Ak αnk


Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Char. Eqn. is α2 − 10α + 9 = 0; Solve and get the 2 roots

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Char. Eqn. is α2 − 10α + 9 = 0; Solve and get the 2 roots


The two roots are α1 = 1 and α2 = 9

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Char. Eqn. is α2 − 10α + 9 = 0; Solve and get the 2 roots


The two roots are α1 = 1 and α2 = 9
General Solution should be
an = A1 (1)n + A2 (9)n = A1 + A2 9n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Char. Eqn. is α2 − 10α + 9 = 0; Solve and get the 2 roots


The two roots are α1 = 1 and α2 = 9
General Solution should be
an = A1 (1)n + A2 (9)n = A1 + A2 9n
Now, use the initial conditions to find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Char. Eqn. is α2 − 10α + 9 = 0; Solve and get the 2 roots


The two roots are α1 = 1 and α2 = 9
General Solution should be
an = A1 (1)n + A2 (9)n = A1 + A2 9n
Now, use the initial conditions to find A1 and A2
You will get A1 = 2 and A2 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving Homog. LRRs by Characteristic Roots method

1 Solve an − 10an−1 + 9an−2 = 0, with a0 = 3, a1 = 11

Char. Eqn. is α2 − 10α + 9 = 0; Solve and get the 2 roots


The two roots are α1 = 1 and α2 = 9
General Solution should be
an = A1 (1)n + A2 (9)n = A1 + A2 9n
Now, use the initial conditions to find A1 and A2
You will get A1 = 2 and A2 = 1
Hence, the solution is
an = 2 + 9n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Char. Eqn. is α2 − α − 1 = 0; Solve and get the 2 roots

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Char. Eqn. is α2 − α − 1 = 0; Solve and get the 2 roots



1± 5
The two roots are α = 2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Char. Eqn. is α2 − α − 1 = 0; Solve and get the 2 roots



1± 5
The two roots are α = 2
General Solution should be √ √
an = A1 ( 1+2 5 )n + A2 ( 1−2 5 )n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Char. Eqn. is α2 − α − 1 = 0; Solve and get the 2 roots



1± 5
The two roots are α = 2
General Solution should be √ √
an = A1 ( 1+2 5 )n + A2 ( 1−2 5 )n
Now, use the initial conditions to find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Char. Eqn. is α2 − α − 1 = 0; Solve and get the 2 roots



1± 5
The two roots are α = 2
General Solution should be √ √
an = A1 ( 1+2 5 )n + A2 ( 1−2 5 )n
Now, use the initial conditions to find A1 and A2
√ √
1+√ 5
You will get A1 = 2 5
and A2 = − 1−√ 5
2 5

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Find the nth term of the Fibonacci Sequence

2. Solve an − an−1 − an−2 = 0, with a0 = 1, a1 = 1

Char. Eqn. is α2 − α − 1 = 0; Solve and get the 2 roots



1± 5
The two roots are α = 2
General Solution should be √ √
an = A1 ( 1+2 5 )n + A2 ( 1−2 5 )n
Now, use the initial conditions to find A1 and A2
√ √
1+√ 5
You will get A1 = 2 5
and A2 = − 1−√ 5
2 5

Hence, the solution is


√ √
an = √1
5
[( 1+2 5 n+1
) − ( 1−2 5 n+1
) ]

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve 4an − 20an−1 + 17an−2 − 4an−3 = 0.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve 4an − 20an−1 + 17an−2 − 4an−3 = 0.

Char. Eqn. is 4α3 − 20α2 + 17α − 4 = 0; Solve and get the


3 roots

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve 4an − 20an−1 + 17an−2 − 4an−3 = 0.

Char. Eqn. is 4α3 − 20α2 + 17α − 4 = 0; Solve and get the


3 roots
The three roots are α1 = 12 , α2 = 1
2
and α3 = 4

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve 4an − 20an−1 + 17an−2 − 4an−3 = 0.

Char. Eqn. is 4α3 − 20α2 + 17α − 4 = 0; Solve and get the


3 roots
The three roots are α1 = 12 , α2 = 1
2
and α3 = 4
General Solution should be
an = (A1 n + A2 )( 21 )n + A3 (4)n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an + 6an−1 + 12an−2 + 8an−3 = 0.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an + 6an−1 + 12an−2 + 8an−3 = 0.

Char. Eqn. is α3 + 6α2 + 12α + 8 = 0; Solve and get the 3


roots

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an + 6an−1 + 12an−2 + 8an−3 = 0.

Char. Eqn. is α3 + 6α2 + 12α + 8 = 0; Solve and get the 3


roots
The three roots are α1 = −2, α2 = −2 and α3 = −2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an + 6an−1 + 12an−2 + 8an−3 = 0.

Char. Eqn. is α3 + 6α2 + 12α + 8 = 0; Solve and get the 3


roots
The three roots are α1 = −2, α2 = −2 and α3 = −2
General Solution should be
an = (A1 n2 + A2 n + A3 )(−2)n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Char. Eqn. is α2 − 2α + 2 = 0; Solve and get the 2 roots

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Char. Eqn. is α2 − 2α + 2 = 0; Solve and get the 2 roots


1 ± i;
The two roots are √ √
π π
α1 = 1 + i = 2ei 4 , α2 = 1 − i = 2e−i 4

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Char. Eqn. is α2 − 2α + 2 = 0; Solve and get the 2 roots


1 ± i;
The two roots are √ √
π π
α1 = 1 + i = 2ei 4 , α2 = 1 − i = 2e−i 4
General Solution should be

an = ( 2)n (A cos n π4 + B sin n π4 )

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Char. Eqn. is α2 − 2α + 2 = 0; Solve and get the 2 roots


1 ± i;
The two roots are √ √
π π
α1 = 1 + i = 2ei 4 , α2 = 1 − i = 2e−i 4
General Solution should be

an = ( 2)n (A cos n π4 + B sin n π4 )
Now, use the initial conditions to find A and B

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Char. Eqn. is α2 − 2α + 2 = 0; Solve and get the 2 roots


1 ± i;
The two roots are √ √
π π
α1 = 1 + i = 2ei 4 , α2 = 1 − i = 2e−i 4
General Solution should be

an = ( 2)n (A cos n π4 + B sin n π4 )
Now, use the initial conditions to find A and B
You will get A = 1 and B = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

5. Solve an = 2(an−1 − an−2 ) with a0 = 1, a1 = 2.

Char. Eqn. is α2 − 2α + 2 = 0; Solve and get the 2 roots


1 ± i;
The two roots are √ √
π π
α1 = 1 + i = 2ei 4 , α2 = 1 − i = 2e−i 4
General Solution should be

an = ( 2)n (A cos n π4 + B sin n π4 )
Now, use the initial conditions to find A and B
You will get A = 1 and B = 1
Hence, the solution is

an = ( 2)n (cos n π4 + sin n π4 )

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

PSINH : How to solve the kth order IN-Homogeneous LRRs?

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,

ASSUMED Particular Solution - (APS)


The particular solution of the INhomogeneous LRR will RESEMBLE
(or look like) f (n) - Depending upon characteristic roots!!.
99K This is theoretically proved (can also be observed by
monitoring G(x) closely)!

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

PSINH : How to solve the kth order IN-Homogeneous LRRs?

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,

ASSUMED Particular Solution - (APS)


The particular solution of the INhomogeneous LRR will RESEMBLE
(or look like) f (n) - Depending upon characteristic roots!!.
99K This is theoretically proved (can also be observed by
monitoring G(x) closely)!

Thus, to get the Particular Solution, we will first assume


"some function of n that is similar to f (n)" as ASSUMED
PARTICULAR SOLUTION(APS);

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

PSINH : How to solve the kth order IN-Homogeneous LRRs?

c0 an + c1 an−1 + c2 an−2 + . . . + ck an−k = f (n), n ≥ k,

ASSUMED Particular Solution - (APS)


The particular solution of the INhomogeneous LRR will RESEMBLE
(or look like) f (n) - Depending upon characteristic roots!!.
99K This is theoretically proved (can also be observed by
monitoring G(x) closely)!

Thus, to get the Particular Solution, we will first assume


"some function of n that is similar to f (n)" as ASSUMED
PARTICULAR SOLUTION(APS);
We will denote it as an itself and substitute in the given
INhomog. LRR to get the values of arbitrary constants in APS
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is NOT a char. root)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is NOT a


Characteristic Root
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is NOT a char. root,
then APS an = P0 + P1 n + P2 n2 . . . + Ps ns

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is NOT a char. root)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is NOT a


Characteristic Root
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is NOT a char. root,
then APS an = P0 + P1 n + P2 n2 . . . + Ps ns

Examples: Suppose that 1 is NOT a Characteristic Root

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is NOT a char. root)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is NOT a


Characteristic Root
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is NOT a char. root,
then APS an = P0 + P1 n + P2 n2 . . . + Ps ns

Examples: Suppose that 1 is NOT a Characteristic Root


If f (n) = 10, then APS an = P0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is NOT a char. root)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is NOT a


Characteristic Root
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is NOT a char. root,
then APS an = P0 + P1 n + P2 n2 . . . + Ps ns

Examples: Suppose that 1 is NOT a Characteristic Root


If f (n) = 10, then APS an = P0
If f (n) = 3n, then APS an = P0 + P1 n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is NOT a char. root)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is NOT a


Characteristic Root
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is NOT a char. root,
then APS an = P0 + P1 n + P2 n2 . . . + Ps ns

Examples: Suppose that 1 is NOT a Characteristic Root


If f (n) = 10, then APS an = P0
If f (n) = 3n, then APS an = P0 + P1 n
If f (n) = 5n3 − 23, then APS an = P0 + P1 n + P2 n2 + P3 n3

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is a char. root of multiplicity


m)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is a


Characteristic Root of multiplicity m
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is a char. root of multiplicity


m)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is a


Characteristic Root of multiplicity m
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )nm

Examples: Suppose that 1 is a Characteristic Root of multiplicity m

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is a char. root of multiplicity


m)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is a


Characteristic Root of multiplicity m
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )nm

Examples: Suppose that 1 is a Characteristic Root of multiplicity m


If f (n) = 10, then APS an = P0 nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is a char. root of multiplicity


m)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is a


Characteristic Root of multiplicity m
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )nm

Examples: Suppose that 1 is a Characteristic Root of multiplicity m


If f (n) = 10, then APS an = P0 nm
If f (n) = 3n, then APS an = (P0 + P1 n)nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if 1 is a char. root of multiplicity


m)

If f (n) is a POLYNOMIAL of degree s in n AND if 1 is a


Characteristic Root of multiplicity m
If f (n) = b0 + b1 n + b2 n2 . . . + bs ns and if 1 is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )nm

Examples: Suppose that 1 is a Characteristic Root of multiplicity m


If f (n) = 10, then APS an = P0 nm
If f (n) = 3n, then APS an = (P0 + P1 n)nm
If f (n) = 5n3 − 23, then APS
an = (P0 + P1 n + P2 n2 + P3 n3 )nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is NOT a char. root)

If f (n) = (a Polynomial) times cn AND if c is NOT a Characteristic


Root
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is NOT a char.
root, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is NOT a char. root)

If f (n) = (a Polynomial) times cn AND if c is NOT a Characteristic


Root
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is NOT a char.
root, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn

Examples: Suppose that c is NOT a Characteristic Root

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is NOT a char. root)

If f (n) = (a Polynomial) times cn AND if c is NOT a Characteristic


Root
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is NOT a char.
root, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn

Examples: Suppose that c is NOT a Characteristic Root


If f (n) = 2n , then APS an = P0 2n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is NOT a char. root)

If f (n) = (a Polynomial) times cn AND if c is NOT a Characteristic


Root
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is NOT a char.
root, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn

Examples: Suppose that c is NOT a Characteristic Root


If f (n) = 2n , then APS an = P0 2n
If f (n) = 3n5n , then APS an = (P0 + P1 n)5n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is NOT a char. root)

If f (n) = (a Polynomial) times cn AND if c is NOT a Characteristic


Root
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is NOT a char.
root, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn

Examples: Suppose that c is NOT a Characteristic Root


If f (n) = 2n , then APS an = P0 2n
If f (n) = 3n5n , then APS an = (P0 + P1 n)5n
If f (n) = (5n3 − 23)(−2)n , then APS
an = (P0 + P1 n + P2 n2 + P3 n3 )(−2)n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is a char. root of multiplicity


m)

If f (n) = (a Polynomial) times cn AND if c is a Characteristic Root


of multiplicity m
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is a char. root of multiplicity


m)

If f (n) = (a Polynomial) times cn AND if c is a Characteristic Root


of multiplicity m
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn nm

Examples: Suppose that c is a Characteristic Root of multiplicity m

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is a char. root of multiplicity


m)

If f (n) = (a Polynomial) times cn AND if c is a Characteristic Root


of multiplicity m
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn nm

Examples: Suppose that c is a Characteristic Root of multiplicity m


If f (n) = 2n , then APS an = P0 2n nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is a char. root of multiplicity


m)

If f (n) = (a Polynomial) times cn AND if c is a Characteristic Root


of multiplicity m
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn nm

Examples: Suppose that c is a Characteristic Root of multiplicity m


If f (n) = 2n , then APS an = P0 2n nm
If f (n) = 3n5n , then APS an = (P0 + P1 n)5n nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

APS: How to have APS? (if c is a char. root of multiplicity


m)

If f (n) = (a Polynomial) times cn AND if c is a Characteristic Root


of multiplicity m
If f (n) = (b0 + b1 n + b2 n2 . . . + bs ns )cn and if c is a char. root of
multiplicity m, then APS an = (P0 + P1 n + P2 n2 . . . + Ps ns )cn nm

Examples: Suppose that c is a Characteristic Root of multiplicity m


If f (n) = 2n , then APS an = P0 2n nm
If f (n) = 3n5n , then APS an = (P0 + P1 n)5n nm
If f (n) = (5n3 − 23)(−2)n , then APS
an = (P0 + P1 n + P2 n2 + P3 n3 )(−2)n nm

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0
Substitute this APS in the given INhomog. LRR; Get Pi ’s;

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P1 = 2 and P0 = 8

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P1 = 2 and P0 = 8
Hence, the general solution is
an = A1 (2)n + A2 (5)n + 2n + 8

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P1 = 2 and P0 = 8
Hence, the general solution is
an = A1 (2)n + A2 (5)n + 2n + 8
NOW, use the initial conditions to find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P1 = 2 and P0 = 8
Hence, the general solution is
an = A1 (2)n + A2 (5)n + 2n + 8
NOW, use the initial conditions to find A1 and A2
A1 = −9, A2 = 2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Solving InHomog. LRRs by Characteristic Roots method


1 Solve an − 7an−1 + 10an−2 = 6 + 8n, with a0 = 1, a1 = 2

Char. Eqn. is α2 − 7α + 10 = 0; Solve and get the 2 roots:


2&5
General Homog. Solution SH = A1 (2)n + A2 (5)n
Let APS an = P1 n + P0
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P1 = 2 and P0 = 8
Hence, the general solution is
an = A1 (2)n + A2 (5)n + 2n + 8
NOW, use the initial conditions to find A1 and A2
A1 = −9, A2 = 2
Hence, THE solution is
an = −9(2)n + 2(5)n + 2n + 8
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2
General Homog. Solution SH = (A1 n + A2 )2n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2
General Homog. Solution SH = (A1 n + A2 )2n
Let APS an = (P1 n + P0 )n2 2n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2
General Homog. Solution SH = (A1 n + A2 )2n
Let APS an = (P1 n + P0 )n2 2n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2
General Homog. Solution SH = (A1 n + A2 )2n
Let APS an = (P1 n + P0 )n2 2n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
1
You will get P1 = 6
and P0 = 1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2
General Homog. Solution SH = (A1 n + A2 )2n
Let APS an = (P1 n + P0 )n2 2n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
1
You will get P1 = 6
and P0 = 1
Hence, the general solution is
an = (A1 n + A2 )2n + n2 ( n6 + 1)2n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

2. Solve an − 4an−1 + 4an−2 = (n + 1)2n

Char. Eqn. is α2 − 4α + 4 = 0; Solve and get the 2 roots:


2&2
General Homog. Solution SH = (A1 n + A2 )2n
Let APS an = (P1 n + P0 )n2 2n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
1
You will get P1 = 6
and P0 = 1
Hence, the general solution is
an = (A1 n + A2 )2n + n2 ( n6 + 1)2n
NO initial conditions given; So cannot find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1
General Homog. Solution SH = (A1 n + A2 )1n = A1 n + A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1
General Homog. Solution SH = (A1 n + A2 )1n = A1 n + A2
Let APS an = P0 n2 1n = P0 n2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1
General Homog. Solution SH = (A1 n + A2 )1n = A1 n + A2
Let APS an = P0 n2 1n = P0 n2
Substitute this APS in the given INhomog. LRR; Get P0 ;

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1
General Homog. Solution SH = (A1 n + A2 )1n = A1 n + A2
Let APS an = P0 n2 1n = P0 n2
Substitute this APS in the given INhomog. LRR; Get P0 ;
7
You will get P0 = 2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1
General Homog. Solution SH = (A1 n + A2 )1n = A1 n + A2
Let APS an = P0 n2 1n = P0 n2
Substitute this APS in the given INhomog. LRR; Get P0 ;
7
You will get P0 = 2
Hence, the general solution is
an = A1 n + A2 + 27 n2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

3. Solve an − 2an−1 + an−2 = 7

Char. Eqn. is α2 − 2α + 1 = 0; Solve and get the 2 roots:


1&1
General Homog. Solution SH = (A1 n + A2 )1n = A1 n + A2
Let APS an = P0 n2 1n = P0 n2
Substitute this APS in the given INhomog. LRR; Get P0 ;
7
You will get P0 = 2
Hence, the general solution is
an = A1 n + A2 + 27 n2
NO initial conditions given; So cannot find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3
General Homog. Solution SH = A1 2n + A2 3n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3
General Homog. Solution SH = A1 2n + A2 3n
Let APS an = P0 n1 2n + (P1 + P2 n)

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3
General Homog. Solution SH = A1 2n + A2 3n
Let APS an = P0 n1 2n + (P1 + P2 n)
Substitute this APS in the given INhomog. LRR; Get Pi ’s;

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3
General Homog. Solution SH = A1 2n + A2 3n
Let APS an = P0 n1 2n + (P1 + P2 n)
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P0 = −2; P1 = 74 ; P2 = 1
2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3
General Homog. Solution SH = A1 2n + A2 3n
Let APS an = P0 n1 2n + (P1 + P2 n)
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P0 = −2; P1 = 74 ; P2 = 1
2
Hence, the general solution is
n 7
an = A1 2n + A2 3n − 2n2n + 2
+ 4

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems

4. Solve an − 5an−1 + 6an−2 = 2n + n

Char. Eqn. is α2 − 5α + 6 = 0; Solve and get the 2 roots:


2&3
General Homog. Solution SH = A1 2n + A2 3n
Let APS an = P0 n1 2n + (P1 + P2 n)
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
You will get P0 = −2; P1 = 74 ; P2 = 1
2
Hence, the general solution is
an = A1 2n + A2 3n − 2n2n + n2 + 74
NO initial conditions given; So cannot find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
7
You will get P0 = 1; P1 = 18
;

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
7
You will get P0 = 1; P1 = 18
;
Hence, the general solution is
7 2
an = (A1 n + A2 )3n + 2n + 18
n − 3n

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
7
You will get P0 = 1; P1 = 18
;
Hence, the general solution is
7 2
an = (A1 n + A2 )3n + 2n + 18 n − 3n
NOW, use the initial conditions to find A1 and A2

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
7
You will get P0 = 1; P1 = 18
;
Hence, the general solution is
7 2
an = (A1 n + A2 )3n + 2n + 18 n − 3n
NOW, use the initial conditions to find A1 and A2
5
A1 = 18
, A2 = 0

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Problems
5. Solve an+2 − 6an+1 + 9an = 3(2)n + 7(3)n , n ≥ 0, with
initial conditions a0 = 1, a1 = 4
Char. Eqn. is α2 − 6α + 9 = 0; the 2 roots are: 3&3
General Homog. Solution SH = (A1 n + A2 )3n
Let APS an = P0 2n + P1 n2 3n
Substitute this APS in the given INhomog. LRR; Get Pi ’s;
7
You will get P0 = 1; P1 = 18
;
Hence, the general solution is
7 2
an = (A1 n + A2 )3n + 2n + 18 n − 3n
NOW, use the initial conditions to find A1 and A2
5
A1 = 18
, A2 = 0
Hence, THE solution is
5 7 2
an = 18 n3n + 2n + 18
n − 3n
Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

References

Joe L. Mott, Abraham Kandel, Theodore P. Baker, “Discrete


Mathematics for Computer Scientists & Mathematicians", 2 ed.,
PHI, 1986.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

References

Joe L. Mott, Abraham Kandel, Theodore P. Baker, “Discrete


Mathematics for Computer Scientists & Mathematicians", 2 ed.,
PHI, 1986.
Thomas Koshy, “Discrete Mathematics with Applications",
Academic Press, Elsevier, 2004.

Recurrence Relations
Overview Sequences & Recurrence Relations Solving RRs by Generating Functions Solving RRs by Characteristic Roots

Recurrence Relations