Академический Документы
Профессиональный Документы
Культура Документы
^<>=«»e∩∪ ^<>=«»e∩∪
R=E«CU»RReEN∩C∪E^R<E>LA=AT«IO»N e ∩ ∪
5 ^ < >R
5^<>=«»e∩∪ ^<>=«»e
LEARNING OBJECTIVES
∑ Recurrence relation ∑ Generating functions
RECURRENCE RELATION
Introduction
Some of the counting problems cannot be solved by using the techniques discussed earlier, namely,
sum rule, product rule, permutations and combinations. They can be solved by finding relationships
between the terms of a sequence. The corresponding relationship is known as recurrence relation.
Recurrence relation An equation that expresses an in terms of one or more of the previous terms of
the sequence, namely a0, a1, a2, ..., an –1, for all integers n with n ≥ n0 where n0 is a non-negative integer,
is called a recurrence relation for the sequence {an} or a difference equation.
If the terms of a sequence satisfy the recurrence relation, then the sequence is called a solution of
the recurrence relation.
Example Let {a n} be a sequence that satisfies the recurrence relation an = an–1 + 3an–2 for
n = 2, 3, … and let a0 = 1 and a1 = 2. What are the values of a2 and a3?
Solution The given recurrence relation is an = an–1 + 3an–2, n = 2, 3, ...
a2 = a1 + 3a0 = 2 + 3 ¥ 1, since a0 = 1, a1 = 2
fi a2 = 5
and a3 = a2 + 3a1 = 5 + 3 ¥ 2 = 11.
Hence, a2 = 5 and a3 = 11.
Example Find the first five terms of the sequence defined by each of the following recurrence
relations and initial conditions:
(i) an = a2n–1, a1 = 2
(ii) an = nan–1 + n2 an–2, a0 = 1, a1 = 1
(iii) an = an–1 + an –3, a0 = 1, a1 = 2, a2 = 0
= 6( ) + 3
–1 n (–1)n 2n + 2 –n n +2
+ 2
(–1)2 (–1) 22 2
= 3. (–1)n + 2n – n + 2
= an = L.H.S.
\ an = 3 (–1) + 2n – n + 2 is a solution of the given recurrence relation.
n
an = 3an–1 + 1 = Ê 3 – 1ˆ.
n+1
Ë 2 ˜¯
Á
Example A person deposits Rs 1,000 in an account that yields 9% interest compounded yearly.
(i) Set up a recurrence relation for the amount in the account at the end of n years.
(ii) Find an explicit formula for the amount in the account at the end of n years.
(iii) How much money will the account contain after 100 years?
Solution (i) Let Sn denote the amount in the account after n years.
But, the amount in the account after n years
= the amount in the account after (n – 1) years + interest for the nth year
i.e., Sn = Sn–1 + (0.09) Sn–1, since the interest is 9% per year
i.e., Sn = (1.09)Sn–1
This is the required recurrence relation for the amount in the account at the end of n
years.
(ii) Explicit formula for Sn:
Now, S1 = (1.09)S0
S2 = (1.09) S1 = (1.09)2S0
S3 = (1.09) S2 = (1.09)3S0
#
Sn = (1.09)Sn–1 = (1.09)nS0
fi Sn = (1.09)nS0
i.e., Sn = (1.09)n ¥ 1,000, since S0 = Rs 1,000
Using mathematical induction, we can prove the validity of Eq. (10.1)
When n = 0, S0 = (1.09)0 ¥ 1,000
= 1,000
\ The result (i) is true for n = 0.
We assume that Sk = (1.09)k ¥ 1,000 is true.
We need to prove that Sk + 1 = (1.09)k + 1 ¥ 1,000 is true.
From the recurrence relation, we have
Sk + 1 =(1.09)Sk
= (1.09). (1.09)k ¥ 1,000 [by our assumption]
fi Sk + 1 = (1.09) k +1 ¥ 1,000
fi Sk + 1 is true.
Thus, by the principle of mathematical induction, Sn is true for all values of n.
\ The explicit formula is Sn = (1.09)n .(1,000)
(iii) When n = 100, we have
S100 = (1.09)100 ¥ 1,000
= Rs (1.09)100 ¥ 1,000
\ Money in the account after 100 years = Rs 1,000(1.09) 100.
Example Find the recurrence relation and basis for the sequence {1, 3, 32, 33, ...}.
Solution Let us denote the terms as follows:
a0 = 1, a1 = 3, a2 = 32, a3 = 33, ...
Therefore, the corresponding recurrence relation is an = 3an–1 and the basis or initial condition is a0 = 1.
EXERCISES
If the sequence {an} satisfies the recurrence Is the sequence {an}a solution of the recurrence
relation an = an–1 – an–2 for n = 2, 3, ... and relation an = 8an–1 – 16an–2 if
suppose a0 = 3, a1 = 5, then find a2 and a3. (a) an = 2n?
Find the first five terms of the following recur- (b) an = n (4n)?
rence relations with the given initial conditions: (c) a =n 2 (4n) + 3n(4n)?
(a) a = 6a , a = 2 2 n
n n–1 0
(d) an = n (4 )?
(b) an = an–1 + 3an–2, a0 = 1, a1 = 2.
(e) an = (– 4)n?
Determine whether the sequence {a n} is a
solution of the recurrence relation By using an iterative approach, find the
an = 2an–1 – an–2, for n = 2, 3, ..., if solution to each of the recurrence relations
with the given initial conditions:
(a) an = 3n (b) an = 2n (a) an = 3an–1, a0 = 2
(c) an = 5
(b) an = 2an–1, a0 = 1
Show that the sequence {a n} is a solution of
the recurrence relation an = –3an–1 + 4an–2 if (c) an = nan–1, a0 = 5
(a) an = 0 (b) an = 1 (d) an = 2nan–1, a0 = 1
(c) an = (– 4)n Suppose a person deposits Rs 10,000 in a sav-
ings account at a bank yielding 11% interest
per year, with the interest compounded annu- (a) Set up a recurrence relation for the
ally. How much money will be in the account number of vehicles produced in the first n
after 30 years? months by this factory.
A factory makes custom sports vehicles at an (b) How many vehicles are produced in the
increasing rate. In the first month only one first year?
vehicle is made, in the second month two (c) Find an explicit formula for the number of
vehicles are made an so on, with n vehicles vehicles produced in the first n months by
made in the nth month: this factory.
Example Provide some examples of linear homogeneous recurrence relation. Also, give their
degrees.
Solution (i) The recurrence relation Sn = (0.09)Sn–1 is a linear homogeneous recurrence relation of
degree 1.
(ii) The recurrence relation Fn = Fn – 1 + Fn – 2 is a linear homogeneous recurrence relation of
degree 2.
(iii) The recurrence relation an = an–4 is a linear homogeneous recurrence relation of degree 4.
Example Determine whether the following recurrence relations are linear homogeneous
recurrence relations with constant coefficients:
(i) an = 2an – 4 + a 2n – 3
(ii) Hn = 2Hn–1 + 2
(iii) Bn = nBn–1
Solution (i) The recurrence relation an = 2an–4 + a 2 n –3 is not linear.
(ii) The recurrence relation Hn = 2Hn–1 + 2 is not homogeneous.
(iii) The recurrence relation Bn = nBn–1 does not have constant coefficients.
Example Determine which of the following recurrence relations are linear homogeneous
recurrence relations with constant coefficients and also find their degrees:
(i) an = 3an–1 + 4a2n–2 + 5an –3
(ii) an = 2nan–1 + a n–2
(iii) an = a n–1 + a n–4
(iv) an = an–1 + 2
(v) an = a2n –1 + an–2
(vi) an = an–2
(vii) an = an–1 + n
Solution (i) This is a linear homogeneous recurrence relation with constant coefficients.
Degree = (n – 3) – n = 3.
(ii) This does not have constant coefficients.
(iii) This is a linear homogeneous recurrence relation with constant coefficients.
Degree = (n – 4) – n = 4.
(iv) This is not a homogeneous recurrence relation.
(v) This is not a linear recurrence relation.
(vi) This is a linear homogeneous recurrence relation with constant coefficients.
Degree = 2.
(vii) This is not a homogeneous recurrence relation.
Characteristic roots Consider the recurrence relation
an = c1an–1 + c2an–2 +...+ ck an–k
where c1, c2, …, ck are real numbers and ck π 0.
The characteristic equation of the recurrence relation given above is
rk – c1rk–1 – c2rk–2 – ◊◊◊ – ck–1 r – ck π 0
The solutions of the characteristic equation are called the characteristic roots.
Theorem Let c 1 and c2 be real numbers. Suppose r2 – c1r – c2 = 0 has two distinct roots r1 and
r2. Then the sequence {an} is a solution of the recurrence relation an = c1an–1 + c2an–2 if and
only if an = a1r1n + a2r2n for n = 0, 1, 2, …, where a1 and a2 are constants.
Proof Let r and r be two distinct roots of the characteristic equation r 2 – c r – c = 0.
1 2 1 2
= a1 r1 +
n
a 2r2n
= an [by our assumption]
\ The sequence {an} with an = a1 1r n + a2r2n is a solution of the recurrence relation.
Conversely, we assume that an = a1 r1 n + a2 r2 n is a solution of the recurrence relation
an = c1an –1 + c2an–2 for some constants a1, a2 and n = 0, 1, 2, ... .
We need to prove that every solution {an} of the recurrence relations has the form
an = a 1r1n + a 2r 2n for some constants a and1 a and 2 n = 0, 1, 2, ... .
Suppose {an} is a solution of the recurrence relation and the initial conditions a0 = c0 and a1 = c1
hold. We need to show that there are constants a1 and a2 so that the sequence {an} with
an = a 1r1n + a 2r 2n satisfies the initial conditions.
Now
a0 = c0 = a 1r 10 + a2r20 = a1 + a2
a1 = c1 = a1r1 + a2r2 [by our assumption]
i.e., c0 = a1 + a 2
and c1 = a1r1 + a 2r2
Solving this, we get
c1 – c0r2
a1 =
r1 – r2
c0r1 – c1
and a2 =
r1 – r2
The values of a1 and a2 are valid only if r1 π r2.
Therefore, for the above values of a1 and a2, the sequence {an} with an = a r n + a r n satisfies the
1 1 22
two initial conditions.
Since an = c1an–1 + c2an –2 with a0 = c0 and a1 = c1 uniquely determine the sequence,
an = a 1r1n + a 2r2n is a solution form.
Theorem Let c and c be real numbers with c π 0. Suppose r 2 – c r – c = 0 has only one root
1 2 2 1 2
r0. A sequence {an} is a solution of the recurrence relation an = c1an –1 + c2an –2 if and only if
a = a r n + a nr n, for n = 0, 1, 2, …, where a and a are constants.
n 1 0 2 0 1 2
Proof First, we show that if an = a r n + a nr n, then the sequence {a } is a solution of the recurrence
1 0 2 0 n
relation. Since r0 is a root of the characteristic equation r – 2c1r – c2 = 0
r0 is a solution of an = c1an–1 + c2an–2 [by Theorem 10.1]
Now we need to prove that an = nr n0 is also a solution of Eq. (10.8).
Since r0 is a root of r 2 – c1r – c2 = 0
and the degree of equation (10.9) is 2
r2 – c1r – c2 = (r – r0)2
= r2 – 2r0r + r 02
Equating the corresponding coefficients, we have
c1 = 2r0, c2 = –r 20
Now
c1an –1 + c2an–2 = c1 [(n – 1)r n–1
0 ] + c2 [(n – 2)r 0 ]
n–2
Example Find the solution of the recurrence relation a n= 2an–1 + an–2 – 2an–3 for n = 3, 4, 5,
..., with a0 = 3, a1 = 6 and a2 = 0.
Solution The given recurrence relation is
an – 2an –1 – an –2 + 2an –3 = 0
The characteristic equation is
r3 – 2r2 – r + 2 = 0
1 1 –2 –1 2
0 1 –1 –2
1 –1 –2 0
fi (r – 1) (r2 – r – 2) = 0
fi (r – 1) (r + 1) (r – 2) = 0
fi r = 1, 2, –1
Hence, the solution
an = c11n + c22n + c3(–1)n, where c1, c2, c3 are arbitrary constants.
Initial conditions are a0 = 3 a1 = 6 and a2 = 0.
When a0 = 3, c1 + c2 + c3 = 3
When a1 = 6, c1 + c221 + c3(–1)1 = 6
fi c2 + 2c2 – c3 = 6
When a2 = 0, c1 + c222 + c3 (–1)2 = 0
fi c2 + 4c2 + c3 = 0
Adding Eqs (10.15) and (10.16) fi 2c1 + 3c2 = 9
Adding Eqs (10.16) and (10.17) fi 2c1 + 6c2 = 6
Subtracting Eq. (10.19) from Eq. (10.20) fi – 3c2 = 3
fi c2 = –1
Equation (10.18) fi 2c1 = 9 – 3c2
fi 2c1 = 9 + 3
fi c1 = 6
Equation (10.15) fi c3 = 3 – c1 – c2
=3–6+1
fi c3 = –2
\ The unique solution is an = 6 (1 n ) – 2n – 2 (–1)n.
Fn = c1 Á ˜ + c2 ÁË 2 ˜¯
Ë 2 ¯
where c1 and c2 are arbitrary constants.
Initial conditions are F0 = 0 and F1 = 1.
Now, F0 = 0 fi c1 + c2 = 0
And F = 1 fi c Ê 1 + 5 ˆ + c Ê1– 5 ˆ = 1
1 1Á ˜ 2Á ˜
Ë 2 ¯ Ë 2 ¯
Solving Eqs (10.21) and (10.22):
Equation (10.21) fi c1 = – c2.
\ Equation (10.22) fi c ÈÊ1 – 5 ˆ – Ê 1 + 5 ˆ˘ = 1
2 ÍÁ 2 ˜ Á 2 ˜˙
ÍÎË ¯ Ë ¯ ˙˚
fi c2 È – 5 ˘ = 1
Î ˚
–1
fi c2 =
5
Using this in Eq. (10.21), we get
1
1
c=
5
The solution is
n n
1 Ê1 + 5 ˆ 1 Ê1 – 5 ˆ
Fn = Á ˜ – Á ˜ ,n≥ 0
5 Ë 2 ¯ 5 Ë 2 ¯
Example The Lucas numbers satisfy the recurrence relation L n= L n–1 + L n–2 and the initial
conditions L0 = 2 and L1 = 1.
(i) Show that L n = Fn–1 + Fn–2 for n = 2, 3, ..., where Fn is the nth Fibonacci number.
(ii) Find an explicit formula for the Lucas numbers.
Solution (i) Let Sn be the statement
Ln = Fn–1 + Fn+1 for n = 2, 3, ... .
We shall prove this by using the principle of mathematical induction.
Basic step: S2 is shown to be true. That is, we need to prove
L2 = F1 + F3.
By the definition of Lucas number, we can write
L2 = L1 + L0
= 1 + 2, since L0 = 2, L1 = 1
=3
R.H.S. S2 = F1 + F3
= 1 + 2, since from the Fibonacci number 0 (F0) 1 (F1) 1 (F2) 2 (F3) 3 (F4) …
=3
fi L2 = F1 + F3
Hence, S2 is true.
Inductive step: We assume that Sk is true for every k £ n.
fi Lk = Fk –1 + Fk +1 is true for every k = n.
We need to prove that Sk +1 is true. That is, we need to prove
Lk + 1 = Fk + Fk + 2.
Now, by the definition of Lucas numbers
Lk+1 = Lk + Lk–1
= (Fk –1 + Fk +1) + (Fk –2 + Fk ) [by our assumption]
= (Fk –1 + Fk –2) + (Fk +1 + Fk )
= Fk + Fk +2 [by the definition of Fibonacci numbers]
i.e, Sk +1 is true.
Hence, by the principle of mathematical induction,
Sn is true for every n.
(ii) The given recurrence relation is
Ln – Ln–1 – Ln–2 = 0
The corresponding characteristic equation is
r2 – r – 1 = 0
1± 5
fi r=
2
1+ 5 1– 5
Let r1 = and r2 =
2 2
Therefore, the solution is
n
Ê 1+ 5ˆ n
Ê 1– 5 ˆ
Ln = c1 Á + c ˜
Ë 2 ˜¯
2Á
Ë 2 ¯
where c1 and c2 are constants.
Initial conditions are L0 = 2, L1 = 1.
Now, L0 = 2 fi c1 + c2 = 2
L = 1 fi c Ê 1 + 5 ˆ + c Ê 1– 5 ˆ = 1
1 1Á ˜ 2Á ˜
Ë 2 ¯ Ë 2 ¯
Solving Eqs (10.24) and (10.25), we get
a1 = 1 and a2 = 1
Hence, the unique solution is
n n
Ê1 + 5 ˆ Ê1– 5 ˆ
Ln = Á + ˜
Ë 2 ˜¯ ÁË 2 ¯
Step 3. We substitute the guess from Step 2 into the recurrence relation. If the guess is correct, then
we can determine the unknown coefficient of the guess. If we are not able to determine the
constants, then our guess is wrong and hence we go to Step 2.
Step 4. The general solution of the recurrence relation is the sum of the homogeneous and particu-
lar solutions.
Step 10. If no initial conditions are given, then Step 4 will give the solution.
If n initial conditions are given, then we get n equations with n unknowns. Solving the system, we
get a complete solution.
or solve
S (k) – 7S (k – 1) + 10S (k – 2) = 6 + 8k, S (0) = 1, S (1) = 2.
Solution The given recurrence relation is
ak – 7ak –1 + 10ak –2 = 6 + 8k
(i) The associated homogeneous equation is
ak – 7ak –1 + 10ak –2 = 0
Its characteristic equation is
r2 – 7r + 10 = 0
fi (r – 5) (r – 2) = 0
fi r = 2, 5
Therefore, the homogeneous solution is
k k
a (H) = c 2 + c 5
k 1 2
Now, 4d1 = 8 fi d1 = 2
fi 4d0 = 6 + 13 (2)
fi d0 = 8
fi a(P)
k
= 8 + 2k
Thus, the general solution is ak = a (H ) = a (P)
k k
fi ak = c12 + c25 + 8 + 2k
k k
Given that, a0 = 1, a1 = 2
Now, a0 1 fi c1 + c2 + 8 = 1
fi c1 + c2 + 8 = – 7
Also, a1 = 2 fi c12 + c25 + 8 + 2 = 2a
fi 2c1 + 5c2 = – 8
Solving Eqs (10.35) and (10.36), we get
c1 = – 9 and c2 = 2
\ The required solution is
ak = – 9 (2k ) + 2 (5k ) + 8 + 2k
fi c2 = 1
6
Therefore, Eq. (10.39) gives
1 1
c = +
1
2 2
fi c1 = 1
Ê 1 ˆ
\ a (P) = 1 + n n22n
n ÁË 6 ˜¯
Ê 2 n3 ˆ n
=Á n + ˜ 2
Ë 6 ¯
Thus, the general solution of the recurrence relation is
an = a (nH ) + a(nP)
È n3 ˘
fi an = Íc1 + c2n + n2 + ˙ 2n
Î 6 ˚
= 12 + 3n + n22n–1
Hence, the general solution is
an (c1 + c2n)2n + 12 + 3n + n22n – 1
Given that a0 = 1, a1 = 1
a0 = 1 fi c1 + 12 = 1
fi c1 = –11
Also, a1 = –1 fi (c1 + c2) 2 + 12 + 3 + 22 = 1
fi 2c1 + 2c2 = – 18
fi c1 + c2 = – 9
fi c2 = – 9 – (–11) = 2
fi c2 = 2
Thus, the required solution is
an = (2n – 11) 2n + 12 + 3n + n2 2n +1
EXERCISES
Determine which of these equations are linear Solve the recurrence relation a n = 6an –1 –
homogeneous recurrence relations with con- 11an –2 + 6an –3, a0 = 2, a1 = 5 and a2 = 110.
stant coefficients and find their degree. Solve a n + 3an – 1 + 3an – 2 + an – 3 = 0, a0 = 1, a1
ak -1 = – 2 and a2 = – 1.
(a) ak = a2k -1 (b) ak = k Solve a n – an – 1 – 6an – 2 = – 30, with a0 = 20
and a1 = – 5
(c) ak = ak–1 + ak–2 + k +3 Solve the recurrence relation a n – 3an – 1 –
(d) ak = 4 ak – 2 + 5ak – 4 + 9ak–7 4an – 2 = 4n.
Solve the recurrence relation a n = an-2 for Solve the recurrence relation a – 6a +
4 n+2 n+1
n ≥ 2, a0 = 1, a1= 0. 9an = 3(2n) + 7(3n), n ≥ 0. a0 = 1, a1 = 4.
Solve the recurrence relation a n = 7an–2 + 6an–3, Solve the recurrence relation a n = 4an – 1 – 3an – 2
a0 = 9, a1 = 10, a2 = 32. + 2n + n + 3, with a0 = 1, a1 = 4.
Find the solution to a n = 5an –2 – 4an – 4, with What is the general form of the solutions of a
a0 = 3, a1 = 2, a2 = 6 and a3 = 8. linear homogeneous recurrence relation if its
Solve the recurrence relation a n = 6an–1 –9an–2, characteristic equation has the roots 1, 1, 1, 1,
a0 = 1, a1 = 6. –2, –2, –2, 3, 3, – 4?
GENERATING FUNCTIONS
Introduction
Many counting problems can be solved by using generating functions. A generating function is a
powerful tool that can be used for solving recurrence relations by translating the terms of a sequence
of a recurrence relation into an equation involving generating function. The generating function of a
sequence a0, a1, a2, ... of real numbers is written as the series given below:
μ
Solution The generating function for the sequence 1, 2, 3, ... is G (z) = Â (n +1)zn
n= 0
= 1 + 2z + 3z2 + 4z3 + ...
1
= = (1 – z)–2
(1- z)2
Example Find the generating function for the sequence 1, 3, 32, 33, ... .
or
Find the generating function for the sequence {an}, with an = 3n.
Solution Its generating function is G(x) = 1 + 3z + 32z2 + 33z3 + ◊◊◊
μ
= Â 3n zn
n= 0
Note The generating function of a sequence a 0, a1, a2, ... is also denoted by a0, a1, a2,... .
Example Find the generating function for the sequence 5, 3,- 4, - 2, 0,1 .
Solution Its generating function is written as
G (z) = 5 + 3z – 4z2 – 2z3 + 0z4 + 1z5
= 5 + 3z – 4z2 – 2z3 + z5
Closed Form Expressions for Generating Functions
Closed form expression for a generating function is defined as an expression of the form
a + ar + ar2 + ....
Example Find the closed form expression of the generating function for the sequence 1, a, a2,
...
Solution The closed expression of the generating function of the given sequence may be written as
G (z) = 1 + az + a2z2 + a3z3 + ... .
= 1 + az + (az)2 + (az)3+ ... .
= (1 – az)–1
1
= , when |az| < 1
1 - az
1 1
fi G (z) = , when | z| < for a π 0.
1 - az a
Example Find the closed form expression of the generating function for the Fibonacci se-
quence defined by
Fn = Fn–1 + F n–2, n ³ 2, F0 = 0, F1 = 1
Solution The generating function of a Fibonacci sequence {Fn} is given by
F (z) = F0μ + F1z + F2 z2 + F3z3 + ◊◊◊
= Â Fnz
n
n =0
Given that Fn = Fn –1 + F n – 2, n ≥ 2
Multiplying both sides of Eq. (10.46) by zn and summing over all n ≥ 2, we get
• • •
 Fnzn =  Fn -1zn +  Fn - 2 zn
