0% found this document useful (0 votes)
131 views

UNIT2

The document discusses recurrence relations. It defines key terms like sequence, recurrence relation, linear and non-linear recurrence relations, homogeneous and non-homogeneous recurrence relations, and solutions of recurrence relations. It provides examples of different types of recurrence relations and methods to solve them. Specific methods discussed include finding the characteristic equation, roots of the characteristic equation, and using those roots to write the solution. It also discusses generating functions and difference operators as tools to solve recurrence relations.

Uploaded by

PRABHAT RANJAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views

UNIT2

The document discusses recurrence relations. It defines key terms like sequence, recurrence relation, linear and non-linear recurrence relations, homogeneous and non-homogeneous recurrence relations, and solutions of recurrence relations. It provides examples of different types of recurrence relations and methods to solve them. Specific methods discussed include finding the characteristic equation, roots of the characteristic equation, and using those roots to write the solution. It also discusses generating functions and difference operators as tools to solve recurrence relations.

Uploaded by

PRABHAT RANJAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 48

Unit-2: Recurrence Relation

1. Sequence
2. Recurrence Relation
3. Linear and Non-linear Recurrence Relation
4. Homogeneous and Non-homogeneous
Recurrence Relation
5. Solutions of Recurrence Relations
6. Generating Functions
Sequence: Any function which has the domain
natural number N that is called Sequence, that is
a: N →X.
The image of any element n in N is denoted by an
Recurrence Relation: Recurrence relation is the
relation between the sequence and its some
previous or some next terms.
Example 1: an = an-1 + 2an-3
Example 2: Fibonacci Numbers are defined by
an = an-1 + an-2 such that a0=0, a1,=1, n≥2.
Example 2: Recurrence Relation of Rabbit production is given by
an = an-1 + an-2 such that a1=1 = a2, n≥3.
Example 3: The puzzle Tower of Hanoi can be represented
in terms of recurrence relation: Hn =2 Hn-1+1, H1=1.
The solution of Hanoi tower is given by Hn =2n -1.
Linear Recurrence relation
A linear homogeneous recurrence relation of degree k with
constant coefficient is of the form
an = c1 an-1+ c2 an-2 +… ck an-k
Where c1, c2, … ck are real constants and ck ≠0.
A linear non-homogeneous recurrence relation of
degree k with constant coefficient is of the form
an = c1 an-1+ c2 an-2 +… ck an-k + F(n)
Where c1, c2, … ck are real constants with ck ≠0.
and F(n) denotes the function of variable n.
The degree in both cases= {Greatest value –Lowest value}=n-(n-k)=k
Note: Some times it is also taken as order by different
authors.
Examples
1. The degree of an =2 an-1 is 1.
2. The degree of an = an-3 is 3.
3. an =2 an-2 + n2 is non-homogeneous relation.
4. an =2 an-1 +1 is non-homogeneous relation.
5. an =2 (an-1)2 non-linear but homogeneous
relation.
6. an =2 (an-1)2+1 non-linear and non-
homogeneous relation.
Solution of Recurrence Relation
Any sequence an that satisfy the given recurrence
relation, is called solution of recurrence relation.
For solving the recurrence relation we put
an =rn and find the new equation called as characteristic
equation of the linear recurrence relation and given by
rk-ck-1 rk-1-…..-ck=0.
After solving above characteristics equation we get
the characteristics roots and with the help of
characteristics roots we can write the solution of
recurrence relation by using differential equation
methods.
Methods to write the solutions
1. Let r1 and r2 be two roots and r1 ≠ r2 then
solution of recurrence relation is given by
an=b1(r1)n+b2(r2)n,
b1 and b2 are arbitrary constants.
2. If roots are repeated r1= r2=r then solution is
an=(b1+b2n)(r)n
b1 and b2 are arbitrary constants.
Question: Solve the recurrence relation
an =-3 an-1 -3 an-2 – an-3 , a0 =1, a1 =-2, a2 =-1.
Solution: Let the recurrence relation is
an =-3 an-1 -3 an-2 – an-3
Putting an =rn we get
rn =-3 rn-1 -3 rn-2 – rn-3
Which implies by dividing rn-3
r3+3 r2+3r+1=0
Or we get (r+1)3 =0
Which gives the roots r=-1, r=-1, r=-1
Solution Continued…
Now the solution of recurrence relation is given by
an =(c1 + c2 n+ c3 n2)(-1)n …………………………………..(1)
where c1, c2 and c3 are arbitrary constants.

Using the condition a0 =1 we get c1 =1.


Again using a1 =-2 and a2=-1 we get
c2 + c3 =1 and c2+2c3 =-1

Solving above two equation we get


