You are on page 1of 32

Solving Linear Recurrence

Relations
Section 8.2

© 2019 McGraw-Hill Education


Section Summary 2

Linear Homogeneous Recurrence Relations


Solving Linear Homogeneous Recurrence
Relations with Constant Coefficients.
Solving Linear Nonhomogeneous Recurrence
Relations with Constant Coefficients.

© 2019 McGraw-Hill Education


Linear Homogeneous Recurrence Def.1, p.540

Relations
Definition: A linear homogeneous recurrence relation of degree
k with constant coefficients is a recurrence relation of the form
an = c1an−1 + c2an−2 + ….. + ck an−k , where c1, c2, ….,ck are real
numbers, and ck ≠ 0
• it is linear because the right-hand side is a sum of the previous terms of
the sequence each multiplied by a function of n.

• it is homogeneous because no terms occur that are not multiples of the


ajs. Each coefficient is a constant.

• the degree is k because an is expressed in terms of the previous k terms


of the sequence.

By strong induction, a sequence satisfying such a recurrence relation is


uniquely determined by the recurrence relation and the k initial conditions a0
= C1, a0 = C1 ,… , ak−1 = Ck−1.
© 2019 McGraw-Hill Education
Examples of Linear Homogeneous
Recurrence Relations
Pn  1.11 Pn 1 linear homogeneous recurrence relation
of degree one

𝑓𝑛f n= 𝑓𝑛−1


f n 1 ?+ f𝑓n𝑛−2
2
linear homogeneous recurrence relation
of degree two

an  an 1  a 2 n  2 not linear

H n  2 H n 1  1 not homogeneous

Bn  nBn 1 coefficients are not constants

© 2019 McGraw-Hill Education


Solving Linear Homogeneous Sec.8.2.2, p.541

Recurrence Relations
The basic approach is to look for solutions of the form
an = rn, where r is a constant.
Note that an = rn is a solution to the recurrence relation
an  c1an 1  c2 an  2   ck an  k if and only if
r n  c1r n 1  c2 r n  2   ck rn  k .
Algebraic manipulation yields the characteristic equation:
r𝑟k 𝑘−c1r𝑐1k 𝑟1 𝑘−1
 c2 r−k 𝑐22𝑟 𝑘−2 −
ck ⋯   𝑟 − 𝑐𝑘 = 0
−ck𝑐𝑘−1
1r ?
The sequence {an} with an = rn is a solution if and only if r is a
solution to the characteristic equation.
The solutions to the characteristic equation are called the
characteristic roots of the recurrence relation. The roots are used
to give an explicit formula for all the solutions of the recurrence
relation.
© 2019 McGraw-Hill Education
Solving Linear Homogeneous Th.1, p.542

Recurrence Relations of Degree Two


Theorem 1: Let c1 and c2 be real numbers.
Suppose that r2 – c1r – c2 = 0 has two distinct roots
r1 and r2. Then the sequence {an} is a solution to
the recurrence relation an  c1an 1  c2 an  2
if and only if

an   r   r
1
n
2 2
n

for n = 0,1,2,… , where α1 and α2 are constants.

© 2019 McGraw-Hill Education


Ex.3, p.543

Using Theorem 1
Example: What is the solution to the recurrence relation
an = an−1 + 2an−2 with a0 = 2 and a1 = 7?
Solution: The characteristic equation is r2 − r − 2 = 0.
Its roots are r = 2 and r = −1 . Therefore, {an} is a solution to
the recurrence relation if and
only if an = α12n + α2(−1)n, for some constants α1 and α2.
To find the constants α1 and α2, note that
a0 = 2 = α1 + α2 and a1 = 7 = α12 + α2(−1).
Solving these equations, we find that α1 = 3 and α2 = −1.
Hence, the solution is the sequence {an} with an = 3∙2n − (−1)n.
© 2019 McGraw-Hill Education
An Explicit Formula for the Fibonacci Ex.4, p.543

Numbers 1

We can use Theorem 1 to find an explicit formula for


the Fibonacci numbers. The sequence of Fibonacci
numbers satisfies the recurrence relation fn = fn−1 + fn−2
with the initial conditions: f0 = 0 and f1 = 1.
Solution: The roots of the characteristic equation
r2 – r – 1 = 0 are
1 5
r1 
2
1 5
r2 
2
© 2019 McGraw-Hill Education
Fibonacci Numbers 2