n≥ 0 n≥0 n≥0
fi  Fnz = z F z n -1 + z 2 F z n - 2
n
n≥2
 n -1  n- 2
n≥ 2 n≥2
ak 1
1.
1- az
2. bak b
1- az
3. bkak abz
(1- az)2
4. 1 1
1- z
5. k+1 1
(1- z)2
1
6. ez
k!
(–1)k+1 x 2 x3 x 4
7. log (1 + x) = x – + - +....
k 2 3 4
8. nCk (1 + x)n
k
9. nCka (1 + ax)n
1
10. (n + k – 1)Ck = (n + k – 1)C(n–1)
(1 – x )n
= H (z)
Hence, the proof.
(iii) The scalar product of any generating function is a generating function, i.e., if l is any scalar,
then l G (z) is a generating function.
Proof We can prove property •
(iii) as given below.
l.G (z) = l
 n
anz
n=0
•
= Â (lan ) zn
=0
n•
where cn = l an
= Â cn z n
n= 0
= H (z)
Hence, the proof.
(iv) The product of two generating functions is again a generating function.
(v) If p ≥ 1, then z p G (z) is a generating function.
(vi) Differentiation:
•
#
Continuing in this way, we get
•
Example Use generating functions to solve the recurrence relation a n = 3an –1 + 2, n ≥ 1 with
a0 = 1.
•
Solution Let the generating function of the sequence {an} be G (z) = Â an z n
n= 0
1 2
\ G (z) = +
1 - 3z 1 - z
Given recurrence relation is an = 3an –1 + 2.
Multiplying both sides of Eq. (10.48) by zn and summing over all n ≥ 1, we have
•
 an z n = 3  an-1 z n + 2  z n
