Generating Functions and Recurrence Relations
Generating Functions and Recurrence Relations
Discrete numeric Functions: The functions whose domain is the set of natural numbers
including zero (𝑟 ≥ 0) and whose range is the set of real numbers are called sequences or
discrete numeric functions or simply numeric functions.
(𝑁𝑎𝑡𝑢𝑟𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟𝑠
𝑟=0,1,2,3,….
) ← ( 𝑅𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟𝑠
𝑅
)
Suppose 𝑎0 , 𝑎1 , 𝑎2 , … . . 𝑎𝑟 ….. Denote the value of the functions at 0,1,2,3,……r, …..
For examples: ( 𝒊) 𝑎𝑟 = 2𝑟 , 𝑟 ≥ 0
(ii) 𝑎𝑟 = 7𝑟 3 + 1, 𝑟 ≥ 0
4𝑟, 0≤𝑟≤2
(iii) 𝑎𝑟 = {
2−𝑟 , 𝑟≥3
(A) Sum and product of Numeric functions: We define the operations of “Sum” and
“Product” in the class of numeric functions. The sum of two numeric functions is a
numeric function whose value at r is equal to the sum of the value of the two numeric
functions whose value at r is equal to product of two numeric functions at r.
Let 𝑎𝑟 and 𝑏𝑟 be two numeric functions. The sum is denoted by 𝑎𝑟 + 𝑏𝑟 and product
is denoted by 𝑎𝑟 𝑏𝑟 .
For Example:
0, 0≤𝑟 ≤ 2
𝑎𝑟 = { −𝑟
2 + 7, 𝑟≥3
5 − 2𝑟 , 0 ≤ 𝑟 ≤ 1
𝑏𝑟 = {
𝑟 + 3, 𝑟≥2
𝑡ℎ𝑒𝑛 sum:
5 − 2𝑟 + 0 , 0≤𝑟≤1
𝑎𝑟 + 𝑏𝑟 = { −𝑟 𝑎𝑛𝑑 0 + (2 + 3), 𝑖𝑓 𝑟 = 2
(2 + 7) + (𝑟 + 3), 𝑟≥3
And product is
5 − 2𝑟 . 0 , 0≤𝑟≤1
𝑎𝑟 𝑏𝑟 = { −𝑟 𝑎𝑛𝑑 0. (2 + 3), 𝑖𝑓 𝑟 = 2
(2 + 7). (𝑟 + 3), 𝑟≥3
0, 0≤𝑟 ≤𝑖−1
S i ar = {
𝑎𝑟−𝑖 , 𝑟≥𝑖
For Example:
If
3, 0 ≤ 𝑟 ≤ 13
𝑎𝑟 = {
4, 𝑟 ≥ 14
Then the value of S 6 ar , is
0, 0≤𝑟≤5
S 6 ar = {
𝑎𝑟−6 , 𝑟≥6
S −i ar = {
𝑎𝑟+𝑖 , 𝑟≥0
For Example:
If
3, 0 ≤ 𝑟 ≤ 13
𝑎𝑟 = {
4, 𝑟 ≥ 14
S −6 ar = 𝑎𝑟+6 , 𝑟 ≥ 0
3, 0≤ 𝑟 ≤ 7
{
4, 𝑟 ≥ 8.
(C) Accumulated Sum of a numeric Function: if 𝑎 = 𝑎𝑟 is a numeric function, then
accumulated sum of 𝑎𝑟 is also a numeric function defined as follows:
Accumulated sum of
𝑎𝑟 = ∑𝑟𝑖=0 𝑎𝑖 , where 𝑟 ≥ 0.
Or
𝑏𝑟 = ∑𝑟𝑖=0 𝑎𝑖 , where 𝑟 ≥ 0.
For Example:
If 𝑎𝑟 = 100(1. .07)𝑟 , 𝑟 ≥ 0.
Then accumulated sum of 𝑎𝑟 𝑖𝑠 𝑏𝑟 i.e.
∇ 𝑎𝑟 = 𝑎𝑟 – 𝑎𝑟−1 , 𝑟 ≥ 1
𝑎𝑟 ∗ 𝑏𝑟 = 𝑎0 𝑏𝑟 + 𝑎1 𝑏𝑟−1 + 𝑎2 𝑏𝑟−2 … … + 𝑎𝑟 𝑏0
𝐶𝑟 = ∑ 𝑎𝑘 𝑏𝑟−𝑘
𝑘=0
Generating Functions: There is an alternative way to represent numeric functions.
A numeric function 𝑎 = 𝑎𝑟 can also be represented as (𝑎0 , 𝑎1 , 𝑎2 , … . . 𝑎𝑛 … . . ) the infinite
series
𝐴(𝑧) = 𝑎0 + 𝑎1 𝑧 + 𝑎2 𝑧 2 + 𝑎3 𝑧 3 + ⋯ 𝑎𝑟 𝑧 𝑟 +….
𝐴(𝑧) = 𝑓(𝑧) = ∑∞
𝑟=0 𝑎𝑟 𝑧
𝑟
For Example:
𝐴(𝑧) = 𝑎0 + 𝑎1 𝑧 + 𝑎2 𝑧 2 + 𝑎3 𝑧 3 + ⋯ 𝑎𝑟 𝑧 𝑟 +….
𝑎
𝐴(𝑧) = 1 + 2𝑧 + 22 𝑧 2 + 23 𝑧 3 + ⋯ 2𝑟 𝑧 𝑟 +…., [which is in G.P, 𝑆∞ = 1−𝑟 ]
1
Hence, 𝐴(𝑧) = 1 + 2𝑧 + 22 𝑧 2 + 23 𝑧 3 + ⋯ 2𝑟 𝑧 𝑟 = 1−2𝑧
Remark:
a. (1 − 𝑋)−1 = 1 + 𝑋 + 𝑋 2 + … ..
b. (1 − 𝑋)−2 = 1 + 2𝑋 + 3𝑋 2 + … ..
1
c. ∑∞ 𝑟 𝑟
𝑟=0 𝑎 𝑧 = 1−𝑎𝑧
d. Let 𝐴(𝑧)𝑎𝑛𝑑 𝐵(𝑧) are the generating functions of the numeric functions 𝑎 = {𝑎𝑟 } and
𝑏 = { 𝑏𝑟 } then
e. 𝐶(𝑧) = 𝐴(𝑧) + 𝐵(𝑧) is the generating functions of the numeric functions 𝑎𝑟 + 𝑏𝑟 .
f. 𝐶(𝑧) = 𝛼𝐴(𝑧) is the generating functions of the numeric functions 𝛼𝑎𝑟
g. 𝐶(𝑧) = 𝐴(𝑧) 𝐵(𝑧) is the generating functions of the numeric functions 𝑎𝑟 ∗ 𝑏𝑟 .
Example: Let 𝑎𝑟 = 2𝑟 and 𝑏𝑟 = 3𝑟 . Then find the generating functions of the numeric
functions 𝑎𝑟 + 𝑏𝑟 and 𝑎𝑟 ∗ 𝑏𝑟 .
EXERCISE
Q.1: 𝑎𝑟 = 3. 2𝑟+2 , 𝑟 ≥ 0
Q.2: 𝑎𝑟 = 𝑟 (𝑟 + 1) , 𝑟 ≥ 0
Q.3: 𝑎𝑟 = r. 5𝑟+2 , 𝑟 ≥ 0
Q.4: 𝑎𝑟 = 3𝑟+2 , 𝑟 ≥ 0
𝐴(𝑧) = 𝑓(𝑧) = ∑ 𝑎𝑟 𝑧 𝑟 = ∑ 𝑟 (𝑟 + 1) 𝑧 𝑟
𝑟=0 𝑟=0
Or
𝐴(𝑧) = 0 + 1.2 𝑧 + 2.3 𝑧 2 + 3.4. 𝑧 3 + …..
Or
2z
Thus, (𝑧) = (1−𝑧)3 .
2+3z−6𝑧2
a. 𝐴(𝑧) = .
1−2𝑧
b. 𝐴(𝑧) = (1 + 𝑧)𝑛 + (1 − 𝑧)𝑛 , 𝑛 ∈ 𝑁
Solution: By definition of the generating function of 𝑎𝑟 :
∞
𝐴(𝑧) = 𝑓(𝑧) = ∑ 𝑎𝑟 𝑧 𝑟 =
𝑟=0
2+3z−6𝑧 2
a. Let 𝐴(𝑧) = 1−2𝑧
Now divide (2 + 3z − 6𝑧 2 ) by (1 − 2𝑧) we get
2
𝐴(𝑧) = 3𝑧 + 1−2𝑧
𝑜𝑟
𝐴(𝑧) = 3𝑧 + 2. (1 − 2𝑧)−1
Or
2 ,𝑟 = 0
𝑎𝑟 = { 7, 𝑟 = 1 }
2𝑟+1 , 𝑟 ≥ 2.
Hence,
0 , 𝑖𝑓 𝑟 𝑖𝑠 𝑜𝑑𝑑
𝑎𝑟 = { }
2. 𝑛𝐶𝑟 , 𝑖𝑓 𝑟 𝑖𝑠 𝑒𝑣𝑒𝑛
Q.2: Find the numeric functions to the following generating functions
2
a. 𝐴(𝑧) = 1−4𝑧 2 .
5+2z
b. 𝐴(𝑧) = 1−4𝑧 2
𝑧4
c. 𝐴(𝑧) = 1−4𝑧
1
d. 𝐴(𝑧) = 1−6𝑧+𝑧 2
𝑧5
e. 𝐴(𝑧) = 5−6𝑧+𝑧 2
1
f. 𝐴(𝑧) = 1−𝑧 3
RECURRENCE RELATIONS: Let 𝑎𝑟 = (𝑎0 , 𝑎1 , 𝑎2 , … . . 𝑎𝑟 … . . ) be discrete function. An
equation relating 𝑎𝑟 for any 𝑟 to one or more 𝑎𝑖 𝑠 , 𝑖 < 𝑟 is called a recurrence relation or a
difference equation.
i.e. A recurrence relation for the sequence {𝑎𝑟 } is an equation that relates 𝑎𝑟 in terms of one
or more of the previous terms of the sequence, namely 𝑎0 , 𝑎1 , 𝑎2 , … . . 𝑎𝑟−1 , 𝑟 ≥ 0.
For examples:
Order and degree of recurrence relations: The order of a recurrence relation is defined to be
difference between the highest and lowest subscripts of dependent variable.
(i) Order of = 𝑟 + 2 − 𝑟 = 2
(ii) Order = 𝑥 + 1 − 𝑥 = 1
(iii) 𝑛 − (𝑛 − 1) = 1.
(iv) 𝑟 − (𝑟 − 2)= 2
For examples:
𝑤ℎ𝑒𝑟𝑒 𝑐𝑖 are constants is called a linear recurrence relation of order k- th , provide that
both 𝑐0 𝑎𝑛𝑑 𝑐𝑘 are non-zero.
For example:
1. 2 𝑎𝑟 + 3𝑎𝑟−1 = 3𝑟 , is a linear recurrence relation of first order.
2. 𝑎𝑟 − 5𝑎𝑟−1 + 2𝑎𝑟−2 = 𝑟 2 + 3,a linear recurrence relation of 2nd order.
The total solution of equation (A) is sum of two parts
a. The homogenous solution 𝑎𝑟 (ℎ) which satisfies the equation when RHS
is set to zero.
b. The particular solution 𝑎𝑟 (𝑝) which satisfies the equation with RHS,
𝑓(𝑟).
RULES FOR FIND HOMOGENOUS SOLUTION: CONSIDER the second order linear
recurrence relation:
We get
𝛼 𝑟 + 𝑐1 𝛼 𝑟−1 + 𝑐2 𝛼 𝑟−2 = 0
Or
Examples:
𝛼 3 − 4𝛼 2 − 11𝛼 + 30 = 0
∴ homogenous solution is
EXERCISE:
𝑄. 3: 𝑎𝑟 − 5𝑎𝑟−1 + 6𝑎𝑟−2 = 0.
𝛼 2 − 3𝛼 − 4 = 0
∴ homogenous solution is
𝑝 3𝑟 − 3𝑝 3𝑟−1 − 4𝑝 3𝑟−2 = 3𝑟
𝑜𝑟
𝑡ℎ𝑖𝑠 𝑔𝑖𝑣𝑒𝑠
−9
𝑝= 4
EXERCISE:
𝑄. 3: 𝑎𝑟 − 5𝑎𝑟−1 + 6𝑎𝑟−2 = 2 + 𝑟.