Therefore by Theorem 1
n n
 1 5   1 5 
f n  1     2
 2 
 2   

for some constants α1 and α2.


Using the initial conditions f0 = 0 and f1 = 1 , we have
f 0  1   2  0
 1 5   1 5 
f1  1     2    1.
 2   2 
1 1
Solving, we obtain 1  , 2  .
5 5
n n
Hence, 1  1 5  1 1 5 
fn       .
5 2  5 2 

© 2019 McGraw-Hill Education


The Solution when there is a Repeated Th.2, p.544

Root
Theorem 2: Let c1 and c2 be real numbers with
c2 ≠ 0. Suppose that r2 – c1r – c2 = 0 has one
repeated root r0. Then the sequence {an} is a
solution to the recurrence relation an = c1an−1 +
c2an−2 if and only if
an   r   2 nr
0
n
0
n

for n = 0,1,2,… , where α1 and α2 are constants.

© 2019 McGraw-Hill Education


Ex.5, p.544

Using Theorem 2
Example: What is the solution to the recurrence relation
an = 6an−1 − 9an−2 with a0 = 1 and a1 = 6?
Solution: The characteristic equation is r2 − 6r + 9 = 0.
The only root is r = 3. Therefore, {an} is a solution to the
recurrence relation if and only if
an = α13n + α2n(3)n
where α1 and α2 are constants.
To find the constants α1 and α2, note that
a0 = 1 = α1 and a1 = 6 = α1 ∙ 3 + α2 ∙3.
Solving, we find that α1 = 1 and α2 = 1 .
Hence,
an = 3n + n3n .
© 2019 McGraw-Hill Education
Multiplicity Greater than Two
Example: What is the solution to the recurrence relation
an = 6an−1 - 12an−2 + 8an−3 with a0 = a1 = a2 = 4?
Solution: The characteristic equation is 𝑟 − 2 3 = 0.
Let 𝑎𝑛 = 𝛼1 2𝑛 + 𝛼2 𝑛2𝑛 + 𝛼3 𝑛2 2𝑛 = 2𝑛 𝛼1 + 𝛼2 𝑛 + 𝛼3 𝑛2 .
𝑛 = 0: 4 = 𝛼1 + 0 + 0 𝛼1 = 4
൞ 𝑛 = 1: 4 = 2𝛼1 + 2𝛼2 + 2𝛼3 ⇒ ቐ −2 = 𝛼2 + 𝛼3
𝑛 = 2: 4 = 4𝛼1 + 8𝛼2 + 16𝛼3 −3 = 2𝛼2 + 4𝛼3
𝛼1 = 4
𝑎3 = 6 ⋅ 4 − 12 ⋅ 4 + 8 ⋅ 4 = 8
5 5 1
𝛼2 = − 23 4 − ⋅ 3 ⋅ + ⋅ 32 = 8 ⋅ 1 = 8
⇒ 2 2 2
1
𝛼3 =
2
© 2019 McGraw-Hill Education
Multiplicity Greater than Two
Example: What is the solution to the recurrence relation
an = 3an−1 - 3an−2 + an−3 with a0 = 0, a1 = 3, a2 = 10?
Solution: The characteristic equation is 𝑟 − 1 3 = 0.
Let 𝑎𝑛 = 𝛼1 ⋅ 1𝑛 + 𝛼2 𝑛 ⋅ 1𝑛 + 𝛼3 𝑛2 ⋅ 1𝑛 = 𝛼1 + 𝛼2 𝑛 + 𝛼3 𝑛2 .
𝑛 = 0: 0 = 𝛼1 + 0 + 0 𝛼1 = 0 𝛼1 = 0
൞ 𝑛 = 1: 3 = 𝛼1 + 𝛼2 + 𝛼3 ⇒ ቐ 3 = 𝛼2 + 𝛼3 ⇒ ቐ𝛼2 = 1
𝑛 = 2: 10 = 𝛼1 + 2𝛼2 + 4𝛼3 10 = 2𝛼2 + 4𝛼3 𝛼3 = 2