c2 =3 and c3 =-2.
Hence the solution is given by
an =(1+3n-2 n2)(-1)n.
Puzzle
Question: Find the solution of recurrence
relation an =6 an-1-9 an-2
Solution of Non-Homogeneous Recurrence
Relation
Let the linear non-homogeneous recurrence relation is
an = c1 an-1+ c2 an-2 +… ck an-k + F(n)
Then the homogeneous part is
an = c1 an-1+ c2 an-2 +… ck an-k
and the non-homogeneous part is F(n).
The solution linear non-homogeneous recurrence relation is
given by an =CF+PI.
CF is the solution of homogeneous part of recurrence
relation and PI is the solution of non-homogeneous part of
recurrence relation.
Methods to find PI

Let F(n)=(c0+c1n + c2n2+…+ctnt)sn


Such that c0, c1, c2,…ct and s are real constants then
there are two conditions on s.
(i) If s is not a root of characteristic equation then
PI=(b0+b1n + b2n2+…+btnt)sn

(ii) If s is root of characteristic equation of multiplicity m


then
PI=nm (b0+b1n + b2n2+…+btnt)sn
Question: Find particular solution of
an =6 an-1 -9 an-2 +3n.
Solution: Let the recurrence relation is
an =6 an-1 -9 an-2 +3n.
then homogeneous part is
an =6 an-1 -9 an-2
and the non-homogeneous part is F(n)= 3n.
Now the characteristic equation is given by
rn=6rn-1-9rn-2
or r2-6r-9=0
Which gives characteristic roots r=3, r=3.
Solution Continued…
Here s=3 is root of characteristic equation of multiplicity
2. Hence we get
PI=n2c3n ………………….(1)
Since PI does not contain arbitrary constant . Hence we have
to find the value of constant c.
Since PI is also a solution of recurrence relation. Hence we get
n2c3n =6 (n-1)2c3n-1 -9 (n-2)2c3n-2 +3n
cn2 9=6 (n-1)2c3 - 9 (n-2)2c +9
Which gives c=1/4 and we get
PI=n23n /4.
Puzzles
Find particular solution of
(i) an =6 an-1 -9 an-2 + n2 2n
(ii) an =6 an-1 -9 an-2 + (n2 +1)3n
(iii) an =6 an-1 -9 an-2 + n(n +1)3n
(iv) an =6 an-1 -9 an-2 + (n2 +1) (n2 -1)3n
(v) an =5 an-1 -9 an-2 + 8 an-3 -4 an-4 + (n -1)2n , Given that
roots are 1, 1, 2, 2
(vi) If roots are 1, 1, 2, 2 then find the PI for F(n)= 1
(vii) If roots are 1, 1, 2, 2 then find the PI for F(n)= 2.3n
Question: Solve the recurrence relation
an = an-1 +n.

Solution: Clearly the characteristic root of


homogeneous part an = an-1 is r=1.
Hence CF=c(1)n=c.
Now since f(n)=n=n(1)n
Which implies s=1 is the root of characteristic
equation of multiplicity m=1.
Hence PI=n(c1 +c2 n) (1)n=n(c1 +c2 n).
Now the solution of the recurrence relation is
an =CF+PI=c+n(c1 +c2 n).
Question: Solve the recurrence relation
an = 3an-1 +2n, given that a1 =3.
Solution: Since root is r=3
Hence CF=c3n PI= (b0 + b1n)
Since PI satisfy the given recurrence relation
we get b0 =-3/2 and b1 =-1
and hence PI= -(3/2 + n)
Now the final solution of recurrence relation is given by an
=CF+PI=c3n -(3/2 + n) ……..(1)
Now using the condition a1 =3 we get
C=11/6 and the solution becomes
an =(11/6)3n -(3/2 + n). Answer
Difference and Shift Operator
There are two important operator namely
Forward difference operator and shift operator.
1. The forward difference operator is denoted by ∆
and defined same as differential operator
∆ a(n)=a(n+1)-a(n).
2. The shift operator is denoted and defined by
E ( an )  an 1
3. The relation between difference and shift operator
is E=1+ ∆
Recurrence relation in terms of shift
operator
Since E (an )  an 1 which implies
E 2 ( an )  E ( E ( an ))  E ( an 1 )  an  2

Hence, we can write E k ( f n )  f n  k


Hence a second degree recurrence relation can
be written in terms of shift operator as follows:
c2 an  2  c1an 1  c0 an  c2 E 2 ( an )  c1 E ( an )  c0 an
 (c2 E 2  c1 E  c0 ) an
Method to Find PI by using Method of
Inverse Operator
th
Let the k degree recurrence relation is
ck an  k  ck 1an  ( k 1)  ck  2 an  ( k  2 )  ....  c1an 1  c0 an  H ( n)

Which can be written as