n≥1 n≥1 n≥1
= 3 z  an-1 z n-1 + 2z  z n –1
n≥1 n≥1
fi G (z) – a0 = 3 zG (z) + 2z [1 + z + z2 + ◊◊◊]
2z
fi (1 – 3 z) G (z) = [since a0 = 1 and [1 + z + z2 + ◊◊◊] = (1 – z)–1]
(1 - z)
1+ z
fi (1 – 3z) G (z) =
1 -z
(1+ z)
fi G (z) =
(1 - z)(1 - 3z)
(1+ z) A B
Let = +
(1 - z)(1 - 3z) (1 - z) (1 - 3z)
Equating the numerators on both sides, we get
(1 + z) = A (1 – 3 z) + B (1 – z)
fi A = –1
and B = 2
2 1
\ G (z) = –
(1 - 3z) (1 - z)
Therefore, the required solution is an = 2 (3n) –1.
Example Use the method of generating function to solve the following recurrence relation:
an – 2an–1 – 3an–2 = 0, n ≥ 2 with a0 = 3 a1 = 1
Solution Let the generating function of the sequence {an} be G (z).
•
\ G (z) = Â an zn
n= 0
 an zn – 2  an-1zn –3  an-2 z n = 0
n≥2 n≥2 n≥2
fi  an z n – 2z  an-1zn-1 –3z 2  an-2 zn-2 = 0
n≥2 n≥2 n≥2
Example Use the method of generating function to solve the recurrence relation
an = 4an–1 – 4an–2 + 4n, n ≥ 2, given that a0 = 2 and a1 = 8.
Solution Let the generating function of {an} be G (z).
•
\ G(z) = Â an z n
n= 0
The given recurrence relation is an = 4 an –1 – 4an–2 + 4n
Multiplying both sides of Eq. (10.52) by zn and summing over all n ≥ 2, we have
 an zn = 4  an-1z n – 4  an-2 zn +  4n z n
