0% found this document useful (0 votes)
16 views38 pages

Power Point DM Unit-4 - Part-1

Uploaded by

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

Power Point DM Unit-4 - Part-1

Uploaded by

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

Discrete Mathematics

Unit-4
Advanced Counting Techniques
Generating Functions

Definition.
Let A= n n  0 = a0 , a1 , a2 ,    , an ,     

{a }
be the sequence. Then its generating function is
defined to be

A x    a n x n  a0  a1 x  a 2 x 2       
n0
Example
n 
The generating function of the sequence {3 } is n 0

A  x  1  3 x  3 x  3 x        3 x      
2 2 3 3 n n
Problem
Find the generating function of the sequence
(1,1,1,1,1,1)
Solution
Ax  1  1x  12 x 2  13 x 3 14 x 4  15 x 5
Ax  1  x  x 2  x 3  x 4  x 5
Closed form expressions for generating functions
Problem
Find the closed form expression for the generating
function of the sequence
an  4 , n  0
Solution
The generating function of the sequence is
Ax   4  4 x  4 x 2  4 x 3        4 x n       

Ax   4(1  x  x  x        x       )
2 3 n

= 41  x 
1 4

1 x
Problem
Find the generating function of the following
sequence 0,1,2,3, -------
Solution
Generating function is
0 1 x  2 x  3 x       
2 3

 x(1  2 x  3 x      )
2

 x 1  x 
2 x

1  x 2
Problem
Find the generating function of the following
sequence
12 , 2 2 , 32 , 4 2       
Solution
we have
x
1x  2 x  3 x       
2 3

1  x 2
Differentiating both sides with respect to ‘x’

1  2 (2 x)  3(3 x 2 )       
d  x 
  
dx 
 1  x 2 


1  x  1 x 21  x   1
2

1  x 4

1  x 1  x  2 x 
1  x 4

1  x
1  x 3
 1  2 (2 x)  3(3 x )       
2

1 x

(1  x) 3

which is the generating function for


12 , 2 2 , 32 , 4 2       
The Extended Binomial Theorem
x 1
Let x be areal number with and let ‘n’ be a

1  x    nCr
n
xr
real number .Then r 0
Result

 n Cr   1 n  r  1Cr
r
Result

The generating function for 1  x 


n
and
1  x  n
, where ‘n’ is a positive integer using
the extended Binomial theorem

 n  r  1C

 

1  x    n Cr x    1
n r
r
r xr
r 0 r 0

1  x n    n  r  1Cr x r

r 0
Calculating coefficient of generating function
Problem
27
Find the coefficient of x in
x 4
 x  x  
5 6

5
Solution


We have x  x  x      =
4 5 6

5

x  1  x  x  x        =
4 5 2 3 5

x 1  x  = x  1  x  


20 1 5 20 5
by using the result

 n  r  1Cr x r

1  x 
n

r 0

 

we get  x   20
r 0
5  r  1 Cr x r

x    


20 4  r Cr x r
r 0

 

 4  r Cr x 20 r
r 0
27
x so
we have to find coefficient of
Take 20+r =27, then r=7

 the coefficient of x 27 is

4  7  C 7  11 C7 
11!
 330
7!4!
Problem
20
x
Find the coefficient of in

x  x  2 x  x  x  x  x     
2 3 4 2 3 4 5
Solution
We have

x x 2x x2 3 4
 x 2
 x  x  
3 4
5


 x 1  x  2x  x 2 3
x  1  x  x
2 5 2
    
5


 x11 1  x  2 x 2  x 3 1  x    1 5


 x11 1  x  2 x 2  x 3 1  x  5

1  x  2 x   5  r  1C

 x 11 2
x 3
r xr
r 0
20
x
coefficient of in

x  x 2
2x x
3 4
 x 2 3 4

5
 x  x      is

4  9 C 9  4  8 C 8  2 4  7 C 7  4  6 C 6

 13 C 9  12 C 8  2 11 C 7  10 C 6


Rule of counting
Suppose we wish to determine the number of
integer solutions of equation
e1  e2  e3       en  r

where 0r n
under the constraint that
e1 can take the integer values
a11 , a12 , a13      

e2 can take the integer values


a21 , a22 , a23      
-----------------------------------------

e1 can take the integer values


a n1 , a n 2 , a n 3      
To solve this problem, first we define the
functions
f1 x , f 2 x ,        , f n x  as follows

f1 x   x a11
x a12
x a13
      

f 2 x   x a2 1  x a2 2  x a2 3        
---------------------

 
fn x  x a n1
x an 2
x an 3

and consider f  x  as
f x   f1 x  f 2 x       f n x 
r
and determine the coefficient of x in this
function.
This coefficient happens to be the number of
solutions that we desired to find.

The function f  x  is called the generating


function for the problem
Problem
Find a the generating function that determines
the number of integral solutions of the
equation
e1  e2  e3  r if ei  0 for each “ i ”
Solution

Given that each ei  0 so 1,2,3,---------


generating function is given by
f  x   f1  x  f 2  x  f 3  x 

that is

 
f ( x)  x1  x 2  x3         
x  x  x        
1 2 3

x  x  x        
1 2 3

f ( x)  x  x  x         
3

1 2 3
Problem
Using generating function find the number of

1)non negative and 2)positive integral solutions of


the equation e1  e2  e3  e4  25
1) In case of non-negative integer solutions,
ei ' s can take the values 0,1,2,3-------
accordingly we can write
f i x   x  x  x  x  x      
0 1 2 3 4

for i  1, 2, 3, 4
The generating function for the number of non
–negative integer solution is
f ( x)  f 1  x  f 2  x  f 3  x  f 4  x 
f (x)  1  x  x 2  x 3       
1  x  x  x       
2 3

1  x  x  x       
2 3

1  x  x  x      
2 3

 1  x  x  x       
2 3 4

 1  x 
1 4
 1  x  
4
by using the result

1  x     n  r  1C

n
r xr
r 0
we get

 

 1  x  4   4  r  1 Cr x r
r 0

 

  3  r Cr x r
r 0

x r  x 25 r  25
Taking we get
 x 25
The coefficient of is

3  25 C 25  28 C25 
28!
 3276
25!3!
Thus, the given equation has 3276 non negative
integer solutions
2)In the case of positive integer solutions,

ei ' s can take the values 1,2,3,4 -------


accordingly
we can write
f i  x   x1  x 2  x 3  x 4      

for i  1, 2, 3, 4
The generating function for the number of
positive integeral solutions is
f ( x)  f 1  x  f 2  x  f 3  x  f 4  x 
f (x)  x  x 2  x 3  x 4       
x  x  x  x       
2 3 4

x  x  x  x       
2 3 4

x  x  x  x     
2 3 4
 x  x  x  x     
2 3 4 4

x 1  x  x  x      
4
 4 2 3

x 4
1 x  1 4

x 4
1  x 
4
by using the result

1  x n    n  r  1Cr x r

r 0
we get

  4  r  1C


 x 4 1  x 
4
 x 4
r x r

r 0

   3  r C

4 r
r x
r 0
take 4+r=25
which gives r = 25-4 = 21
 x 25
The coefficient of is

3  21 C 21  24 C21 
24!
 2024
21!3!

You might also like