𝑎3 = 3 ⋅ 10 − 3 ⋅ 3 + 0 = 21
3 + 2 ⋅ 32 = 21

© 2019 McGraw-Hill Education


Solving Linear Homogeneous Recurrence Th.3, p.545

Relations of Arbitrary Degree


This theorem can be used to solve linear homogeneous
recurrence relations with constant coefficients of any degree
when the characteristic equation has distinct roots.
Theorem 3: Let c1, c2 ,…, ck be real numbers. Suppose that the
characteristic equation
rk – c1rk−1 –⋯ – ck = 0
has k distinct roots r1, r2, …, rk. Then a sequence {an} is a
solution of the recurrence relation
an = c1an−1 + c2an−2 + ….. + ck an−k
if and only if
an  1r1n   2 r2m    k rkn
for n = 0, 1, 2, …, where α1, α2,…, αk are constants.
© 2019 McGraw-Hill Education
The General Case with Repeated Roots
Allowed
Theorem 4: Let c1, c2 ,…, ck be real numbers. Suppose that the
characteristic equation
?r k c1r k 1 ? ck  0
has t distinct roots r1, r2, …, rt with multiplicities m1, m2, …, mt,
respectively so that mi ≥ 1 for i = 0, 1, 2, …,t and m1 + m2 + … + mt
= k. Then a sequence {an} is a solution of the recurrence relation
?an  c1an 1  c2 an  2  .  ck an  k
if and only if ?an  1,0  1,1n   1 m1  1n m 1 1  r1n
  2,0   2,1n    2, m 2  1n m2 1  r2n
 
  t ,0   t ,1n  
  t ,mt  1n mt 1 rt n
for n = 0, 1, 2, …, where αi,j are constants for 1≤ i ≤ t and 0≤ j ≤ mi−1.
© 2019 McGraw-Hill Education
De Moivre’s Formula
De Moivre’s Formula:
cos 𝑥 + 𝑖 sin 𝑥 𝑛 = cos 𝑛𝑥 + 𝑖 sin 𝑛𝑥
Proof: Using M.I. The formula holds for 𝑛 = 1 clearly.
Assume that the formula holds for 𝑛 = 𝑘.
cos 𝑥 + 𝑖 sin 𝑥 𝑘+1
= cos 𝑥 + 𝑖 sin 𝑥 𝑘 cos 𝑥 + 𝑖 sin 𝑥
= cos 𝑘𝑥 + 𝑖 sin 𝑘𝑥 cos 𝑥 + 𝑖 sin 𝑥
= cos 𝑘𝑥 cos 𝑥 − sin 𝑘𝑥 sin 𝑥
+ 𝑖 sin 𝑘𝑥 cos 𝑥 + cos 𝑘𝑥 sin 𝑥
= cos 𝑘 + 1 𝑥 + 𝑖 sin 𝑘 + 1 𝑥
Alternative way (informal): using Euler’s formula
𝑛 𝑖𝑥 𝑛
cos 𝑥 + 𝑖 sin 𝑥 = 𝑒 = 𝑒 𝑖𝑛𝑥 = cos 𝑛𝑥 + 𝑖 sin 𝑛𝑥

© 2019 McGraw-Hill Education


De Moivre’s Formula
De Moivre’s Formula:
cos 𝑥 + 𝑖 sin 𝑥 𝑛 = cos 𝑛𝑥 + 𝑖 sin 𝑛𝑥
Proof: For the negative integer cases:
cos 𝑥 + 𝑖 sin 𝑥 −𝑛
𝑛 −1
= cos 𝑥 + 𝑖 sin 𝑥
= cos 𝑛𝑥 + 𝑖 sin 𝑛𝑥 −1
−1
𝑧ҧ
= cos 𝑛𝑥 − 𝑖 sin 𝑛𝑥 ∵ 𝑧 = 2
𝑧
= cos −𝑛𝑥 + 𝑖 sin −𝑛𝑥

Corollary:
cos 𝑥 − 𝑖 sin 𝑥 𝑛 = cos −𝑛𝑥 + 𝑖 sin −𝑛𝑥 = cos 𝑛𝑥 − 𝑖 sin 𝑛𝑥

© 2019 McGraw-Hill Education