ck E k ( an )  ck 1 E k 1 ( an )  ck  2 E k  2 ( an )  ....  c1 E ( an )  c0 ( an )  H ( n)

(ck E k  ck 1 E k 1  ck  2 E k  2  ....  c1 E  c0 ) an  H ( n)

f ( E ) an  H ( n)
Continued…

Let the recurrence relation is f ( E )an  H ( n)

Then particular integral is defined by


1
PI  ( H (n))
f (E)

Case 1: If H (n)  a n , a is constant then


1
PI  ( a n ), f ( a )  0
f (a )

Case 2: If f (a)  0 then we get f ( E )  ( E  a ) k

and 1 n( n  1)(n  2).........(n  (k  1))


PI  (a n )  a nk
( E  a) k k!
Continued…

Case 3: If H (n)  sin( an), a is constant then


1 1 e ian  e  ian
PI  (sin an)  ( )
f (E) f (E) 2i
1 1 ian 1 1
 (e )  (e ian )
2i f ( E ) 2i f ( E )

1 1 1 1
 (eia ) n  (e ia ) n
2i f ( E ) 2i f ( E )

Now apply case 1 to find the PI.


Similarly, apply the same for H ( n)  cos(an)
Continued…

Case 4: If H ( n)  n m is a polynomial then


1
PI  (n m )
f (E)

For solving polynomial PI, replace E  1  ∆


And expand f (∆)-1 by using binomial expansion.
Since ∆ is difference operator, therefore we can
use it same as differential operator as follows:
∆ (n m )  m.n m-1
Continued…
Case 5: If the non homogeneous part is of the
form H (n)  a nV (n)
Then
1 n n 1
PI  ( a V ( n))  a (V ( n))
f (E) f ( aE )

Note: If the characteristics roots are complex


conjugate r  a  ib then complimentary
function is C.F . | r | (cos n  sin n )
Where 1 b
| r | a2
 b ,   tan
2

a
Question: Find the PI for an+2-6an+1+5an=2n
by using the method of inverse operator.
Solution: Since the given recurrence relation can
be written in terms of shift operator
2 2 n
E (an )  6 E (an )  5an  ( E  6 E  5)an  2

Now, F ( E )  E 2  6 E  5, H ( n)  2 n

Hence 1 n 1 n 1 n
PI  (2 )  2 (2 )  2
f (E) ( E  6 E  5) 3
Question: Find the PI: F(E)=(E-4)3 and H(n)=4n
Solution: F ( E )  ( E  4) 3 , H (n)  4 n
1 1 n(n  1)(n  2) n 3
PI  (4n )  3
( 4 n
)  (4 )
f (E) ( E  4) 3!

Question: Find the PI: F ( E )  ( E 2  4), H (n)  cos 3n


Solution: PI  1 (cos 3n)  1 (cos 3n)  1  e  e 3in 3in


f (E) ( E 2  4) ( E 2  4)  2 

1 1 1 1

2 ( E 2  4)
 
e 3in

2 ( E 2  4)
e 
 3in

1 1 1 1

2 ( E 2  4)
 
e 3i n

2 ( E 2  4)
e  
 3i n
Continued…
1 1 1 1
We get  6i
2 (e  4)
e  
3i n
6i
2 (e  4)
e 
 3i n

1 1 1 1

2 ( e 6 i  4)
 
e 3in

2 ( e  6 i  4)
e3in

Question: Find the PI: F ( E )  ( E  4), H (n)  3n n 2
1 n 2 1 n 2 n 1
PI  3 n  3 n 3 n2
f (E) ( E  4) (3E  4)

Replacing E  1  ∆
1
PI  3n n2
(3E  4)
Continued…
We get 3n (3(1+ ∆)+4)-1 ( n2 )=3n (3∆+7)-1 ( n2 )
1 n
= 7 3 (1+ 73 ∆)-1 ( n2 )
= 7 3n (1- ∆+ ∆2 - ∆3 +…) ( n2 )
1 3
7
3
7
3
7

= 1 n 2 3 3 
3 n  2n  2  0  0..... 
7  7 7 
1 n 2 6n 6
 3 n   
7  7 7
1

49

3n 7 n 2  6 n  6 
Rough Work
Solution:
Generating Functions
Let an be a sequence then generating function of an is a
power series whose coefficients are an. The
generating function of an is defined by

G ( x)   k
a
k 0
x k

Example: Find the generating function of the sequence


1, 1, 1, 1,……
Solution: Let ak  1
Hence the generating function is given by

1
G ( x)  x
k 0
k
 1 x  x 2 3
 x  ........... 
1 x
Example: Find the generating function of the sequence ak = mck, k=0, 1, 2,……m.

Solution: Let the sequence is


