You are on page 1of 17

BITS Pilani

Pilani Campus

MATH F213
Linear Recurrence Relations
System of recurrence relations

We may have several sequences defined by the mixed


recurrence relations, for example for two sequences we
may consider recurrence relations; for 𝑛 ≥ 𝑘,
𝑎𝑛 = 𝑓(𝑎0 , 𝑏0 , … , 𝑎𝑛−1 , 𝑏𝑛−1 )
𝑏𝑛 = 𝑔 𝑎0 , 𝑏0 , … , 𝑎𝑛−1 , 𝑏𝑛−1 ,
Given some initial values 𝑎0 , 𝑏0 ,…, 𝑎𝑘−1 , 𝑏𝑘−1 the
sequences 𝑎𝑛 , 𝑏𝑛 are uniquely determined.
In many situations, the problem may be reduced to solving
such system. We illustrate this by a problem.

BITS Pilani, Pilani Campus


p. 326 #20

3 2
Let 𝐴 = . For 𝑛 ≥ 0, solve for the entries of 𝐴𝑛 using
1 4
recurrence relations.
𝑛 𝑎𝑛 𝑏𝑛
Solution : Let 𝐴 = . Now 𝐴𝑛 = A𝐴𝑛−1 gives
𝑐𝑛 𝑑𝑛
𝑎𝑛 𝑏𝑛 3𝑎𝑛−1 + 2𝑐𝑛−1 3𝑏𝑛−1 + 2𝑑𝑛−1
= .
𝑐𝑛 𝑑𝑛 𝑎𝑛−1 + 4𝑐𝑛−1 𝑏𝑛−1 + 4𝑑𝑛−1
This gives a system of 4 recurrence relations for 4
sequences, by comparing (i,j)th entries.

BITS Pilani, Pilani Campus


Now comparing (1,2)th term,
𝑐𝑛 = 𝑎𝑛−1 + 4𝑐𝑛−1 implies 𝑎𝑛−1 = 𝑐𝑛 − 4𝑐𝑛−1 . -----(i)
Shifting 𝑛 to 𝑛 + 1, 𝑎𝑛 = 𝑐𝑛+1 − 4𝑐𝑛 .-----------(ii)
Substituting (i) and (ii) in the equatio𝑛 𝑎𝑛 = 3𝑎𝑛−1 + 2𝑐𝑛−1
obtained by comparing (1,1)th term,
𝑐𝑛+1 − 7𝑐𝑛 + 10𝑐𝑛−1 = 0. ---------------(*)
Similarly 𝑑𝑛+1 − 7𝑑𝑛 + 10𝑑𝑛−1 = 0.----------------(**)
Using the initial conditions 𝑐0 = 0, 𝑐1 = 1 with (*), we get
5𝑛 −2𝑛
𝑐𝑛 = .
3

BITS Pilani, Pilani Campus


The initial conditions 𝑑0 = 1, 𝑑1 = 4 with (**) gives

2 5𝑛 + 2𝑛
𝑑𝑛 = .
3
5𝑛 +2 2𝑛
Now (ii) gives 𝑎𝑛 = ,n ≥ 1.
3
2 5𝑛 −2 2𝑛
Similarly 𝑏𝑛 = .
3

BITS Pilani, Pilani Campus


Non-linear Recurrence
Relations
Many non-linear recurrence relations can be reduced to
linear recurrence relations by a transformation. There
can be a combination of two types of transformations :
• transformation of subscripts m = 𝑔 𝑛 . This is analogous
to change in independent variable in a differential
equation.
• transformation of the type 𝑏𝑛 = 𝑓(𝑎𝑛 ). This is analogous
to change in dependent variable in a differential
equation.
• We will illustrate this via some examples representing
important cases.

BITS Pilani, Pilani Campus


Mergesort algorithm

We have already seen that the number of comparisons


required to sort (i.e. arrange in non—decreasing order) a
list of 𝑛 = 2𝑘 real numbers is given by the recurrence
relation :
𝑎𝑛 = 2𝑎𝑛/2 + n − 1 , n ≥ 2; 𝑎1 = 0.

How to find an explicit formula for 𝑎𝑛 ?


We have found a formula by substitution method.
It can also be transformed to linear recurrence relation.

BITS Pilani, Pilani Campus


Consider the transformation 𝑘 = log 2 𝑛.
Let for 𝑛 = 2𝑘 , 𝑎𝑛 = 𝑏𝑘 . Then the recurrence relation
becomes 𝑏𝑘 − 2𝑏𝑘−1 = 2𝑘 − 1 , k ≥ 1; 𝑏0 = 0.
This is a an IHR of degree 1 with constant coefficients.
The general solution of the related HR is 𝑏𝑘𝐻 = 𝐶2𝑘 , 𝐶
arbitrary constant.
To find a particular solution 𝑏𝑘𝑃 of the IHR, by superposition
𝑃 𝑃 𝑃 𝑃
principle, 𝑏𝑘𝑃 = 𝑏𝑘1 − 𝑏𝑘2 where 𝑏𝑘1 , 𝑏𝑘2 are particular
solutions to IHR with RHS= 2𝑘 , 1 respectively.
Thus, general soln of IHR is 𝑏𝑘𝐺 = 𝐶2𝑘 + 𝑘2𝑘 + 1.
Initial condition 𝑏0 = 0 gives 𝐶 = −1.
Reverse transformation gives 𝑎𝑛 = 𝑛 log 2 𝑛 − 𝑛 − 1 .
BITS Pilani, Pilani Campus
Divide and conquer
recurrence relation.
These relations occur in solving problems about groups by
dividing the group into fixed number of groups of a fixed
size, repeatedly. One particular type is
𝑎𝑛 = 𝐶𝑎𝑛/𝑑 + 𝑓(𝑛) for a constant 𝐶 and a fixed positive
integer 𝑑, where 𝑛 takes values 𝑑𝑘 for non-negative
integers 𝑘.
By the substitution 𝑘 = log 𝑑 𝑛 , the relation becomes linear
IHR.