De Moivre’s Formula
Example: 1 + 𝑖 9 =? , 1 − 𝑖 9 =?
1 1 𝜋 𝜋
Solution: 1 + 𝑖 = 2 +𝑖 = 2 cos + 𝑖 sin
2 2 4 4
9 9
9
𝜋 𝜋 9 𝜋 𝜋
1+𝑖 = 2 cos + 𝑖 sin = 2 cos + 𝑖 sin
4 4 4 4
9𝜋 9𝜋 𝜋 𝜋
= 16 2 cos + 𝑖 sin = 16 2 cos + 𝑖 sin
4 4 4 4
1 1
= 16 2 +𝑖 = 16 + 16𝑖
2 2
1 −1 −𝜋 −𝜋
1−𝑖 = 2 +𝑖 = 2 cos + 𝑖 sin
2 2 4 4

© 2019 McGraw-Hill Education


Complex Roots (Conjugate)
Example: What is the solution to the recurrence relation
an = 2an−1 − 2an−2 with a0 = 1 and a1 = 2?
Solution: The characteristic equation is r2 − 2r − 2 = 0.
𝜋 𝜋
𝑟 = 1 ± 𝑖 = 2 cos ± 𝑖 sin
4 4
𝜋 𝜋 𝑛 𝜋 𝜋 𝑛
⇒ 𝑎𝑛 = 𝛼1 2 cos + 𝑖 sin + 𝛼2 2 cos − 𝑖 sin
4 4 4 4
𝑛 𝑛𝜋 𝑛𝜋 𝑛 𝑛𝜋 𝑛𝜋
= 𝛼1 2 cos + 𝑖 sin + 𝛼2 2 cos − 𝑖 sin
4 4 4 4
𝑛 𝑛𝜋 𝑛𝜋
= 2 𝛼1 + 𝛼2 cos + 𝛼1 − 𝑖𝛼2 sin
4 4
𝑛 𝑛𝜋 𝑛𝜋
= 2 𝛽1 cos + 𝛽2 sin
4 4

© 2019 McGraw-Hill Education


Complex Roots (Conjugate)
Example: What is the solution to the recurrence relation
an = 2an−1 − 2an−2 with a0 = 1 and a1 = 2?
𝑛 𝑛𝜋 𝑛𝜋
Solution: 𝑎𝑛 = 2 𝛽1 cos + 𝛽2 sin
4 4
𝑎0 = 1 1 = 𝛽1 𝛽1 = 1
ቊ ⇒ቊ ⇒ቊ
𝑎1 = 2 2 = 𝛽1 + 𝛽2 𝛽2 = 1
𝑛 𝑛𝜋 𝑛𝜋
⇒ 𝑎𝑛 = 2 cos + sin
4 4

© 2019 McGraw-Hill Education


Linear Nonhomogeneous Recurrence
Relations with Constant Coefficients 1

Definition: A linear nonhomogeneous recurrence


relation with constant coefficients is a recurrence
relation of the form:
?an  c1an 1  c2 an  2  .  ck an  k  F  n  ,
where c1, c2, ….,ck are real numbers, and F(n) is a
function not identically zero depending only on n.
The recurrence relation
?an  c1an 1  c2 an  2  .  ck an  k ,
is called the associated homogeneous recurrence
relation.
© 2019 McGraw-Hill Education
Linear Nonhomogeneous Recurrence
Relations with Constant Coefficients 2

The following are linear nonhomogeneous recurrence


relations with constant coefficients:
an  an 1  2n ,
?an  an 1  an  2  n 2  n  1,
?an  3an 1  n3n ,
?an  an 1  an  2  an 3  n !
where the following are the associated linear homogeneous
recurrence relations, respectively:
an  an 1 ,
?an  an 1  an  2
?an  3an 1 ,
?an  an 1  an  2  an 3
© 2019 McGraw-Hill Education
Solving Linear Nonhomogeneous Recurrence Th.5, p.547

Relations with Constant Coefficients 1

Theorem 5: If {an(p)} is a particular solution of


the nonhomogeneous linear recurrence relation
with constant coefficients
an  c1an 1  c2 an  2   ck an  k  F  n  ,
then every solution is of the form {an(p) + an(h)},
where {an(h)} is a solution of the associated
homogeneous recurrence relation
an  c1an 1  c2 an  2   ck an  k .

