17
Tucker, Section 6.2 1 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Embed Size (px)

Citation preview

Page 1: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 1

Section 6.2Calculating Coefficients

Of Generating Functions

Aaron Desrochers

Ben Epstein

Colleen Raimondi

Page 2: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 2

• This chapter is about developing algebraic techniques for calculating the coefficients of generating functions.

• All methods seek to reduce a given generating function to a simple binomial –type generating function, or a product of binomial-type generating functions.

Calculating Coefficients Of Generating Functions

Page 3: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 3

2(1 ) 1 ( ,1) ( , 2) ... ( 1) ( , ) ... ( 1) ( , )m n m m k km n nmx C n x C n x C n k x C n n x

121

1 ...1

mmx

x x xx

1)

211 ...

1x x

x

2)

2(1 ) 1 ( ,1) ( , 2) ... ( , ) ... ( , )n r nx C n x C n x C n r x C n n x 3)

4)

211 (1 1,1) (2 1,2) ... ( 1, ) ...

(1 )r

nC n x C n x C r n r x

x

5)

6) If h(x)=f(x)g(x), where f(x) and g(x) , then

h(x)

20 1 2 ...a a x a x 2

0 1 2 ...b b x b x

20 0 1 0 0 1 2 0 1 1 0 2 0 1 1 2 2 0( ) ( ) ... ( ... ) ...r

r r r ra b a b a b x a b a b a b x a b a b a b a b x

Polynomial Expansions:

Page 4: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 4

• The rule for multiplication of generating functions in Eqn. (6) is simply the standard formula for polynomial multiplication.

6) If h(x)=f(x)g(x), where f(x) and g(x) , then

h(x)

20 1 2 ...a a x a x 2

0 1 2 ...b b x b x

20 0 1 0 0 1 2 0 1 1 0 2 0 1 1 2 2 0( ) ( ) ... ( ... ) ...r

r r r ra b a b a b x a b a b a b x a b a b a b a b x

Page 5: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 5

•Identity (1) can be verified by polynomial “long division”.

•We restate it, multiplying both sides of Eq.(1) by

As

(1 )x1 2(1 ) (1 )(1 ... )m mx x x x x

We verify that the product of the right-hand side is by “long multiplication”

1(1 )mx

21 ...

1

mx x x

x

21 ... mx x x 2 3 1... m mx x x x x

1mx 1

121

1 ...1

mmx

x x xx

1)

Page 6: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 6

• If m is made infinitely large, so that becomes the infinite series then the multiplication process will yield a power series in which the coefficient of each is zero.

We conclude that ( )=1

[Numerically, this equation is valid for ;the “remainder” term

Goes to zero as m becomes infinite.]

Dividing both sides of this equation by (1 – X) yields identity (2).

21 ... mx x x 21 ...x x

, 0kx k

(1 )x 21 ...x x 1x

1mx

211 ...

1x x

x

2)1

211 ...

1

mmx

x x xx

1)

Page 7: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 7

Expansion (3), the binomial expansion was explained at the start

of section 6.1. Expansion (4) is obtained from (3) by expanding

2(1 ( )] 1 ( ) ( )1 2

( ) ( )

m n m m

m k m n

n nx x x

n nx x

k n

(1 ) ,m my where y x

2(1 ) 1 ( ,1) ( , 2) ... ( , ) ... ( , )n r nx C n x C n x C n r x C n n x 3)

Page 8: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 8

For identity 5, ( 1 – x)-n = = ( 1 + x + x2 + … ) n

Since = ( 1 + x + x2 + … ) (eq. 2)

Let us determine the coefficient in equation (7) by counting the number of formal products whose sum of exponents is r, if ei represents the exponent of the ith term in a formal product , the the number of formal products whose exponents sum to r is the same as the number of integer solutions to the equation