ak = mck, k=0, 1, 2,……m.
then generating function is given by
m
G ( x)  
k 0
m
Ck x k  (1  x ) m
Example: Find the generating function of the
sequence an = bn , n=0, 1, 2,…

Solution: Let the sequence is an = bn then


generating function is given by

G ( x)   b
n 0
n
x n
 1  bx  (bx ) 2
 ........

1
  (1  bx ) 1
1  bx

Note: This generating function is applicable if |


bx|<1 which implies |x|<1/|b|.
Sum and Product of Power Series
Let f ( x) 

 ak x , g ( x ) 
k

 k
b x k

k 0 k 0

be two power series then sum and product are


defined by

(i ) f ( x )  g ( x )   k
( a
k 0
 bk ) x k

  k  k
(ii ) f ( x ) g ( x )      a j bk  j
x

k 0  j 0 
1
Question: Let h( x )  then find
(1  x) 2
the

sequence for which h(x) is the generating function.


Solution:
1
Let f ( x) 
(1  x )
 g ( x)

Then f ( x)  g ( x)  1  x  x 2  x 3  ....
and we get ak  bk  1
Therefore f ( x) g ( x)  1 1

1
(1  x ) (1  x) (1  x) 2

 k
  k
    ak bk  j
x

k 0  j 0 

  k  k 
    1x 
  ( k  1)x k

k 0  j 0  k 0
Question: Solve the recurrence relation by using
generating function ak=3ak-1 such that a0=2

Solution: Let G(x) be the generating function of


recurrence relation ak=3ak-1 then we get

G ( x)   k
a
k 0
x k

Since ak  3ak 1 we can write ak x  3ak 1 x


k k

Taking summation both side from k  1 to 


we get  

a
k 1
k
k x  k
 3a
k 1
k 1 x
Solution Continued…
Or we can write
 
a0   ak x k  a0   3ak 1 x k
k 1 k 1


Which implies G ( x)  a0   3ak 1 x k
Or 
k 1

G ( x )  2  3 x  ak 1 x k 1
k 1

G ( x )  2  3 x  ak x k G ( x)  2  3 xG ( x )
k 0 or
Solution Continued….
We get
2  
G ( x)   2(1  3 x) 1  2 (3 x) k  2.3k x k
(1  3 x) k 0 k 0

Or we get ak  2.3k
Which is the solution of recurrence relation.
Question: Using generating function solve the recurrence
relation ak=3ak-1 +2, k=1, 2, 3…….., and a0=1.

Solution: Let G(x) be the generating function of recurrence


relation ak=3a
 k-1
+2 then we get
G ( x)   k
a
k 0
x k

ak  3ak 1  2
Since
ak x k  3ak 1 x k  2 x k
Or
  
or
a x
k 1
k
k
  3ak 1 x   2 x
k 1
k

k 1
k
Solution continued…

 
. ( x )  1  3 x  ak 1 x   2x
k 1 k
G
k 1 k 1

2x
G ( x )  1  3 xG ( x ) 
1 x
2x 1 x
G ( x )(1  3 x )  1 
1 x 1 x
(1  x) 1 2
G ( x)   
(1  x)(1  3 x) (1  x ) (1  3 x)
 
G ( x)  1 x  2 3 x
k k k

k 0 k 0
Solution continued…

 
G ( x )   ( 1) x   2.3 x k k k

k 0 k 0

G ( x)   (1  2.3
k 0
k
)x k

k
ak  ( 1  2.3 )
This is the solution of recurrence relation.
Question: Using generating function solve
the recurrence relation ak=5ak-1 -6ak-2 such
that a0=6, a1=30.
Solution: Let the generating function is given by

G ( x)  
k 0
ak x k

Since the recurrence relation is


ak  5ak 1  6ak  2
Which can bek written k k
ak x  5ak 1 x  6ak  2 x
Solution Continued…

Taking summation on both side, we get


  

a
k 2
k x  5 ak 1 x  6 ak  2 x
k

k 2
k

k 2
k

 
G ( x)  a0  a1 x  5 x ak 1 x k 1
 6x 2
a k 2 x k 2

k 2 k 2

 
G ( x)  6  30 x  5 x  ak x  6 x k 2
a x k
k

k 1 k 0
Solution continued…

Or
G ( x )  6  30 x  5 xG ( x )  6   6 x G ( x )
2

6  12 18
G ( x)   
(1  2 x )(1  3 x ) (1  2 x ) (1  3 x )

 
G ( x )  12 2 x k k
 18 3 x k k

k 0 k 0


G ( x)   (12.2
k 0
k k
 18.3 ) x k

Hence we get ak  ( 12.2 k  18.3k )


Puzzle for You

Question: Solve the recurrence relation


ak  3ak 1  4 k 1
Rough work
Solution:

You might also like