© 2019 McGraw-Hill Education


Solving Linear Nonhomogeneous Recurrence Ex.10, p.548

Relations with Constant Coefficients 2

Example: Find all solutions of the recurrence relation an = 3an−1 + 2n.


What is the solution with a1 = 3?
Solution: The associated linear homogeneous equation is an = 3an−1.
Its solutions are an(h) = α3n, where α is a constant.
Because F(n)= 2n is a polynomial in n of degree one, to find a particular solution we
might try a linear function in n, say pn = cn + d, where c and d are constants. Suppose
that pn = cn + d is such a solution.
Then an = 3an−1 + 2n becomes cn + d = 3(c(n−1) + d)+ 2n.
Simplifying yields (2 + 2c)n + (2d − 3c) = 0. It follows that cn + d is a solution if and
only if
2 + 2c = 0 and 2d − 3c = 0. Therefore, cn + d is a solution if and only if c = − 1 and d =
− 3/2.
Consequently, an(p) = −n − 3/2 is a particular solution.
By Theorem 5, all solutions are of the form an = an(p) + an(h) = −n − 3/2 + α3n, where α
is a constant.
To find the solution with a1 = 3, let n = 1 in the above formula for the general solution.
Then 3 = −1 − 3/2 + 3 α, and α = 11/6. Hence, the solution is an = −n − 3/2 + (11/6)3n.
© 2019 McGraw-Hill Education
𝑝
Cases of 𝑎𝑛
Case 1: 𝐹 𝑛 = 𝑏0 + 𝑏1 𝑛 + 𝑏2 𝑛2 + ⋯ + 𝑏𝑡 𝑛𝑡
𝑝
⇒ 𝑎𝑛 = 𝑑0 + 𝑑1 𝑛 + 𝑑2 𝑛2 + ⋯ + 𝑑𝑡 𝑛𝑡
If the characteristic roots contain 𝑠 1’s, then
𝑝
𝑎𝑛 = 𝑑0 + 𝑑1 𝑛 + 𝑑2 𝑛2 + ⋯ + 𝑑𝑡 𝑛𝑡 ⋅ 𝑛 𝑠

𝑝
Case 2: 𝐹 𝑛 = 𝑝 ⋅ 𝑏 𝑛 ⇒ 𝑎𝑛 = 𝑑 ⋅ 𝑏 𝑛
If the characteristic roots contain 𝑠 𝑏’s, then
𝑝
𝑎𝑛 = 𝑏 𝑛 ⋅ 𝑛 𝑠

𝑝
Case 3: 𝐹 𝑛 = sin / cos functions ⇒ 𝑎𝑛 = 𝑑0 sin 𝑛𝜃 + 𝑑1 cos 𝑛𝜃

© 2019 McGraw-Hill Education


Case 1
Example: What is the solution to the recurrence relation
𝑎𝑛 + 2𝑎𝑛−1 = 𝑛 + 3 with 𝑎0 = 3?

Solution: Characteristic equation: 𝑟 + 2 = 0 ⇒ 𝑎𝑛 = 𝛼 ⋅ −2 𝑛 .
𝑝
Let 𝑎𝑛 = 𝑑0 + 𝑑1 𝑛.
⇒ 𝑑0 + 𝑑1 𝑛 + 2 𝑑0 + 𝑑1 𝑛 − 1 =𝑛+3
⇒ 3𝑑0 − 2𝑑1 + 3𝑑1 𝑛 = 𝑛 + 3
3𝑑0 − 2𝑑1 = 3 𝑑0 = 11Τ9 𝑛 11 𝑛
⇒ቊ ⇒ቊ ⇒ 𝑎𝑛 = 𝛼 ⋅ −2 + +
3𝑑1 = 1 𝑑1 = 1Τ3 9 3

0 11 0 16 𝑎1 = −2 ⋅ 3 + 1 + 3 = −2
𝛼 ⋅ −2 + + =3⇒𝛼= 16 11 1
9 3 9 1
⋅ −2 + + = −2
9 9 3

© 2019 McGraw-Hill Education