In example 5, section 5.4 we showed that the number of nonnegative integer solutions to this equation is C(r + n –1,r ) , so the coefficient in eqn (7) is C(r + n –1,r ) . This verifies expansion (5).

rx

31 2 ne ee ex x x x

1 2 3 0n ie e e e r e

rx

211 (1 1,1) (2 1,2) ... ( 1, ) ...

(1 )r

nC n x C n x C r n r x

x

5)

211 ...

1x x

x

2)1 - x

1

1 - x

1 n

Page 9: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 9

With formulas (1) and (6) we can determine the coefficients of a variety of generating functions: first, perform algebraic manipulations to reduce a given generating function to one of the forms or a product of two such expansions, then use expansions (3) and (5) and the product rule (6) to obtain any desired coefficient.

(1 ) , (1 ) , (1 )m m n nx x or x

6) If h(x)=f(x)g(x), where f(x) and g(x) , then

h(x)

20 1 2 ...a a x a x 2

0 1 2 ...b b x b x

20 0 1 0 0 1 2 0 1 1 0 2 0 1 1 2 2 0( ) ( ) ... ( ... ) ...r

r r r ra b a b a b x a b a b a b x a b a b a b a b x

121

1 ...1

mmx

x x xx

1)

2(1 ) 1 ( ,1) ( , 2) ... ( , ) ... ( , )n r nx C n x C n x C n r x C n n x 3)

211 (1 1,1) (2 1,2) ... ( 1, ) ...

(1 )r

nC n x C n x C r n r x

x

5)

Page 10: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 10

Example 1

Find the coefficient of

16 2 3 4 5( )x in x x x

To simplify the expression, we extract from each polynomial factor and the apply identity (2).

2x

2 3 4 5 2 2 5

10 2 5

105

( ) [ (1 )]

(1 )

1

(1 )

x x x x x x

x x x

xx

Thus the coefficient of is the coefficient of 16 2 3 4 5( )x in x x x

16 10 5 6 5

10 16 10 5

(1 ) [ . , (1 )

(1 ) ]

x in x x i e the x termin x is

multiplied by x tobecomethe x termin x x

x16 in x10 (1-x) –5 [i.e., the x6 term in (1-x) –5 is multiplied by to become the x16 term in x10 (1-x) –5 ]

Page 11: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 11

Example 1 continued

From expansion (5) we see that the coefficient of

More generally, the coefficient of xr in

6 5(1 ) (6 5 1,6)x in x isC

211 (1 1,1) (2 1,2) ... ( 1, ) ...

(1 )r

nC n x C n x C r n r x

x

5)

10 5 10

5

in (1 ) equals thecoefficient of in

(1 ) , namely, (( 10) 5 1, ( 10)).

r rx x x x

x C r r

Page 12: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 12

Example 2

(1+x)19 = 1 + x + x2+ … + xr+ … + x19( ) ( ) ( ) ( )19 19 1919191 2 r

Use generating functions to find the number of ways to collect $15 from 20 distinct people if each of the first 19 people can give a dollar (or nothing) and the twentieth person can giver either $1 or $5 (or nothing).

The generating function for the number of ways to collect r dollars from these people is (1+x)19(1+x+x 5). We want the coefficient of x15. The first part of this generating function has the binomial expansion

If we let f(x) be this first polynomial and let g(x) = 1+x+x5, then we can use Eq. (6) to calculate the coefficient of x15 in h(x) = f(x)g(x). Let ar be the coefficient of xr in f(x) in f(x) and br the coefficient of xr in g(x). We know that

ar = and that b0 = b1 = b5 = 1 (other bis are zero).( )19r

6) If h(x)=f(x)g(x), where f(x) and g(x) , then

h(x)

20 1 2 ...a a x a x 2

0 1 2 ...b b x b x

20 0 1 0 0 1 2 0 1 1 0 2 0 1 1 2 2 0( ) ( ) ... ( ... ) ...r

r r r ra b a b a b x a b a b a b x a b a b a b a b x