n≥2 n≥2 n≥2 n≥2
= 4z  an-1zn-1 – 4z  n-2
n-2
fi  an z n 2 a z
n≥2
+ Â 4n z n
n≥2 n≥2 n≥2
•
1 + (1 - 4z)2
fi G(z) =
(1 - 4z)(1 - 2z)2
To split this, we use the partial fraction technique.
1 + (1 - 4z)2 A B C
Let = + +
(1 - 4z)(1 - 2z) 2 (1 - 4z) 1 - 2z (1 - 2z) 2
Equating the numerators on both sides, we get
1 + (1 – 4z)2 = A (1 – 2z)2 + B (1 – 4z) (1 – 2z) + C (1 – 4z)
Substituting z = ½, z = ¼ and z = 0, we get C = –2, A = 4 and B = 0.
4
\ G (z) = +0–
2
1 - 4z (1 - 2z) 2
= 4 (1 – 4z)–1 – 2 (1 – 2z)–2
= 4 [1 + 4z + (4z)2 +◊◊◊+ (4z)n +◊◊◊ – •
– 2 [1 + 2 (2 z) + 3 (2 z)2 + ◊◊◊ + (n + 1) (2n) n + ◊◊◊]
Thus, the required solution is
an = 4(4n) –2 (n +1)2n
fi an = 4n–1– (n +1)2 n+1
Example Use the method of generating function to solve the recurrence relation a n =
an –1 + 2 (n –1) with a0 = 3, n ≥ 1.
Solution Let the generating function for the sequence {an} be given by G (z),
•
\ G (z) = Â an zn
n= 0
 an zn =  an-1zn + Â(2n - 2) zn
n ≥1 n≥1 n≥1
fi  a nzn = z  + 2  nz n – 2  z n
n-1
an-1z
n≥1 n ≥1 n≥1 n≥1
Example Use the generating function to solve the recurrence relation a n = 4an –1 + 3n2
n
,n≥1
with a0 = 4.
Solution Let the generating function of the sequence {an} be G (z).
•
\ G (z) = Â an zn
n= 0
μ
fi (1 – 4z) G (z) – 4 = 3 (2z)
Â
n =1
n(2z)n-1 (since a0 = 4)
= 6 z (1 – 2z)–2
4 6z
fi G (z) = +
(1 - 4z) (1 - 4z)(1 - 2z)2
6z 4 B C
Let = + +
(1 - 4z)(1 - 2z) 2 (1 - 4z) (1 - 2z) (1 - 2z) 2
Equating the numerators on both sides, we get
6 z = A (1 – 2z)2 + B (1 – 4z) (1 – 2z) + C (1 – 4z).
Substituting z = ½, z = ¼ and z = 0 successively, we get
C = –3, A = 6 and B = –3
Eq. (10.56) becomes
10 3
G (z) = – – 3
(1 - 4z) (1 - 2z) (1 - 2z) 2
• • • •
n n n
2, n ≥ 0.
Example Use the generating function to solve the recurrence relation a n+2 – 4an = 9n
A B ÁË 3 ˜¯ 5 -6
ÁË12˜¯ Á ˜
+ Ë4 ¯
= + + + + +
1+ 2z 1- 2z 1- z (1- z) 2
(1- z)3 1+ 2z 1- 2z
(by splitting this according to the partial fraction technique)
k1 k 17 1 5 ¥1 – 6 1
= + 2 – ¥ +
1+ 2z 1- 2z 3 1- z (1- z) 2 (1- z)3
1 1
where k1 = A – and k2 = B –
2 12
• • • • • •
n n n 17 n n n
EXERCISES
Find the closed form expression for the generat- Using the generating function, solve the
ing function of the following sequences: recurrence relation an = 3an–1 + 1, n ≥ 1, given
(a) an = 9 (5n), n ≥ 0 a0 = 1.
(b) an = 7 (–1)n Use the method of generating function to solve
the recurrence relation an +1 – 8an + 16an –1 = 4n,
Obtain partial fraction decompositions and
identify the sequence having the expression n ≥ 1, a0 = 1 and a1 = 8.
5+ 2z Use the generating function to solve the
1- 4z2 as a generating function. recurrence relation an = 5an –1 – 6an –2, with
initial conditions a0 = 6 and a1 = 30.
Use the generating function to solve the
recurrence relation an – 2an–1 – 3an–2 = 0, n ≥ 2, Use the method of generating function to
solve the recurrence relation ak = 4ak–1 – 4ak–2
with a0 = 3 and a1 = 1.
Using the generating function, solve the + k2, with a0 = 2 and a1 = 10.
difference equation a n+2 – 6an +1 + 5an = 0, Use the generating function to solve the
given y0 = 2 and y1 = 6. recurrence relation an +1 + 4a n + 4an –1 = n –1,
n ≥ 1, with a0 = 0 and a1 = 1.