Case 1
Example: What is the solution to the recurrence relation
𝑎𝑛+2 − 3𝑎𝑛+1 + 2𝑎𝑛 = 4𝑛 + 2 with 𝑎0 = 3, 𝑎1 = −2?
Solution: Characteristic equation:

𝑟 2 − 3𝑟 + 2 = 𝑟 − 1 𝑟 − 2 = 0 ⇒ 𝑎𝑛 = 𝛼1 ⋅ 2𝑛 + 𝛼2 ⋅ 1𝑛 .
𝑝
Let 𝑎𝑛 = 𝑑0 + 𝑑1 𝑛 ⋅ 𝑛.
𝑑0 + 𝑑1 𝑛 + 2 𝑛 + 2 − 3 𝑑0 + 𝑑1 𝑛 + 1 𝑛 + 1 + 2 𝑑0 + 𝑑1 𝑛 𝑛 =
4𝑛 + 2
𝑛 = 0: 2𝑑0 + 4𝑑1 − 3𝑑0 − 3𝑑1 = 2 = −𝑑0 + 𝑑1 𝑑 = −4
⇒ቊ ⇒ቊ 0 ⇒
𝑛 = −1: 𝑑0 + 𝑑1 − 2𝑑0 + 2𝑑1 = −2 = −𝑑0 + 3𝑑1 𝑑1 = −2
𝑎𝑛 = 𝛼1 ⋅ 2𝑛 + 𝛼2 ⋅ 1𝑛 + −4 − 2𝑛 𝑛
3 = 𝛼1 + 𝛼2 𝛼1 = 1
൝ ⇒ቊ
−2 = 2𝛼1 + 𝛼2 − 6 𝛼2 = 2
𝑎2 = 3 ⋅ −2 − 2 ⋅ 3 + 4 ⋅ 0 + 2 = −10
𝑎2 = 22 + 2 + −4 − 2 ⋅ 2 ⋅ 2 = −10

© 2019 McGraw-Hill Education


Case 2
Example: What is the solution to the recurrence relation
𝑎𝑛+2 + 3𝑎𝑛+1 + 2𝑎𝑛 = 3𝑛 with 𝑎0 = 0, 𝑎1 = 1?
Solution: Characteristic equation:

𝑟 2 + 3𝑟 + 2 = 𝑟 + 1 𝑟 + 2 = 0 ⇒ 𝑎𝑛 = 𝛼1 ⋅ −2 𝑛 + 𝛼2 ⋅ −1 𝑛 .
𝑝
Let 𝑎𝑛 = 𝑑 ⋅ 3𝑛 .
1
𝑑 ⋅ 3𝑛+2 + 3𝑑 ⋅ 3𝑛+1 + 2𝑑 ⋅ 3𝑛 = 3𝑛 ⇒ 9𝑑 + 9𝑑 + 2𝑑 = 1 ⇒ 𝑑 =
20
𝑛 𝑛
1
𝑎𝑛 = 𝛼1 ⋅ −2 + 𝛼2 ⋅ −1 + ⋅ 3𝑛
20
1 16
0 = 𝛼1 + 𝛼2 + 𝛼1 = −
20 ⇒ 20
3 15
1 = −2𝛼1 − 𝛼2 + 𝛼2 =
20 20
𝑎2 = −3 ⋅ 1 − 2 ⋅ 0 + 30 = −2
1 2 2
−16 ⋅ −2 + 15 ⋅ −1 + 32 = −2
20
© 2019 McGraw-Hill Education
Case 2
Example: What is the solution to the recurrence relation
𝑎𝑛 = 𝑎𝑛−1 + 2𝑎𝑛−2 + −1 𝑛 with 𝑎0 = 1, 𝑎1 = 1?
Solution: Characteristic equation:

