You are on page 1of 24

Topics to be Covered

 Ordinary Generating Functions


 Definition
 Operations on
 Scaling
 Addition
 Shifting
 Differentiation
 Convolution

1
Generating Functions
The generating function for the sequence a 0, a1, a 2… is the expression
f(x) = a0 + a1 x + a2 x 2 + … .. = ∑ an x n
n≥0

Generating functions of this type are called Ordinary Generating Functions

Examples
1. The generating function for the sequence of natural numbers is
f(x) = 1 + 2 x + 3x 2 + 4 x 3 … ..
2. The generating function for the arithmetic sequence 1, 4, 7, 10 is
f(x) = 1 + 4 x + 7 x 2 + 10 x 3 … ..

2
Special examples
Examples
1. The generating function for the sequence 1,1,1,1,1...
f(x) = ∑ x
n ≥0
n
= 1 + 1 x + 1 x 2
+ 1 x 3
+…

Recall… If r lies between -1 and +1, i.e. |r|<1,


the rn approaches zero as n increases, and the
sum to infinity of the GP
a + ar +ar2+…+arn-1+… = a / (1-r)
Now,
1
f ( x) = (sum of a GP as n → ∞)
1− x 3
Determining Generating Functions for
Sequences
 How can we manipulate generating
functions so that we may find out
generating functions for other sequences.
 Lets now look at some operations on and
the algebra of generating functions

4
Scaling
 Scaling - multiplying a generating
function by a constant scales every
term in the associated sequence by the
same constant.
Examples
1
2
generates the sequence { 1,0,1,0,….}
1-x
2
2
generates the sequence { 2,0,2,0,….}
1-x
5
Scaling Rule
If F(x) generates the sequence {f 0 ,f1,f 2 ,… },
then cF(x) generates the sequence {cf 0 ,cf1,cf 2 ,… }

Proof,
{cf 0 ,cf1,cf 2 ,… } < - > cf 0 + cf1 x + cf 2 x 2 + …
= c(f 0 + f1 x + f 2 x + ...)
2

= cF(x)
6
Addition Rule
Adding generating functions corresponds to adding
the two sequences term by term.
Example :
1
= { 1,1,1,1,… }…………………………(a)
1-x
1
= { 1,-1,1,-1,… }…………………….(b)
1+ x
a + b gives
2
2
= { 2,0,2,0,… }
1-x 7
Addition Rule
If F(x) generates the sequence {f 0 ,f1,f 2 ,… },
and G(x) generates the sequence {g0 ,g1,g 2 ,… }
Then
F(x) + G(x) < - > {f 0 + g0 , f1 + g1 , f 2 + g 2 ,... }
Proof
{f 0 + g0 , f1 + g1 , f 2 + g 2 ,... } < - > ∑ n n
(f
n →∞
+ g )x n

= ∑ n +
f x
n →∞
n
∑ n
g
n →∞
x n

= F(x) + G(x)
8
Right Shifting

Adding k leading zeros to the sequence corresponds


to multiplying the generating function by x k .
If
{f 0 ,f1,f 2 ,… } < - > F(x),
Then
{ 0 ,0 ,… ,0 ,f 0 ,f1,f 2 ,… } < - > x k F(x)

9
Right Shifting
Proof
{ 0,0,… ,0,f 0 ,f1,f 2 ,… } < - > f 0 x k + f1 x k +1 + f 2 x k + 2 + …
k = x (f 0 + f1 x + f 2 x + … )
k 2

= x k F(x)

10
Differentiation
d d  1 
(1 + x + x + x + x + … ) =
2 3 4
 
dx dx  1-x 
1
1 + 2 x + 3x + 4 x + … =
2 3

( 1-x)2
Therefore the generating function for the sequence
1
of natural numbers 1,2 ,3,4 ,5,… is 2
( 1-x)
11
Differentiation
 In general, differentiating a generating
function has two effects on the
corresponding sequence:
1. Each term is multiplied by its index
2. The entire sequence is shifted left one
place

12
Differentiation

If {f 0 ,f1,f 2 ,… } < - > F(x)


Then {f1,2 f 2 ,3 f 3 ,… } < - > F’(x)

Proof
{f1,2 f 2 ,3 f 3 ,… } = f1 + 2 f 2 x + 3 f 3 x 3 + …
d
= (f 0 + f1 x + f 2 x 2 + f 3 x 3 + … )
dx
= F’(x)
13
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}

14
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}
Solution :
1
{1,1,1,1…} < - >
(1 - x)
(different iating)

15
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}
Solution :
1
{1,1,1,1…} < - > (different iating)
(1 - x)
1
{1,2,3,4 …} < - >
(1 - x) 2
(right shift)

16
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}
Solution :
1
{1,1,1,1…} < - > (different iating)
(1 - x)
1
{1,2,3,4 …} < - > 2
(right shift)
(1 - x)
x
{0,1,2,3…} < - >
(1 - x) 2
(different iating)

17
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}
Solution :
1
{1,1,1,1…} < - > (different iating)
(1 - x)
1
{1,2,3,4 …} < - > 2
(right shift)
(1 - x)
x
{0,1,2,3…} < - > 2
(different iating)
(1 - x)
1+ x
{1,4,9,16 …} < - >
(1 - x)3
(right shift) 18
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}
Solution :
1
{1,1,1,1…} < - > (different iating)
(1 - x)
1
{1,2,3,4 …} < - > 2
(right shift)
(1 - x)
x
{0,1,2,3…} < - > 2
(different iating)
(1 - x)
1+ x
{1,4,9,16 …} < - > 3
(right shift)
(1 - x)
x(1 + x)
{0,1,4,9,16 …} < - > 19

(1 - x)3
Example – Determining the Generating
function for a sequence
Find the generating function for the sequence of squares.
i.e the generating function for {0,1,4,9,…}

Thus the generating function for squares is


x(1 + x)
(1 - x)3

20
Convolution of Generating Functions
Let A(x) and B(x) be two generating function
then the product A(x)B(x) is called the
convolution of the generating functions
A(x) and B(x)

21
Convolution

Let A(x) = ∑a x
n≥0
n
n
, B(x) = ∑b x
n≥0
n
n

and C(x) = A(x)B(x) = ∑ cn x n

n≥0

22
Convolution Rule
A(x) = ∑ n
a
n≥0
x n

B(x) = ∑n
b
n≥0
x n

 n  n  n
A(x)B(x) =  ∑ an x  ∑ bn x  =  ∑ cn x 
 n≥0  n≥0   n≥0 

where cn = ∑a b
k ≥0
k n−k
23
Topics Covered
 Ordinary Generating Functions
 Definition
 Operations on
 Scaling
 Addition
 Shifting
 Differentiation
 Convolution

24

You might also like