solution of linear homogeneous recurrence relations
TRANSCRIPT
Solution of Linear Homogeneous RecurrenceRelations
General Solutions for Homogeneous Problems
Ioan Despi
University of New England
September 16, 2013
Outline
1 Introduction
2 Main TheoremExamples
3 General Procedure
4 More Examples
Ioan Despi – AMTH140 2 of 15
Introduction
If the characteristic equation associated with a given 𝑚-th order linear,constant coefficient, homogeneous recurrence relation has some repeatedroots, then the solution given by
∑︀𝐴𝑖𝜆
𝑛𝑖 will not have 𝑚 arbitrary
constants.
To see this, we assume for instance 𝜆1 = 𝜆2, i.e. root 𝜆1 is repeated.
Then the solution 𝑎𝑛 =𝑚∑︁𝑖=1
𝐴𝑖𝜆𝑛𝑖 = (𝐴1 + 𝐴2)𝜆𝑛
2 + 𝐴3𝜆𝑛3 + · · · + 𝐴𝑚𝜆𝑛
𝑚
has less than 𝑚 arbitrary constants because 𝐴1 + 𝐴2 comprisesessentially only one arbitrary constant.
To make up for the missing ones, we introduce the following more generaltheorem.
Ioan Despi – AMTH140 3 of 15
Introduction
If the characteristic equation associated with a given 𝑚-th order linear,constant coefficient, homogeneous recurrence relation has some repeatedroots, then the solution given by
∑︀𝐴𝑖𝜆
𝑛𝑖 will not have 𝑚 arbitrary
constants.
To see this, we assume for instance 𝜆1 = 𝜆2, i.e. root 𝜆1 is repeated.
Then the solution 𝑎𝑛 =𝑚∑︁𝑖=1
𝐴𝑖𝜆𝑛𝑖 = (𝐴1 + 𝐴2)𝜆𝑛
2 + 𝐴3𝜆𝑛3 + · · · + 𝐴𝑚𝜆𝑛
𝑚
has less than 𝑚 arbitrary constants because 𝐴1 + 𝐴2 comprisesessentially only one arbitrary constant.
To make up for the missing ones, we introduce the following more generaltheorem.
Ioan Despi – AMTH140 3 of 15
Introduction
If the characteristic equation associated with a given 𝑚-th order linear,constant coefficient, homogeneous recurrence relation has some repeatedroots, then the solution given by
∑︀𝐴𝑖𝜆
𝑛𝑖 will not have 𝑚 arbitrary
constants.
To see this, we assume for instance 𝜆1 = 𝜆2, i.e. root 𝜆1 is repeated.
Then the solution 𝑎𝑛 =
𝑚∑︁𝑖=1
𝐴𝑖𝜆𝑛𝑖 = (𝐴1 + 𝐴2)𝜆𝑛
2 + 𝐴3𝜆𝑛3 + · · · + 𝐴𝑚𝜆𝑛
𝑚
has less than 𝑚 arbitrary constants because 𝐴1 + 𝐴2 comprisesessentially only one arbitrary constant.
To make up for the missing ones, we introduce the following more generaltheorem.
Ioan Despi – AMTH140 3 of 15
Introduction
If the characteristic equation associated with a given 𝑚-th order linear,constant coefficient, homogeneous recurrence relation has some repeatedroots, then the solution given by
∑︀𝐴𝑖𝜆
𝑛𝑖 will not have 𝑚 arbitrary
constants.
To see this, we assume for instance 𝜆1 = 𝜆2, i.e. root 𝜆1 is repeated.
Then the solution 𝑎𝑛 =
𝑚∑︁𝑖=1
𝐴𝑖𝜆𝑛𝑖 = (𝐴1 + 𝐴2)𝜆𝑛
2 + 𝐴3𝜆𝑛3 + · · · + 𝐴𝑚𝜆𝑛
𝑚
has less than 𝑚 arbitrary constants because 𝐴1 + 𝐴2 comprisesessentially only one arbitrary constant.
To make up for the missing ones, we introduce the following more generaltheorem.
Ioan Despi – AMTH140 3 of 15
Theorem
Suppose the characteristic equation of the linear, constant coefficientrecurrence relation
𝑐𝑚𝑎𝑛+𝑚 + 𝑐𝑚−1𝑎𝑛+𝑚−1 + · · · + 𝑐1𝑎𝑛+1 + 𝑐0𝑎𝑛 = 0, 𝑐𝑚𝑐0 ̸= 0, 𝑛 ≥ 0
has the following roots (all roots accounted for)
𝑚1⏞ ⏟ 𝜆1, · · · , 𝜆1 ,
𝑚2⏞ ⏟ 𝜆2, · · · , 𝜆2 , · · · ,
𝑚𝑘⏞ ⏟ 𝜆𝑘, · · · , 𝜆𝑘
such that 𝜆1, · · · , 𝜆𝑘 are distinct, 𝑚1, · · · ,𝑚𝑘 ≥ 1 and 𝑚1 + · · · + 𝑚𝑘 = 𝑚.Then the general solution of the recurrence relation is
𝑎𝑛 =
𝑘∑︁𝑖=1
⎡⎣(︂𝑚𝑖−1∑︁𝑗=0
𝐴𝑖,𝑗𝑛𝑗
)︂𝜆𝑛𝑖
⎤⎦ , 𝑖.𝑒.,
𝑎𝑛 =(︀𝐴1,0 + 𝐴1,1𝑛 + · · · + 𝐴1,𝑚1−1𝑛
𝑚1−1)︀𝜆𝑛1
+(︀𝐴2,0 + 𝐴2,1𝑛 + · · · + 𝐴2,𝑚2−1𝑛
𝑚2−1))︀𝜆𝑛2 + · · ·
+(︀𝐴𝑘,0 + 𝐴𝑘,1𝑛 + · · · + 𝐴𝑘,𝑚𝑘−1𝑛
𝑚𝑘−1)︀𝜆𝑛𝑘
where 𝐴𝑖,𝑗, for 𝑖 = 1, · · · , 𝑘 and 𝑗 = 0, · · · ,𝑚𝑖 − 1 are arbitrary constants.
Ioan Despi – AMTH140 4 of 15
Notes
So, if the characteristic equation has a root of, say, 𝜆 = 3 that occurstwice (called having multiplicity 2) then in the solution 3𝑛 is multipliedby a polynomial of degree one less that the multiplicity.
I that is of degree one, a linear polynomial: (𝐴𝑛+𝐵)3𝑛.
If the root was 𝜆 = 4 of multiplicity 3 then 4𝑛 is multiplied by apolynomial of degree 2: (𝐴𝑛2 + 𝐵𝑛 + 𝐶)4𝑛.
If the root was 𝜆 = 5 of multiplicity 4 then 5𝑛 is multiplied by apolynomial of degree 3: (𝐴𝑛3 + 𝐵𝑛2 + 𝐶𝑛 + 𝐷)5𝑛.
etc.
Ioan Despi – AMTH140 5 of 15
Notes
So, if the characteristic equation has a root of, say, 𝜆 = 3 that occurstwice (called having multiplicity 2) then in the solution 3𝑛 is multipliedby a polynomial of degree one less that the multiplicity.
I that is of degree one, a linear polynomial: (𝐴𝑛+𝐵)3𝑛.
If the root was 𝜆 = 4 of multiplicity 3 then 4𝑛 is multiplied by apolynomial of degree 2: (𝐴𝑛2 + 𝐵𝑛 + 𝐶)4𝑛.
If the root was 𝜆 = 5 of multiplicity 4 then 5𝑛 is multiplied by apolynomial of degree 3: (𝐴𝑛3 + 𝐵𝑛2 + 𝐶𝑛 + 𝐷)5𝑛.
etc.
Ioan Despi – AMTH140 5 of 15
Notes
So, if the characteristic equation has a root of, say, 𝜆 = 3 that occurstwice (called having multiplicity 2) then in the solution 3𝑛 is multipliedby a polynomial of degree one less that the multiplicity.
I that is of degree one, a linear polynomial: (𝐴𝑛+𝐵)3𝑛.
If the root was 𝜆 = 4 of multiplicity 3 then 4𝑛 is multiplied by apolynomial of degree 2: (𝐴𝑛2 + 𝐵𝑛 + 𝐶)4𝑛.
If the root was 𝜆 = 5 of multiplicity 4 then 5𝑛 is multiplied by apolynomial of degree 3: (𝐴𝑛3 + 𝐵𝑛2 + 𝐶𝑛 + 𝐷)5𝑛.
etc.
Ioan Despi – AMTH140 5 of 15
Notes
So, if the characteristic equation has a root of, say, 𝜆 = 3 that occurstwice (called having multiplicity 2) then in the solution 3𝑛 is multipliedby a polynomial of degree one less that the multiplicity.
I that is of degree one, a linear polynomial: (𝐴𝑛+𝐵)3𝑛.
If the root was 𝜆 = 4 of multiplicity 3 then 4𝑛 is multiplied by apolynomial of degree 2: (𝐴𝑛2 + 𝐵𝑛 + 𝐶)4𝑛.
If the root was 𝜆 = 5 of multiplicity 4 then 5𝑛 is multiplied by apolynomial of degree 3: (𝐴𝑛3 + 𝐵𝑛2 + 𝐶𝑛 + 𝐷)5𝑛.
etc.
Ioan Despi – AMTH140 5 of 15
Notes
So, if the characteristic equation has a root of, say, 𝜆 = 3 that occurstwice (called having multiplicity 2) then in the solution 3𝑛 is multipliedby a polynomial of degree one less that the multiplicity.
I that is of degree one, a linear polynomial: (𝐴𝑛+𝐵)3𝑛.
If the root was 𝜆 = 4 of multiplicity 3 then 4𝑛 is multiplied by apolynomial of degree 2: (𝐴𝑛2 + 𝐵𝑛 + 𝐶)4𝑛.
If the root was 𝜆 = 5 of multiplicity 4 then 5𝑛 is multiplied by apolynomial of degree 3: (𝐴𝑛3 + 𝐵𝑛2 + 𝐶𝑛 + 𝐷)5𝑛.
etc.
Ioan Despi – AMTH140 5 of 15
Example 1
Example
Find a particular solution of
𝑓(𝑛 + 2) + 4𝑓(𝑛 + 1) + 4𝑓(𝑛) = 0, 𝑛 ≥ 0
with initial conditions 𝑓(0) = 1 and 𝑓(1) = 2.
Solution. For clarity, we split the solution procedure into three steps below.
(a) The associated characteristic equation is 𝜆2 + 4𝜆 + 4 = 0 which hasa repeated root 𝜆1 = −2, i.e., 𝑚1 = 2, 𝑘 = 1.
(b) The general solution from the theorem in this lecture is thus
𝑓(𝑛) = (𝐴1,0 + 𝐴1,1𝑛)𝜆𝑛1 = (𝐵0 + 𝐵1𝑛)(−2)𝑛 ,
where 𝐵0 = 𝐴1,0 and 𝐵1 = 𝐴1,1 are arbitrary constants.(c) Constants 𝐵0 and 𝐵1 are to be determined from the initial conditions
𝑓(0) = (𝐵0 + 𝐵1 × 0)(−2)0 = 1𝑓(1) = (𝐵0 + 𝐵1 × 1)(−2)1 = 2
⇔ 𝐵0 = 1−2(𝐵0 + 𝐵1) = 2 .
They are thus 𝐵0 = 1 and 𝐵1 = −2. Hence the requested particular
solution is 𝑓(𝑛) = (1 − 2𝑛)(−2)𝑛 , 𝑛 ≥ 0 .
Ioan Despi – AMTH140 6 of 15
Example 1
Example
Find a particular solution of
𝑓(𝑛 + 2) + 4𝑓(𝑛 + 1) + 4𝑓(𝑛) = 0, 𝑛 ≥ 0
with initial conditions 𝑓(0) = 1 and 𝑓(1) = 2.
Solution. For clarity, we split the solution procedure into three steps below.
(a) The associated characteristic equation is 𝜆2 + 4𝜆 + 4 = 0 which hasa repeated root 𝜆1 = −2, i.e., 𝑚1 = 2, 𝑘 = 1.
(b) The general solution from the theorem in this lecture is thus
𝑓(𝑛) = (𝐴1,0 + 𝐴1,1𝑛)𝜆𝑛1 = (𝐵0 + 𝐵1𝑛)(−2)𝑛 ,
where 𝐵0 = 𝐴1,0 and 𝐵1 = 𝐴1,1 are arbitrary constants.(c) Constants 𝐵0 and 𝐵1 are to be determined from the initial conditions
𝑓(0) = (𝐵0 + 𝐵1 × 0)(−2)0 = 1𝑓(1) = (𝐵0 + 𝐵1 × 1)(−2)1 = 2
⇔ 𝐵0 = 1−2(𝐵0 + 𝐵1) = 2 .
They are thus 𝐵0 = 1 and 𝐵1 = −2. Hence the requested particular
solution is 𝑓(𝑛) = (1 − 2𝑛)(−2)𝑛 , 𝑛 ≥ 0 .
Ioan Despi – AMTH140 6 of 15
Example 1
Example
Find a particular solution of
𝑓(𝑛 + 2) + 4𝑓(𝑛 + 1) + 4𝑓(𝑛) = 0, 𝑛 ≥ 0
with initial conditions 𝑓(0) = 1 and 𝑓(1) = 2.
Solution. For clarity, we split the solution procedure into three steps below.
(a) The associated characteristic equation is 𝜆2 + 4𝜆 + 4 = 0 which hasa repeated root 𝜆1 = −2, i.e., 𝑚1 = 2, 𝑘 = 1.
(b) The general solution from the theorem in this lecture is thus
𝑓(𝑛) = (𝐴1,0 + 𝐴1,1𝑛)𝜆𝑛1 = (𝐵0 + 𝐵1𝑛)(−2)𝑛 ,
where 𝐵0 = 𝐴1,0 and 𝐵1 = 𝐴1,1 are arbitrary constants.
(c) Constants 𝐵0 and 𝐵1 are to be determined from the initial conditions
𝑓(0) = (𝐵0 + 𝐵1 × 0)(−2)0 = 1𝑓(1) = (𝐵0 + 𝐵1 × 1)(−2)1 = 2
⇔ 𝐵0 = 1−2(𝐵0 + 𝐵1) = 2 .
They are thus 𝐵0 = 1 and 𝐵1 = −2. Hence the requested particular
solution is 𝑓(𝑛) = (1 − 2𝑛)(−2)𝑛 , 𝑛 ≥ 0 .
Ioan Despi – AMTH140 6 of 15
Example 1
Example
Find a particular solution of
𝑓(𝑛 + 2) + 4𝑓(𝑛 + 1) + 4𝑓(𝑛) = 0, 𝑛 ≥ 0
with initial conditions 𝑓(0) = 1 and 𝑓(1) = 2.
Solution. For clarity, we split the solution procedure into three steps below.
(a) The associated characteristic equation is 𝜆2 + 4𝜆 + 4 = 0 which hasa repeated root 𝜆1 = −2, i.e., 𝑚1 = 2, 𝑘 = 1.
(b) The general solution from the theorem in this lecture is thus
𝑓(𝑛) = (𝐴1,0 + 𝐴1,1𝑛)𝜆𝑛1 = (𝐵0 + 𝐵1𝑛)(−2)𝑛 ,
where 𝐵0 = 𝐴1,0 and 𝐵1 = 𝐴1,1 are arbitrary constants.(c) Constants 𝐵0 and 𝐵1 are to be determined from the initial conditions
𝑓(0) = (𝐵0 + 𝐵1 × 0)(−2)0 = 1𝑓(1) = (𝐵0 + 𝐵1 × 1)(−2)1 = 2
⇔ 𝐵0 = 1−2(𝐵0 + 𝐵1) = 2 .
They are thus 𝐵0 = 1 and 𝐵1 = −2. Hence the requested particular
solution is 𝑓(𝑛) = (1 − 2𝑛)(−2)𝑛 , 𝑛 ≥ 0 .Ioan Despi – AMTH140 6 of 15
Example 2
Example
Find the general solution of
𝑎𝑛+3 − 3𝑎𝑛+2 + 4𝑎𝑛 = 0 , 𝑛 ≥ 0
Solution.
The associated characteristic equation is 𝐹 (𝜆)def= 𝜆3 − 3𝜆2 + 4 = 0 .
Although there are formulae to give explicit roots for a third orderpolynomial in terms of its coefficients, we are taking a shortcut here byguessing one root 𝜆1 = −1.
I We can check that 𝜆1 = −1 is indeed a root by verifying𝐹 (−1) = (−1)3 − 3(−1)2 + 4 = 0.
To find the remaining roots, we first factorise 𝐹 (𝜆) by performing a long
division:
Ioan Despi – AMTH140 7 of 15
Example 2
Example
Find the general solution of
𝑎𝑛+3 − 3𝑎𝑛+2 + 4𝑎𝑛 = 0 , 𝑛 ≥ 0
Solution.
The associated characteristic equation is 𝐹 (𝜆)def= 𝜆3 − 3𝜆2 + 4 = 0 .
Although there are formulae to give explicit roots for a third orderpolynomial in terms of its coefficients, we are taking a shortcut here byguessing one root 𝜆1 = −1.
I We can check that 𝜆1 = −1 is indeed a root by verifying𝐹 (−1) = (−1)3 − 3(−1)2 + 4 = 0.
To find the remaining roots, we first factorise 𝐹 (𝜆) by performing a long
division:
Ioan Despi – AMTH140 7 of 15
Example 2
Example
Find the general solution of
𝑎𝑛+3 − 3𝑎𝑛+2 + 4𝑎𝑛 = 0 , 𝑛 ≥ 0
Solution.
The associated characteristic equation is 𝐹 (𝜆)def= 𝜆3 − 3𝜆2 + 4 = 0 .
Although there are formulae to give explicit roots for a third orderpolynomial in terms of its coefficients, we are taking a shortcut here byguessing one root 𝜆1 = −1.
I We can check that 𝜆1 = −1 is indeed a root by verifying𝐹 (−1) = (−1)3 − 3(−1)2 + 4 = 0.
To find the remaining roots, we first factorise 𝐹 (𝜆) by performing a long
division:
Ioan Despi – AMTH140 7 of 15
Example 2
Example
Find the general solution of
𝑎𝑛+3 − 3𝑎𝑛+2 + 4𝑎𝑛 = 0 , 𝑛 ≥ 0
Solution.
The associated characteristic equation is 𝐹 (𝜆)def= 𝜆3 − 3𝜆2 + 4 = 0 .
Although there are formulae to give explicit roots for a third orderpolynomial in terms of its coefficients, we are taking a shortcut here byguessing one root 𝜆1 = −1.
I We can check that 𝜆1 = −1 is indeed a root by verifying𝐹 (−1) = (−1)3 − 3(−1)2 + 4 = 0.
To find the remaining roots, we first factorise 𝐹 (𝜆) by performing a long
division:
Ioan Despi – AMTH140 7 of 15
Example 2
Example
Find the general solution of
𝑎𝑛+3 − 3𝑎𝑛+2 + 4𝑎𝑛 = 0 , 𝑛 ≥ 0
Solution.
The associated characteristic equation is 𝐹 (𝜆)def= 𝜆3 − 3𝜆2 + 4 = 0 .
Although there are formulae to give explicit roots for a third orderpolynomial in terms of its coefficients, we are taking a shortcut here byguessing one root 𝜆1 = −1.
I We can check that 𝜆1 = −1 is indeed a root by verifying𝐹 (−1) = (−1)3 − 3(−1)2 + 4 = 0.
To find the remaining roots, we first factorise 𝐹 (𝜆) by performing a long
division:
Ioan Despi – AMTH140 7 of 15
Example 2
𝜆2 −4𝜆 +4
⎠𝜆 + 1 𝜆3 −3𝜆2 +4
𝜆3 + 𝜆2
−4𝜆2 0−4𝜆2 −4𝜆
4𝜆 +44𝜆 +4
0
which implies 𝜆3 − 3𝜆2 + 4 = (𝜆 + 1)(𝜆2 − 4𝜆 + 4) = (𝜆 + 1)(𝜆− 2)2.
Therefore all the roots, counting the corresponding multiplicity, are−1 , 2 , 2, i.e. 𝜆1 = −1, 𝑚1 = 1 and 𝜆2 = 2, 𝑚2 = 2.
Hence the general solution reads (with 𝐴 = 𝐴1,0, 𝐵 = 𝐴2,0, 𝐶 = 𝐴2,1)
𝑎𝑛 = 𝐴(−1)𝑛 + (𝐵 + 𝐶𝑛)2𝑛 , 𝑛 ≥ 0 .
Ioan Despi – AMTH140 8 of 15
Example 2
𝜆2 −4𝜆 +4
⎠𝜆 + 1 𝜆3 −3𝜆2 +4
𝜆3 + 𝜆2
−4𝜆2 0−4𝜆2 −4𝜆
4𝜆 +44𝜆 +4
0
which implies 𝜆3 − 3𝜆2 + 4 = (𝜆 + 1)(𝜆2 − 4𝜆 + 4) = (𝜆 + 1)(𝜆− 2)2.Therefore all the roots, counting the corresponding multiplicity, are−1 , 2 , 2, i.e. 𝜆1 = −1, 𝑚1 = 1 and 𝜆2 = 2, 𝑚2 = 2.
Hence the general solution reads (with 𝐴 = 𝐴1,0, 𝐵 = 𝐴2,0, 𝐶 = 𝐴2,1)
𝑎𝑛 = 𝐴(−1)𝑛 + (𝐵 + 𝐶𝑛)2𝑛 , 𝑛 ≥ 0 .
Ioan Despi – AMTH140 8 of 15
Example 2
𝜆2 −4𝜆 +4
⎠𝜆 + 1 𝜆3 −3𝜆2 +4
𝜆3 + 𝜆2
−4𝜆2 0−4𝜆2 −4𝜆
4𝜆 +44𝜆 +4
0
which implies 𝜆3 − 3𝜆2 + 4 = (𝜆 + 1)(𝜆2 − 4𝜆 + 4) = (𝜆 + 1)(𝜆− 2)2.Therefore all the roots, counting the corresponding multiplicity, are−1 , 2 , 2, i.e. 𝜆1 = −1, 𝑚1 = 1 and 𝜆2 = 2, 𝑚2 = 2.
Hence the general solution reads (with 𝐴 = 𝐴1,0, 𝐵 = 𝐴2,0, 𝐶 = 𝐴2,1)
𝑎𝑛 = 𝐴(−1)𝑛 + (𝐵 + 𝐶𝑛)2𝑛 , 𝑛 ≥ 0 .
Ioan Despi – AMTH140 8 of 15
Example 3
Example
Find the particular solution of
𝑢𝑛+3 + 3𝑢𝑛+2 + 3𝑢𝑛+1 + 𝑢𝑛 = 0 , 𝑛 ≥ 0
satisfying the initial conditions 𝑢0 = 1, 𝑢1 = 1 and 𝑢2 = −7.
Solution.
(a) The associated characteristic equation 𝜆3 + 3𝜆2 + 3𝜆+ 1 ≡ (𝜆+ 1)3 = 0 has
roots 𝜆1 = −1 with multiplicity 𝑚1 = 3.
(b) The general solution then reads for arbitrary constants 𝐴, 𝐵 and 𝐶
𝑢𝑛 = (𝐴+𝐵𝑛+ 𝐶𝑛2)(−1)𝑛 , 𝑛 ≥ 0
(c) To determine 𝐴,𝐵 and 𝐶 through the use of the initial conditions, we set 𝑛 inthe solution expression in (b) to 0, 1 and 2 respectively, then
𝑢0 gives 𝐴 = 1𝑢1 gives (𝐴+𝐵 + 𝐶)(−1) = 1𝑢2 gives 𝐴+ 2𝐵 + 4𝐶 = −7 .
The solution of these 3 equations, 𝐴 = 1, 𝐵 = 0, 𝐶 = −2. , finally produces
the required particular solution 𝑢𝑛 = (1− 2𝑛2)(−1)𝑛 , 𝑛 ≥ 0
Ioan Despi – AMTH140 9 of 15
Example 3
Example
Find the particular solution of
𝑢𝑛+3 + 3𝑢𝑛+2 + 3𝑢𝑛+1 + 𝑢𝑛 = 0 , 𝑛 ≥ 0
satisfying the initial conditions 𝑢0 = 1, 𝑢1 = 1 and 𝑢2 = −7.
Solution.
(a) The associated characteristic equation 𝜆3 + 3𝜆2 + 3𝜆+ 1 ≡ (𝜆+ 1)3 = 0 has
roots 𝜆1 = −1 with multiplicity 𝑚1 = 3.
(b) The general solution then reads for arbitrary constants 𝐴, 𝐵 and 𝐶
𝑢𝑛 = (𝐴+𝐵𝑛+ 𝐶𝑛2)(−1)𝑛 , 𝑛 ≥ 0
(c) To determine 𝐴,𝐵 and 𝐶 through the use of the initial conditions, we set 𝑛 inthe solution expression in (b) to 0, 1 and 2 respectively, then
𝑢0 gives 𝐴 = 1𝑢1 gives (𝐴+𝐵 + 𝐶)(−1) = 1𝑢2 gives 𝐴+ 2𝐵 + 4𝐶 = −7 .
The solution of these 3 equations, 𝐴 = 1, 𝐵 = 0, 𝐶 = −2. , finally produces
the required particular solution 𝑢𝑛 = (1− 2𝑛2)(−1)𝑛 , 𝑛 ≥ 0
Ioan Despi – AMTH140 9 of 15
Example 3
Example
Find the particular solution of
𝑢𝑛+3 + 3𝑢𝑛+2 + 3𝑢𝑛+1 + 𝑢𝑛 = 0 , 𝑛 ≥ 0
satisfying the initial conditions 𝑢0 = 1, 𝑢1 = 1 and 𝑢2 = −7.
Solution.
(a) The associated characteristic equation 𝜆3 + 3𝜆2 + 3𝜆+ 1 ≡ (𝜆+ 1)3 = 0 has
roots 𝜆1 = −1 with multiplicity 𝑚1 = 3.
(b) The general solution then reads for arbitrary constants 𝐴, 𝐵 and 𝐶
𝑢𝑛 = (𝐴+𝐵𝑛+ 𝐶𝑛2)(−1)𝑛 , 𝑛 ≥ 0
(c) To determine 𝐴,𝐵 and 𝐶 through the use of the initial conditions, we set 𝑛 inthe solution expression in (b) to 0, 1 and 2 respectively, then
𝑢0 gives 𝐴 = 1𝑢1 gives (𝐴+𝐵 + 𝐶)(−1) = 1𝑢2 gives 𝐴+ 2𝐵 + 4𝐶 = −7 .
The solution of these 3 equations, 𝐴 = 1, 𝐵 = 0, 𝐶 = −2. , finally produces
the required particular solution 𝑢𝑛 = (1− 2𝑛2)(−1)𝑛 , 𝑛 ≥ 0
Ioan Despi – AMTH140 9 of 15
Example 3
Example
Find the particular solution of
𝑢𝑛+3 + 3𝑢𝑛+2 + 3𝑢𝑛+1 + 𝑢𝑛 = 0 , 𝑛 ≥ 0
satisfying the initial conditions 𝑢0 = 1, 𝑢1 = 1 and 𝑢2 = −7.
Solution.
(a) The associated characteristic equation 𝜆3 + 3𝜆2 + 3𝜆+ 1 ≡ (𝜆+ 1)3 = 0 has
roots 𝜆1 = −1 with multiplicity 𝑚1 = 3.
(b) The general solution then reads for arbitrary constants 𝐴, 𝐵 and 𝐶
𝑢𝑛 = (𝐴+𝐵𝑛+ 𝐶𝑛2)(−1)𝑛 , 𝑛 ≥ 0
(c) To determine 𝐴,𝐵 and 𝐶 through the use of the initial conditions, we set 𝑛 inthe solution expression in (b) to 0, 1 and 2 respectively, then
𝑢0 gives 𝐴 = 1𝑢1 gives (𝐴+𝐵 + 𝐶)(−1) = 1𝑢2 gives 𝐴+ 2𝐵 + 4𝐶 = −7 .
The solution of these 3 equations, 𝐴 = 1, 𝐵 = 0, 𝐶 = −2. , finally produces
the required particular solution 𝑢𝑛 = (1− 2𝑛2)(−1)𝑛 , 𝑛 ≥ 0Ioan Despi – AMTH140 9 of 15
General Procedure
The general process for solving linear homogeneous recurrence relations withconstant coefficients is like this:
1 Find the characteristic equation.
2 Find the characteristic roots.
3 Find the general solution.
4 Use the initial conditions to find the specific solution.
Ioan Despi – AMTH140 10 of 15
General Procedure
The general process for solving linear homogeneous recurrence relations withconstant coefficients is like this:
1 Find the characteristic equation.
2 Find the characteristic roots.
3 Find the general solution.
4 Use the initial conditions to find the specific solution.
Ioan Despi – AMTH140 10 of 15
General Procedure
The general process for solving linear homogeneous recurrence relations withconstant coefficients is like this:
1 Find the characteristic equation.
2 Find the characteristic roots.
3 Find the general solution.
4 Use the initial conditions to find the specific solution.
Ioan Despi – AMTH140 10 of 15
General Procedure
The general process for solving linear homogeneous recurrence relations withconstant coefficients is like this:
1 Find the characteristic equation.
2 Find the characteristic roots.
3 Find the general solution.
4 Use the initial conditions to find the specific solution.
Ioan Despi – AMTH140 10 of 15
More Examples
Example
Solve the following (shifted Fibonacci) recurrence relation:
𝑓𝑛 = 𝑓𝑛−1 + 𝑓𝑛−2, 𝑓0 = 0, and 𝑓1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 𝜆− 1 = 0
2 The roots are 𝜆1 = 1+√5
2 and 𝜆2 = 1−√5
2
3 The general solution is 𝑓𝑛 = 𝐴(︁
1+√5
2
)︁𝑛
+ 𝐵(︁
1−√5
2
)︁𝑛
4 Use the initial conditions to find the specific solution
𝑓𝑛 = 1√5
(︁1+
√5
2
)︁𝑛
− 1√5
(︁1−
√5
2
)︁𝑛
Ioan Despi – AMTH140 11 of 15
More Examples
Example
Solve the following (shifted Fibonacci) recurrence relation:
𝑓𝑛 = 𝑓𝑛−1 + 𝑓𝑛−2, 𝑓0 = 0, and 𝑓1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 𝜆− 1 = 0
2 The roots are 𝜆1 = 1+√5
2 and 𝜆2 = 1−√5
2
3 The general solution is 𝑓𝑛 = 𝐴(︁
1+√5
2
)︁𝑛
+ 𝐵(︁
1−√5
2
)︁𝑛
4 Use the initial conditions to find the specific solution
𝑓𝑛 = 1√5
(︁1+
√5
2
)︁𝑛
− 1√5
(︁1−
√5
2
)︁𝑛
Ioan Despi – AMTH140 11 of 15
More Examples
Example
Solve the following (shifted Fibonacci) recurrence relation:
𝑓𝑛 = 𝑓𝑛−1 + 𝑓𝑛−2, 𝑓0 = 0, and 𝑓1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 𝜆− 1 = 0
2 The roots are 𝜆1 = 1+√5
2 and 𝜆2 = 1−√5
2
3 The general solution is 𝑓𝑛 = 𝐴(︁
1+√5
2
)︁𝑛
+ 𝐵(︁
1−√5
2
)︁𝑛
4 Use the initial conditions to find the specific solution
𝑓𝑛 = 1√5
(︁1+
√5
2
)︁𝑛
− 1√5
(︁1−
√5
2
)︁𝑛
Ioan Despi – AMTH140 11 of 15
More Examples
Example
Solve the following (shifted Fibonacci) recurrence relation:
𝑓𝑛 = 𝑓𝑛−1 + 𝑓𝑛−2, 𝑓0 = 0, and 𝑓1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 𝜆− 1 = 0
2 The roots are 𝜆1 = 1+√5
2 and 𝜆2 = 1−√5
2
3 The general solution is 𝑓𝑛 = 𝐴(︁
1+√5
2
)︁𝑛
+ 𝐵(︁
1−√5
2
)︁𝑛
4 Use the initial conditions to find the specific solution
𝑓𝑛 = 1√5
(︁1+
√5
2
)︁𝑛
− 1√5
(︁1−
√5
2
)︁𝑛
Ioan Despi – AMTH140 11 of 15
More Examples
Example
Solve the following (shifted Fibonacci) recurrence relation:
𝑓𝑛 = 𝑓𝑛−1 + 𝑓𝑛−2, 𝑓0 = 0, and 𝑓1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 𝜆− 1 = 0
2 The roots are 𝜆1 = 1+√5
2 and 𝜆2 = 1−√5
2
3 The general solution is 𝑓𝑛 = 𝐴(︁
1+√5
2
)︁𝑛
+ 𝐵(︁
1−√5
2
)︁𝑛
4 Use the initial conditions to find the specific solution
𝑓𝑛 = 1√5
(︁1+
√5
2
)︁𝑛
− 1√5
(︁1−
√5
2
)︁𝑛
Ioan Despi – AMTH140 11 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 2(𝑎𝑛−1 − 𝑎𝑛−2)
with initial conditions 𝑎0 = 𝑎1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 2𝜆 + 2 = 0
2 The roots are 𝜆1 = 1 + 𝑖 and 𝜆2 = 1 − 𝑖.
3 The general solution is 𝑎𝑛 = 𝐴 (1 + 𝑖)𝑛
+ 𝐵 (1 − 𝑖)𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 1/2, 𝐵 = 1/2,i.e., 𝑎𝑛 = 1
2 (1 + 𝑖)𝑛
+ 12 (1 − 𝑖)
𝑛
Ioan Despi – AMTH140 12 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 2(𝑎𝑛−1 − 𝑎𝑛−2)
with initial conditions 𝑎0 = 𝑎1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 2𝜆 + 2 = 0
2 The roots are 𝜆1 = 1 + 𝑖 and 𝜆2 = 1 − 𝑖.
3 The general solution is 𝑎𝑛 = 𝐴 (1 + 𝑖)𝑛
+ 𝐵 (1 − 𝑖)𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 1/2, 𝐵 = 1/2,i.e., 𝑎𝑛 = 1
2 (1 + 𝑖)𝑛
+ 12 (1 − 𝑖)
𝑛
Ioan Despi – AMTH140 12 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 2(𝑎𝑛−1 − 𝑎𝑛−2)
with initial conditions 𝑎0 = 𝑎1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 2𝜆 + 2 = 0
2 The roots are 𝜆1 = 1 + 𝑖 and 𝜆2 = 1 − 𝑖.
3 The general solution is 𝑎𝑛 = 𝐴 (1 + 𝑖)𝑛
+ 𝐵 (1 − 𝑖)𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 1/2, 𝐵 = 1/2,i.e., 𝑎𝑛 = 1
2 (1 + 𝑖)𝑛
+ 12 (1 − 𝑖)
𝑛
Ioan Despi – AMTH140 12 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 2(𝑎𝑛−1 − 𝑎𝑛−2)
with initial conditions 𝑎0 = 𝑎1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 2𝜆 + 2 = 0
2 The roots are 𝜆1 = 1 + 𝑖 and 𝜆2 = 1 − 𝑖.
3 The general solution is 𝑎𝑛 = 𝐴 (1 + 𝑖)𝑛
+ 𝐵 (1 − 𝑖)𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 1/2, 𝐵 = 1/2,i.e., 𝑎𝑛 = 1
2 (1 + 𝑖)𝑛
+ 12 (1 − 𝑖)
𝑛
Ioan Despi – AMTH140 12 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 2(𝑎𝑛−1 − 𝑎𝑛−2)
with initial conditions 𝑎0 = 𝑎1 = 1
Solution.
1 The characteristic equation is 𝜆2 − 2𝜆 + 2 = 0
2 The roots are 𝜆1 = 1 + 𝑖 and 𝜆2 = 1 − 𝑖.
3 The general solution is 𝑎𝑛 = 𝐴 (1 + 𝑖)𝑛
+ 𝐵 (1 − 𝑖)𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 1/2, 𝐵 = 1/2,i.e., 𝑎𝑛 = 1
2 (1 + 𝑖)𝑛
+ 12 (1 − 𝑖)
𝑛
Ioan Despi – AMTH140 12 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 6𝑎𝑛−1 − 9𝑎𝑛−2
with initial conditions 𝑎0 = 3 and 𝑎1 = 10
Solution.
1 The characteristic equation is 𝜆2 − 6𝜆 + 9 = 0
2 The roots for (𝜆− 3)2 = 0 are 𝜆1 = 𝜆2 = 3, so 𝑚1 = 2.
3 The general solution is 𝑎𝑛 = (𝐴 + 𝐵𝑛)3𝑛
4 Use the initial conditions to find the specific solution𝑎𝑛 =
(︀3 + 1
3𝑛)︀
3𝑛 = 3𝑛+1 + 𝑛3𝑛−1
Ioan Despi – AMTH140 13 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 6𝑎𝑛−1 − 9𝑎𝑛−2
with initial conditions 𝑎0 = 3 and 𝑎1 = 10
Solution.
1 The characteristic equation is 𝜆2 − 6𝜆 + 9 = 0
2 The roots for (𝜆− 3)2 = 0 are 𝜆1 = 𝜆2 = 3, so 𝑚1 = 2.
3 The general solution is 𝑎𝑛 = (𝐴 + 𝐵𝑛)3𝑛
4 Use the initial conditions to find the specific solution𝑎𝑛 =
(︀3 + 1
3𝑛)︀
3𝑛 = 3𝑛+1 + 𝑛3𝑛−1
Ioan Despi – AMTH140 13 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 6𝑎𝑛−1 − 9𝑎𝑛−2
with initial conditions 𝑎0 = 3 and 𝑎1 = 10
Solution.
1 The characteristic equation is 𝜆2 − 6𝜆 + 9 = 0
2 The roots for (𝜆− 3)2 = 0 are 𝜆1 = 𝜆2 = 3, so 𝑚1 = 2.
3 The general solution is 𝑎𝑛 = (𝐴 + 𝐵𝑛)3𝑛
4 Use the initial conditions to find the specific solution𝑎𝑛 =
(︀3 + 1
3𝑛)︀
3𝑛 = 3𝑛+1 + 𝑛3𝑛−1
Ioan Despi – AMTH140 13 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 6𝑎𝑛−1 − 9𝑎𝑛−2
with initial conditions 𝑎0 = 3 and 𝑎1 = 10
Solution.
1 The characteristic equation is 𝜆2 − 6𝜆 + 9 = 0
2 The roots for (𝜆− 3)2 = 0 are 𝜆1 = 𝜆2 = 3, so 𝑚1 = 2.
3 The general solution is 𝑎𝑛 = (𝐴 + 𝐵𝑛)3𝑛
4 Use the initial conditions to find the specific solution𝑎𝑛 =
(︀3 + 1
3𝑛)︀
3𝑛 = 3𝑛+1 + 𝑛3𝑛−1
Ioan Despi – AMTH140 13 of 15
More Examples
Example
Solve the following recurrence relation:
𝑎𝑛 = 6𝑎𝑛−1 − 9𝑎𝑛−2
with initial conditions 𝑎0 = 3 and 𝑎1 = 10
Solution.
1 The characteristic equation is 𝜆2 − 6𝜆 + 9 = 0
2 The roots for (𝜆− 3)2 = 0 are 𝜆1 = 𝜆2 = 3, so 𝑚1 = 2.
3 The general solution is 𝑎𝑛 = (𝐴 + 𝐵𝑛)3𝑛
4 Use the initial conditions to find the specific solution𝑎𝑛 =
(︀3 + 1
3𝑛)︀
3𝑛 = 3𝑛+1 + 𝑛3𝑛−1
Ioan Despi – AMTH140 13 of 15
More Examples
Example
Solve the following recurrence relation:
2𝑎𝑛+3 = 𝑎𝑛+2 + 2𝑎𝑛+1 − 𝑎𝑛
with initial conditions 𝑎0 = 0, 𝑎1 = 1 and 𝑎2 = 2
Solution.
1 The characteristic equation is 2𝜆3 − 𝜆2 − 2𝜆 + 1 = 0
2 The roots are 𝜆1 = 1, 𝜆2 = −1, 𝜆3 = 1/2
3 The general solution is 𝑎𝑛 = 𝐴(1)𝑛 + 𝐵(−1)𝑛 + 𝐶( 12 )𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 5/2, 𝐵 = 1/6,𝐶 = −8/3, so 𝑎𝑛 = 5
2 + 16 (−1)𝑛 − 8
3 ( 12 )𝑛
Ioan Despi – AMTH140 14 of 15
More Examples
Example
Solve the following recurrence relation:
2𝑎𝑛+3 = 𝑎𝑛+2 + 2𝑎𝑛+1 − 𝑎𝑛
with initial conditions 𝑎0 = 0, 𝑎1 = 1 and 𝑎2 = 2
Solution.
1 The characteristic equation is 2𝜆3 − 𝜆2 − 2𝜆 + 1 = 0
2 The roots are 𝜆1 = 1, 𝜆2 = −1, 𝜆3 = 1/2
3 The general solution is 𝑎𝑛 = 𝐴(1)𝑛 + 𝐵(−1)𝑛 + 𝐶( 12 )𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 5/2, 𝐵 = 1/6,𝐶 = −8/3, so 𝑎𝑛 = 5
2 + 16 (−1)𝑛 − 8
3 ( 12 )𝑛
Ioan Despi – AMTH140 14 of 15
More Examples
Example
Solve the following recurrence relation:
2𝑎𝑛+3 = 𝑎𝑛+2 + 2𝑎𝑛+1 − 𝑎𝑛
with initial conditions 𝑎0 = 0, 𝑎1 = 1 and 𝑎2 = 2
Solution.
1 The characteristic equation is 2𝜆3 − 𝜆2 − 2𝜆 + 1 = 0
2 The roots are 𝜆1 = 1, 𝜆2 = −1, 𝜆3 = 1/2
3 The general solution is 𝑎𝑛 = 𝐴(1)𝑛 + 𝐵(−1)𝑛 + 𝐶( 12 )𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 5/2, 𝐵 = 1/6,𝐶 = −8/3, so 𝑎𝑛 = 5
2 + 16 (−1)𝑛 − 8
3 ( 12 )𝑛
Ioan Despi – AMTH140 14 of 15
More Examples
Example
Solve the following recurrence relation:
2𝑎𝑛+3 = 𝑎𝑛+2 + 2𝑎𝑛+1 − 𝑎𝑛
with initial conditions 𝑎0 = 0, 𝑎1 = 1 and 𝑎2 = 2
Solution.
1 The characteristic equation is 2𝜆3 − 𝜆2 − 2𝜆 + 1 = 0
2 The roots are 𝜆1 = 1, 𝜆2 = −1, 𝜆3 = 1/2
3 The general solution is 𝑎𝑛 = 𝐴(1)𝑛 + 𝐵(−1)𝑛 + 𝐶( 12 )𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 5/2, 𝐵 = 1/6,𝐶 = −8/3, so 𝑎𝑛 = 5
2 + 16 (−1)𝑛 − 8
3 ( 12 )𝑛
Ioan Despi – AMTH140 14 of 15
More Examples
Example
Solve the following recurrence relation:
2𝑎𝑛+3 = 𝑎𝑛+2 + 2𝑎𝑛+1 − 𝑎𝑛
with initial conditions 𝑎0 = 0, 𝑎1 = 1 and 𝑎2 = 2
Solution.
1 The characteristic equation is 2𝜆3 − 𝜆2 − 2𝜆 + 1 = 0
2 The roots are 𝜆1 = 1, 𝜆2 = −1, 𝜆3 = 1/2
3 The general solution is 𝑎𝑛 = 𝐴(1)𝑛 + 𝐵(−1)𝑛 + 𝐶( 12 )𝑛
4 Use the initial conditions to find the specific solution 𝐴 = 5/2, 𝐵 = 1/6,𝐶 = −8/3, so 𝑎𝑛 = 5
2 + 16 (−1)𝑛 − 8
3 ( 12 )𝑛
Ioan Despi – AMTH140 14 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15
More Examples
Example
How many binary strings (strings of ’0’s and ’1’s) of 𝑛 bits have no twoconsecutive zeros?
Solution.
Let 𝑎𝑛 be the number of such strings.
Clearly, 𝑎0 = 0, 𝑎1 = 2, and 𝑎2 = 3.
An 𝑛 bit such string
I begins with (1 , and ends with any 𝑛− 1 bit string, or
I begins with (0, 1 , and ends with any 𝑛− 2 bit string.
So 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 .
The characteristic equation is 𝜆2 − 𝜆− 1, etc.
Ioan Despi – AMTH140 15 of 15