𝑟 2 − 𝑟 − 2 = 𝑟 + 1 𝑟 − 2 = 0 ⇒ 𝑎𝑛 = 𝛼1 ⋅ 2𝑛 + 𝛼2 ⋅ −1 𝑛 .
𝑝
Let 𝑎𝑛 = 𝑑 ⋅ −1 𝑛 ⋅ 𝑛.
𝑑 −1 𝑛 𝑛 = 𝑑 −1 𝑛−1
𝑛 − 1 + 2𝑑 −1 𝑛−2 𝑛 − 2 + −1 𝑛
1
⇒ −𝑑 = 2𝑑 −1 −1 + −1 ⇒ 𝑑 =
3
1
𝑎𝑛 = 𝛼1 ⋅ 2 + 𝛼2 ⋅ −1 + ⋅ −1 𝑛 ⋅ 𝑛
𝑛 𝑛
3
7
1 = 𝛼1 + 𝛼2 𝛼1 = 𝑎2 = 1 + 2 ⋅ 1 + −1 2 = 4
1⇒ 9 2⋅2
2 7 2 −1
1 = 2𝛼1 − 𝛼2 − ⋅ 22 + ⋅ −1 2 + =4
3 𝛼2 = 9 9 3
9

© 2019 McGraw-Hill Education


Case 3
Example: What is the solution to the recurrence relation
𝑛𝜋
𝑎𝑛+2 − 𝑎𝑛 = sin with 𝑎0 = 1, 𝑎1 = 1?
2
Solution: Characteristic equation:

𝑟 2 − 1 = 𝑟 + 1 𝑟 − 1 = 0 ⇒ 𝑎𝑛 = 𝛼1 ⋅ 1 𝑛
+ 𝛼2 ⋅ −1 𝑛 .
𝑝 𝑛𝜋 𝑛𝜋
Let 𝑎𝑛 = 𝑑1 cos + 𝑑2 sin .
2 2
𝑛+2 𝜋 𝑛+2 𝜋 𝑛𝜋 𝑛𝜋 𝑛𝜋
𝑑1 cos + 𝑑2 sin − 𝑑1 cos + 𝑑2 sin = sin
2 2 2 2 2
𝑛+2 𝜋 𝑛𝜋 𝑛𝜋 𝑛+2 𝜋 𝑛𝜋
Note that cos = cos + 𝜋 = − cos , sin = sin +𝜋 =
2 2 2 2 2
𝑛𝜋
− sin
2
−2𝑑1 = 0, −2𝑑2 = 1 ⇒ 𝑑1 = 0, 𝑑2 = −1/2 2𝜋
1
𝑎𝑛 = 𝛼1 ⋅ 1 𝑛 + 𝛼2 ⋅ −1 𝑛 − sin
𝑛𝜋 𝑎2 = 1 + sin =1
2 2 2
5 1 1 2𝜋
1 = 𝛼1 + 𝛼2 𝛼1 = 5Τ4 − − sin =1
൝ ⇒ቊ 4 4 2 2
1 = 𝛼1 − 𝛼2 − 1/2 𝛼2 = −1Τ4
© 2019 McGraw-Hill Education
Hybrid
Example: What is the solution to the recurrence relation
𝑎𝑛 − 4𝑎𝑛−1 + 4𝑎𝑛−2 = 1 + 𝑛 ⋅ 2𝑛 with 𝑎0 = 1, 𝑎1 = 19/3?
ℎ 𝑝
Solution: 𝑎𝑛 = 𝛼1 ⋅ 2𝑛 + 𝛼2 𝑛 ⋅ 2𝑛 , 𝑎𝑛 = 𝑑0 + 𝑑1 𝑛 2𝑛 ⋅ 𝑛2 .
𝑑0 + 𝑑1 𝑛 2𝑛 𝑛2 − 4 𝑑0 + 𝑑1 𝑛 − 1 2𝑛−1 𝑛 − 1 2 + 4൫𝑑0 + 𝑑1 ሺ𝑛 −

19 100
𝑎2 = 4 ⋅ − 4 ⋅ 1 + 1 + 2 22 =
3 3
2 2 23 100
2 ⋅ 1+2+2 + =
6 3

© 2019 McGraw-Hill Education


Hanoi Tower
Example: What is the solution to the recurrence relation
𝐻𝑛 = 2𝐻𝑛−1 + 1 with 𝐻1 = 1?
ℎ 𝑝
Solution: 𝐻𝑛 = 𝛼 ⋅ 2𝑛 , 𝐻𝑛 = 𝑑.
𝑑 = 2𝑑 + 1 ⇒ 𝑑 = −1

𝐻𝑛 = 𝛼2𝑛 − 1, 𝐻1 = 𝛼21 − 1 = 1 ⇒ 𝛼 = 1

© 2019 McGraw-Hill Education

You might also like