BITS Pilani, Pilani Campus


p. 325 #12
Solve the divide and conquer relation by transforming to IHR
for equation 𝑎𝑛 = 𝑑𝑎𝑛/𝑑 + 𝑒 where 𝑛 = 𝑑𝑘 , 𝑑 > 1. (given in
#8 on p. 298)
Solution : Consider the transformation 𝑘 = log 𝑑 𝑛 .
As 𝑛 = 𝑑𝑘 , 𝑛Τ𝑑 = 𝑑 𝑘−1 .
Letting 𝑏𝑘 = 𝑎𝑑𝑘 , the recurrence relation transforms to the IHR
𝑏𝑘 − 𝑑𝑏𝑘−1 = 𝑒.
Since 𝐶 1 = 1 − 𝑑 ≠ 0, a particular solution has form
𝑏𝑘𝑃 = 𝐵, constant to be determined.
The corresponding HR has general form 𝑏𝑘𝐻 = 𝐴𝑑 𝑘 .
The solution of original recurrence, by inverse transform,
becomes 𝑎𝑛 = 𝐴𝑛 + 𝐵, for constants 𝐴, 𝐵.
BITS Pilani, Pilani Campus
2nd type of transformation
We can convert non-linear recurrence relations to linear
recurrence relations by transformation 𝑏𝑛 = 𝑓(𝑎𝑛 ).
2
Ex. 3.6.15: Solve the recurrence relation 𝑎𝑛2 − 2𝑎𝑛−1 = 1, 𝑛 ≥
1; 𝑎0 = 2.
Solution : Let 𝑏𝑛 = 𝑎𝑛2 for 𝑛 ≥ 0. Then the relation becomes 𝑏𝑛 −
2𝑏𝑛−1 = 1, 𝑛 ≥ 1; 𝑏0 = 4.
This is an IHR. Solving by method of undetermined coefficients
we get 𝑏𝑛 = 5 2𝑛 − 1; 𝑛 ≥ 0.
From this we can find one solution by reverse transformation
𝑎𝑛 = 5 2𝑛 − 1; 𝑛 ≥ 0. (Proceed for Initial Value Problem)
Remark (Error in book) : Here solution to original recurrence
relation is not unique. The initial condition forces the sign of
square root for 𝑎0 to be positive, but for others it can be
arbitrarily chosen.
BITS Pilani, Pilani Campus
p. 325 #18
Solve by transforming to linear recurrence relation with
constant coefficients.
(d) 𝑎𝑛 + 𝑛𝑎𝑛−1 = 𝑛!, 𝑛 ≥ 1; 𝑎0 = 2.
Solution : Dividing by 𝑛!, rewrite the given relation as
𝑎𝑛 𝑎𝑛−1
+ = 1, 𝑛 ≥ 1.
𝑛! 𝑛−1 !
𝑎𝑛
The transformation 𝑏𝑛 = converts it to IHR
𝑛!
𝑏𝑛 + 𝑏𝑛−1 = 1, 𝑛 ≥ 1; 𝑏0 = 2.
Method of undetermined coefficients gives the solution
3 1
𝑏𝑛 = (−1)𝑛 + , 𝑛 ≥ 0 of the IHR. (Verify!)
2 2
3 1
Transforming back, 𝑎𝑛 = 𝑛! (−1)𝑛 + , 𝑛 ≥ 0.
2 2
BITS Pilani, Pilani Campus
P 325 #18

√𝑎𝑛−1
(e) 𝑎𝑛 = 2 ,𝑛 ≥ 2 with 𝑎0 = 1, 𝑎1 = 2.
𝑎𝑛−2
Taking ln of both sides,
1
ln 𝑎𝑛 = ln 𝑎𝑛−1 − 2 ln 𝑎𝑛−2 .
2
Let 𝑏𝑛 = ln 𝑎𝑛 , 𝑛 ≥ 0. Then recurrence relation transforms
1
to HR 𝑏𝑛 − 𝑏𝑛−1 + 2𝑏𝑛−2 = 0, 𝑏0 = 0, 𝑏1 = ln 2 .
2
Solve this and then use reverse transform 𝑎𝑛 = 𝑒 𝑏𝑛 .

BITS Pilani, Pilani Campus


P 325 #18

(h) 𝑛𝑎𝑛 − 𝑛 − 2 𝑎𝑛−1 = 2𝑛; 𝑎0 = 5.


Multiply both sides by 𝑛 − 1 ,
𝑛 𝑛 − 1 𝑎𝑛 − 𝑛 − 1 𝑛 − 2 𝑎𝑛−1 = 2𝑛 𝑛 − 1 , 𝑛 ≥ 1------(*)
The transformation 𝑏𝑛 = 𝑛 𝑛 − 1 𝑎𝑛 will convert it to IHR
but the transformation is not reversible (for n=0,1).
To avoid this problem first from original relation, 𝑎1 = −3.
Now consider the transformation 𝑏𝑛 = 𝑛 + 1 𝑛𝑎𝑛+1 . Then
(*) implies 𝑏𝑛 − 𝑏𝑛−1 = 2𝑛 𝑛 + 1 , 𝑛 ≥ 1 with 𝑏0 = 0.
Solving this relation, we use reverse transform
𝑏𝑛
𝑎𝑛+1 = to get 𝑎𝑛 , 𝑛 ≥ 1. (Note :𝑎0 = 5, 𝑎1 = −3 are
𝑛(𝑛+1)
already known).
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus

You might also like