Page 13: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 13

Example 2 continued

Then the coefficient of of x15 in h(x) is

a15b0 + a14b1 + a13b2 + … + a0b15

Which reduces to

a15b0 + a14b1 + a10b5

Since b0, b1, b5 are the only nonzero coefficients in g(x). Substituting the values of the various as and bs in Eq. (6), we have

( )1915 x 1 + x 1 + x 1 = + + .( )19

14 ( )1910 ( )19

15 ( )1914 ( )19

10

6) If h(x)=f(x)g(x), where f(x) and g(x) , then

h(x)

20 1 2 ...a a x a x 2

0 1 2 ...b b x b x

20 0 1 0 0 1 2 0 1 1 0 2 0 1 1 2 2 0( ) ( ) ... ( ... ) ...r

r r r ra b a b a b x a b a b a b x a b a b a b a b x

Page 14: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 14

Class ProblemHow many ways are there to select 25 toys from seven types of toys with between two and six of each type?

2(1 ) 1 ( ,1) ( , 2) ... ( 1) ( , ) ... ( 1) ( , )m n m m k km n nmx C n x C n x C n k x C n n x

121

1 ...1

mmx

x x xx

1)21

1 ...1

x xx

2)

2(1 ) 1 ( ,1) ( , 2) ... ( , ) ... ( , )n r nx C n x C n x C n r x C n n x 3)

4)

211 (1 1,1) (2 1,2) ... ( 1, ) ...

(1 )r

nC n x C n x C r n r x

x

5)

6) If h(x)=f(x)g(x), where f(x) and g(x) , then

h(x)

20 1 2 ...a a x a x 2

0 1 2 ...b b x b x

20 0 1 0 0 1 2 0 1 1 0 2 0 1 1 2 2 0( ) ( ) ... ( ... ) ...r

r r r ra b a b a b x a b a b a b x a b a b a b a b x

Page 15: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 15

Class Problem (continued)

The generating function for ar, the number of ways to select r toys from seven types with between 2 and 6 of each type, is

(x2 + x3 + x4 + x5 + x6)7

We want the coefficient of x25. We extract x2 from each factor to get

[x2 (1 + x + x2 + x3 + x4 )]7 = x14 (1 + x + x2 + x3 + x4 )7

Now reduce our problem to finding the coefficient of x 25-14 = x11 in (1 + x + x2 + x3 + x4 )7. Using identity (1), we can rewrite this generating function as

(1 + x + x2 + x3 + x4 )7 = = (1 - x5)7 ( ) ( )1 - x5

1 - x 1 - x

1 77

Page 16: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 16

Class Problem (continued)

Let f(x) = (1 - x5)7 and g(x) = (1 - x5)-7 . By expansions (4) and (5), respectively, we have

f(x) = (1 - x5)7 = 1 - x5 + x10 - x15 + …

g(x) = = 1 + x + x2 + …

+ xr + …

( ) ( ) ( )

( )

( ) ( ) ( )71

72

73

1 + 7 – 1 2 + 7 – 1

r + 7 – 1

1 2

r

1 - x

1

121

1 ...1

mmx

x x xx

1)

Page 17: Tucker, Section 6.21 Section 6.2 Calculating Coefficients Of Generating Functions Aaron Desrochers Ben Epstein Colleen Raimondi

Tucker, Section 6.2 17

Class Problem (continued)

To find the coefficient of x11, we need to consider only the terms in the product

of the two polynomials (1 - x5)7 and that yield x11. The only nonzero

coefficients in f(x) = (1 - x5)7 with subscript < 11 (larger subscripts can be ignored) are a0, a5, and a10. The products involving these three coefficients that yield x11 terms are:

( )1 - x1

a0b11 + a5b6 + a10b1

= 1 x + - x + x .

( ) ( ) ( ) ( )( )( )11 + 7 – 111

71

72

6 + 7 – 16

1 + 7 – 11