Discrete Mathematics Discrete Mathematics -- Chapter 9: Generating - - PowerPoint PPT Presentation

discrete mathematics discrete mathematics
SMART_READER_LITE
LIVE PREVIEW

Discrete Mathematics Discrete Mathematics -- Chapter 9: Generating - - PowerPoint PPT Presentation

Discrete Mathematics Discrete Mathematics -- Chapter 9: Generating Function Hung-Yu Kao ( ) Department of Computer Science and Information Engineering, N National Cheng Kung University l Ch K U Outline Calculational Techniques


slide-1
SLIDE 1

Discrete Mathematics Discrete Mathematics

  • - Chapter 9: Generating Function

Hung-Yu Kao (高宏宇) Department of Computer Science and Information Engineering, N l Ch K U National Cheng Kung University

slide-2
SLIDE 2

Outline

Calculational Techniques Partitions of Integers Partitions of Integers The Exponential Generating Function The Summation Operator

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

2

slide-3
SLIDE 3

Enumeration again

Chapter 1: c1+c2+c3+c4=25, where ci>= 0 Chapter 8: c +c +c +c =25 where 10>c >= 0 Chapter 8: c1+c2+c3+c4=25, where 10>ci>= 0 In chapter 9, c2 to be even and c3 to be a multiple

f

  • f 3

the coefficient xy2 in (x+y)3

th ffi i t

4 i ( + 2)( 2+ 3+ 4)(1+ +2 2)

the coefficient x4 in (x+x2)(x2+x3+x4)(1+x+2x2)

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

3

slide-4
SLIDE 4

9.1 Introductory Examples

  • Ex 9.1 :
  • One mother buys 12 oranges

f th hild G M for three children, Grace, Mary, and Frank.

  • Grace gets at least four, and Mary and Frank gets at least two,
  • Grace gets at least four, and Mary and Frank gets at least two,

but Frank gets no more than five.

  • Solution
  • Generating function:

f( ) ( 4+

5+ 6+ 7+ 8)( 2+ 3+ 4+ 5+ 6)( 2+ 3+ 4+ 5)

5 2 and , 2 , 4 where , 12

3 2 1 3 2 1

≤ ≤ ≤ ≤ = + + c c c c c c

f(x) = (x4+ x5+ x6+ x7+ x8)(x2+ x3+x4+ x5+ x6)(x2+ x3+x4+ x5) product xjxjxk → every triple (i, j, k)

  • The coefficient of x12 in f(x) yields the solution.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

4

f( ) y

slide-5
SLIDE 5

Introductory Examples

  • Ex 9.2 :
  • There is an unlimited number of red, green, white, and black jelly

beans. beans.

  • In how many ways can we select 24 jelly beans so that we have an

even number of white beans and at least six black ones?

  • Solution
  • Solution
  • red (green): 1+ x1+ x2+….+ x23+ x24
  • white: 1+ x2+ x4+….+ x22+ x24
  • black: x6+ x7+….+ x23+ x24
  • Generating function:

f(x) = (1+ x1+ x2+….+ x23+ x24)2(1+ x2+ x4+….+ x22+ x24) f(x) (1 x x …. x x ) (1 x x …. x x ) (x6+ x7+….+ x23+ x24)

  • The coefficient of x24 in f(x) is the answer.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

5

slide-6
SLIDE 6

Introductory Examples

H ti i t l ti th f

  • Ex 9.3 : How many nonnegative integer solutions are there for

c1+c2+c3+c4 = 25?

  • Solution
  • Alternatively, in how many ways 25 pennies can be distributed among

four children?

  • Generating function:
  • Generating function:

f(x) = (1+ x1+ x2+…+ x24+ x25)4 (polynomial)

  • The coefficient of x25 is the solution.
  • Note:
  • Note:
  • g(x) = (1+ x1+ x2+…+ x24+ x25 + x26+…)4 (power series)

can also generate the answer

  • Easier to compute with a power series than with a polynomial

∞ =

− = ) ( ) (

n n n

c x a x f

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

6

p p p y

slide-7
SLIDE 7

9.2 Definition and Examples: Calculational Techniques

  • Definition 9.1:
  • Ex 9.4 :

so, (1 + x)n is the generating function for the sequence

( ) ( ) ( ) ( )

n n n n n n n

x x x x + ⋅ ⋅ ⋅ + + + = +

2 2 1

) 1 (

, ( ) g g q

( ) ( ) ( ) ( )

⋅ ⋅ ⋅ ⋅ ⋅ ⋅ , , , , , , , ,

2 1 n n n n n

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

7

slide-8
SLIDE 8

Definition and Examples: Calculational p Techniques

  • Ex 9.5 :

a)

(1 - xn+1)/(1 - x) is the generating function for the sequence 1, 1, 1,…, 1, 0, 0, 0,…, where the first n+1 terms are 1.

b)

1/(1 x) is the generating function for the sequence 1 1 1

). 1 )( 1 ( ) 1 (

2 1 n n

x x x x x + ⋅ ⋅ ⋅ + + + − = −

+

Q

b)

1/(1-x) is the generating function for the sequence 1, 1, 1, 1,…

c)

1/(1-x)2 is the generating function for the sequence 1, 2, 3,

⋅ ⋅ ⋅ + + + + = <

− 3 2 1 1

1 , 1 | | while x x x x

x

Q

)

( ) g g q , , , 4,…

⋅ ⋅ ⋅ + + + + = ⋅ ⋅ ⋅ + + + + = = − − − = − =

− − − 3 2 3 2 ) 1 ( 1 2 1 1 1

4 3 2 1 ) 1 ( ) 1 ( ) 1 )( 1 ( ) 1 (

2

x x x x x x x x

dx d x dx d x dx d

Q

d)

x/(1-x)2 is the generating function for the sequence 0,1,2,3,….

− ) 1 (

) (

dx x 4 3 2

4 3 2 1

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

8

⋅ ⋅ ⋅ + + + + + =

− 4 3 2 ) 1 (

4 3 2 1

2

x x x x

x x

Q

slide-9
SLIDE 9

Definition and Examples: Calculational p Techniques

  • Ex 9.5 :

e)

(x+1)/(1-x)3 is the generating function for the sequence

2 2 2 2

12, 22, 32, 42,…

⋅ ⋅ ⋅ + + + + =

− 3 2 ) 1 (

) 3 2 (

2

x x x

dx d x x dx d

Q

2

2 ) 1 (

) 1 (

d d x x dx d

x x

− −

− = Q

⋅ ⋅ ⋅ + + + + =

− + 3 2 2 2 2 ) 1 ( 1

4 3 2 1

3

x x x

x x

3 3

1 2 ) 1 ( 3 2

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

x x x dx

x x x

+ + − − −

= = − − − + − =

3 3

) 1 ( ) 1 ( x x − −

f)

x(x+1)/(1-x)3 is the generating function for the sequence 02, 12, 22, 32, 42,…

+ 3 2 2 2 ) 1 (

3 2 1

x x

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

9

⋅ ⋅ ⋅ + + + + =

− + 3 2 2 2 ) 1 ( ) 1 (

3 2 1

3

x x x

x x x

Q

slide-10
SLIDE 10

Definition and Examples: Calculational p Techniques

  • Ex 9.5 :

g)

Further extensions:

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

10

slide-11
SLIDE 11

Definition and Examples: Calculational p Techniques

  • Ex 9.6 :

a)

1/(1 - ax) is the generating function for the sequence a0, a1, a2,

)

( ) g g q , , , a3,…

b)

f(x) = 1/(1- x) is the generating function for the sequence 1, 1, 1, 1,… Then

  • g(x) = f(x) - x2 is the generating function for the

sequence 1 1 0 1 1 1 sequence 1, 1, 0, 1, 1, 1,…

  • h(x) = f(x) + 2x3 is the generating function for the

sequence 1, 1, 1, 3, 1, 1,… sequence 1, 1, 1, 3, 1, 1,…

c)

Can we find a generating function for the sequence 0, 2, 6, 12, 20, 30, 42,…?

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

11

slide-12
SLIDE 12

Definition and Examples: Calculational p Techniques

  • Ex 9.6 :

c)

20,... 12, 6, 2, 0, Observe , 3 3 12 , 2 2 6 , 1 1 2 , , , , , ,

2 3 2 2 2 1 2

a a a a + = = + = = + = = + = = , 4 4 20 , 3 3 12 , 2 2 6

2 2 4 3 2

n n a a a a + = ∴ ⋅ ⋅ ⋅ + = = + + 3 ) 1 ( 2 3 ) 1 ( ) 1 ( ) 1 ( 2 ) 1 ( 3 ) 1 ( ) 1 ( x x x x x x x x x x x x n n an − = − − + + = − + − + + ∴ function. generating the is ) 1 ( ) 1 ( ) 1 ( ) 1 ( x x x x

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

12

slide-13
SLIDE 13

Extension of Binomial Theorem

  • Binomial theorem:

⎞ ⎛

( ) ( ) ( ) ( ) n

n n n n n n

x x x x + ⋅ ⋅ ⋅ + + + = +

2 2 1

) 1 (

  • When n∈Z+, we have

! ) 1 )...( 2 )( 1 ( )! ( ! ! r r n n n n r n r n r n + − − − = − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛

  • If n∈R, we define

! ) 1 )...( 2 )( 1 ( r r n n n n r n + − − − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⎞ ⎛

  • If n∈Z+, we have

− + + − + − − − − − − − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛− r n n n r r n n n n r n

r

) 1 ) ( 1 )( ( ) 1 ( ! ) 1 )...( 2 )( 1 )( ( ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ − + − = − + − = + + = r n r n r r n n n

r r

1 ) 1 ( ) ( )! 1 ( ) 1 ( ! ) 1 )...( 1 )( ( ) 1 (

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

13

⎠ ⎜ ⎝ − r r n ) ( ! )! 1 (

slide-14
SLIDE 14

Extension of Binomial Theorem

  • Ex 9.7 :

(1-x)-n ?

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

14

slide-15
SLIDE 15

Extension of Binomial Theorem

  • Ex 9.8 : Find the coefficient of x5 in (1-2x)-7.
  • Solution

( )

7 7 ∞

( )

5 7 7

:

  • f

t coefficien The ) 2 ( ) 2 1 ( − = −

∞ = − −

x x x

r r r

( ) ( ) ( )

5 11 5 1 5 7 5 5 5 7

) 32 ( ) 32 ( ) 1 ( ) 2 ( = − − = −

− + −

  • Ex 9.9 : Find the coefficient of all xi in (1+3x)-1/3

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

15

slide-16
SLIDE 16

Definition and Examples: Calculational p Techniques

  • Ex 9.10 : Determine the coefficient of x15 in f(x) =

(x2+x3+x4+…)4.

  • Solution
  • (x2+x3+x4+…) = x2(1+x+x2+…) = x2/(1-x)
  • f(x)=(x2/(1-x))4 = x8/(1-x)4
  • Hence the solution is the coefficient of x7 in (1-x)-4:

C( 4 7)( 1)7 = ( 1)7C(4+7 1 7)( 1)7 = C(10 7) = 120 C(-4, 7)(-1)7 = (-1)7C(4+7-1, 7)(-1)7 = C(10, 7) = 120.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

16

slide-17
SLIDE 17

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

17

slide-18
SLIDE 18

check n=1

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

18

slide-19
SLIDE 19

Definition and Examples: Calculational p Techniques

  • Ex 9.11 : In how many ways can we select, with

repetition allowed, r objects from n distinct objects?

  • Solution
  • For each object (with repetitions), 1+x+x2+… represents the possible

h i f th t bj t ( l t ) choices for that object (namely none, one, two,…)

  • Consider all of the n distinct objects, the generating function is f(x) =

(1+x+x2+…)n

⎞ ⎛ − + ⎞ ⎛ 1 1 1

n

i n

( )

=

⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ − + = − = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − = ⋅ ⋅ ⋅ + + +

2

. 1 ) 1 ( 1 1 1 ) 1 (

i i n

x i i n n x x x x

( )

r n 1 − +

  • The answer is the coefficient of xr in f(x), .

( )

r r n 1 − +

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

19

slide-20
SLIDE 20

Definition and Examples: Calculational p Techniques

  • Ex 9.12 : Counting the compositions of a positive integer n.
  • Solution
  • E.g., n = 4
  • E.g., n 4
  • One-summand: (x1+ x2+x3+x4+…) = [x/(1-x)], coefficient of x4 =1
  • Two-summand: (x1+ x2+x3+x4+…)2 = [x/(1-x)]2, coefficient of x4 =3

Th d ( 1+

2+ 3+ 4+

)3 [ /(1 )]3 ffi i t f

4

3

  • Three-summand: (x1+ x2+x3+x4+…)3 = [x/(1-x)]3, coefficient of x4 =3
  • Four-summand: (x1+ x2+x3+x4+…)4 = [x/(1-x)]4, coefficient of x4 =1
  • The number of compositions of 4: coefficient of x4 in ∑

4 1

)] 1 /( [

i i

x x

∑ =1

)] ( [

i

How about n=5?

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

20

slide-21
SLIDE 21

Definition and Examples: Calculational p Techniques

  • Ex 9.12 : Counting the compositions of a positive integer n.
  • The number of ways to form an integer n is the coefficient of xn in the

following generating function. g g g

∑ ∑

∞ = ∞ =

− = + + +

1 1 3 2 1

)] 1 /( [ ...) (

i i i i

x x x x x

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

21

slide-22
SLIDE 22

Definition and Examples: Calculational p Techniques

  • Ex 9.14 : In how many ways can a police captain distribute 24 rifle

shells to four police officers, so that each officer gets at least three h ll b t t th i ht shells but not more than eight.

  • Solution
  • f(x)= (x3+x4+ x5+ x6+x7+x8)4
  • f(x)= (x +x + x + x +x +x )

= x12(1+x+x2+x3+x4+x5)4 = x12[(1-x6)/(1-x)]4 x [(1 x )/(1 x)]

  • The answer is the coefficient of x12 in (1-x6)4(1-x)-4

( ) ( ) ( ) ( ) ( ) ( )

2 4 4 4 24 18 4 12 4 6 4

( ) ( ) ( ) ( ) ( ) ( )

] ) ( ) ( ][ 1 [

2 2 4 1 4 4 24 18 3 4 12 2 4 6 1 4

⋅ ⋅ ⋅ + − + − + + − + − =

− − −

x x x x x x 125 ] 4 9 4 15 [ ] 4 4 ) 1 ( 4 4 ) 1 ( 4 [

6 12

= ⎞ ⎜ ⎜ ⎛ + ⎞ ⎜ ⎜ ⎛ ⎞ ⎜ ⎜ ⎛ ⎞ ⎜ ⎜ ⎛ = ⎞ ⎜ ⎜ ⎛− ⎞ ⎜ ⎜ ⎛ + ⎞ ⎜ ⎜ ⎛− ⎞ ⎜ ⎜ ⎛ ⎞ ⎜ ⎜ ⎛−

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

22

125 ] 2 6 1 12 [ ] 2 ) 1 ( 6 1 ) 1 ( 12 [ = ⎠ ⎜ ⎜ ⎝ + ⎠ ⎜ ⎜ ⎝ ⎠ ⎜ ⎜ ⎝ − ⎠ ⎜ ⎜ ⎝ = ⎠ ⎜ ⎜ ⎝ ⎠ ⎜ ⎜ ⎝ + − ⎠ ⎜ ⎜ ⎝ ⎠ ⎜ ⎜ ⎝ − − ⎠ ⎜ ⎜ ⎝

slide-23
SLIDE 23

Definition and Examples: Calculational p Techniques

1

  • Ex 9.16 : Determine the coefficient of
  • Solution

. ) 2 )( 3 ( 1 in

2 8

− − x x x

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

23

slide-24
SLIDE 24

Definition and Examples: Calculational p Techniques

E 9 17 H

f l t b t f S {1 2

  • Ex 9.17 : How many four-element subsets of S = {1, 2,…,

15} contains no consecutive integers?

Solution

  • E.g., one subset {1, 3, 7, 10}, 1≤1<3<7<10 ≤15,

difference 0, 2, 4, 3, 5, difference sum = 14.

  • These suggest the integer solutions to c +c +c +c +c =14
  • These suggest the integer solutions to c1+c2+c3+c4+c5 14

where 0 ≤ c1, c5 and 2 ≤ c2, c3, c4.

  • The answer is the coefficient of x14 in

f(x) = (1+x+x2+x3+ )(x2+x3+x4+ )3(1+x+x2+x3+ ) f(x) = (1+x+x +x +…)(x +x +x +…) (1+x+x +x +…) = x6(1-x)-5

  • The coefficient of x8 in (1-x)-5.

495 8 12 8 1 8 5 8 ) 1 ( 8 5 = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ − + = − ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛−

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

24

slide-25
SLIDE 25

Convolution of Sequences

  • Ex 9.19 : Let
  • f(x) = x/(1-x)2 = 0+1x+2x2+3x3+…, for the sequence ak= k
  • g(x) = x(x+1)/(1 x)3 = 0+12x+22x2+32x3+

for the sequence b = k2

  • g(x) = x(x+1)/(1-x)3 = 0+12x+22x2+32x3+ …, for the sequence bk= k2
  • h(x) = f(x)g(x)

= a0b0 + (a0b1+a1b0)x + (a0b2+a1b1+a2b0)x2 + …, for the sequence ck = a0bk+a1bk-1+a2bk-2+ …+ak-2b2+ak-1b1+akb0

  • .

) (

2

∑ =

− =

k i k

i k i c

c0= 0×02 c 0 12 +1 02

∑i

c1= 0×12 +1×02 = 0 c2= 0×22 +1×12+2×02 = 1 c3= 6

  • The sequence c0, c1, c2, … is the convolution of the sequences a0, a1,

a2, … and b0, b1, b2, …

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

25

slide-26
SLIDE 26

Convolution of Sequences

  • Ex 9.20 : Let
  • f(x) = 1/(1-x) = 1+x+x2+x3+ …
  • g(x) = 1/(1+x) = 1-x+x2-x3+ …
  • h(x) = f(x)g(x)

= 1/[(1 x)(1+x)] = 1/(1 x2) = 1+x2+x4+x6+ = 1/[(1-x)(1+x)] = 1/(1-x2) = 1+x2+x4+x6+ …

  • The sequence 1, 0, 1, 0, … is the convolution of the

sequences 1 1 1 1 and 1 1 1 1 sequences 1, 1, 1, 1, … and 1, -1, 1, -1, …

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

26

slide-27
SLIDE 27

9.3 Partition of Integers

( ) th b f titi i iti i t

  • p(n): the number of partitioning a positive integer n
  • The number of 1’s is 0 or 1 or 2 or 3…. The power series is

1

2 3 4

1+x+x2+x3+x4+….

  • The number of 2’s can be kept tracked by the power series

1+x2+x4+x6+x8+….

  • For n, the number of 3’s can be kept tracked by the power series

1+x3+x6+x9+x12+….

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

27

slide-28
SLIDE 28

Partition of Integers

  • Determine p(10)
  • The coefficient of x10 in f(x)

=(1+x+x2+x3+…)(1+x2+x4+x6+…)(1+x3+x6+x9+…)… ( …)( …)( …)… (1+x10+x20+…)

) 1 ( 1 ) 1 ( 1 ) 1 ( 1 ) 1 ( 1 ) 1 ( 1 ) (

10 1 10 3 2 i i

x x x x x x f ∏ = ⋅ ⋅ ⋅ =

=

  • By the coefficient of xn in , we get the sequence

(0) (1) (2) (3)

) 1 ( ) 1 ( ) 1 ( ) 1 ( ) 1 ( x x x x x − − − − −

) 1 ( 1 1

) (

i i

x P

∞ =

∏ =

p(0), p(1), p(2), p(3), …

) 1 ( 1 i x i − Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

28

slide-29
SLIDE 29

Partition of Integers

  • Ex 9.21 : Find the generating function for the number of ways an

advertising agent can purchase n minutes of air time if the time slots come in blocks of 30 60 or 120 seconds slots come in blocks of 30, 60, or 120 seconds.

Solution

  • Let 30 seconds represent one time unit.
  • Find integer solutions to a+2b+4c = 2n
  • Generating function:

f(x)= (1+x+x2+x3+x4+…)(1+x2+x4+x6+x8+…)( 1+x4+x8+x12+…) =

  • Answer: the coefficient of x2n is the number of partitions of 2n into

. ) 1 ( 1 ) 1 ( 1 ) 1 ( 1

4 2

x x x − − −

  • Answer: the coefficient of x2n is the number of partitions of 2n into

1’s, 2’s, and 4’s.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

29

slide-30
SLIDE 30

Partition of Integers

  • Ex 9.22 : Find the generating function for pd(n), the number of partitions of

a positive integer n into distinct summands.

  • One time of occurrence per summand

6 = 1+5 6 = 1+2+3

  • One time of occurrence per summand
  • Pd(x) = (1+x)(1+x2)(1+x3)..…
  • Ex 9.23 : Find the generating function for po(n), the number of partitions of

i i i i dd d

6 1+2+3 6 = 2+4

a positive integer n into odd summands.

  • Po(x) = (1+x+x2+x3+…)(1+x3+x6+…)(1+x5+x10+…)…
  • = 1/(1-x) × 1/(1-x3) × 1/(1-x5) × 1/(1-x7) ×
  • 1/(1 x) × 1/(1 x ) × 1/(1 x ) × 1/(1 x ) × ...
  • Pd(x) = Po(x) ?

6 = 1+1+1+3 6 1 1 1 3 6 = 1+5 6 = 3+3

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

30

slide-31
SLIDE 31

Partition of Integers

  • Ex 9.24 : Find the generating function for the number of

partitions of a positive integer n into odd summands and

  • ccurring an odd number of times.

Solution

6 = 1+1+1+3 6 1+5

f(x) = (1+x+x3+x5+ …)(1+x3+x9+x15+ …) (1+x5+x15+x25+ …)…

6 = 1+5 6 = 3+3

⎞ ⎛

= ∏

∞ = ∞ = + +

⎟ ⎠ ⎞ ⎜ ⎝ ⎛ +

) 1 2 )( 1 2 (

. 1

k i i k

x

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

31

slide-32
SLIDE 32

Partition of Integers

  • Ferrers graph uses rows of dots to represent a partition
  • f an integer
  • In fig. 9.2, two Ferrers graphs are transposed each other

for the partitions of 14.

4

  • (a) 14 = 4+3+3+2+1+1
  • (b) 14 = 6+4+3+1

4

The number of partitions of an integer n into m summands is equal to the number

4

q

  • f partitions of n into summands where

m is the largest summand.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

32

http://mathworld.wolfram.com/FerrersDiagram.html

slide-33
SLIDE 33

9.4 The Exponential Generating F ti Function

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

33

slide-34
SLIDE 34

The Exponential Generating Function

  • Ex 9.25 : Examining the Maclaurin series expansion for

ex, we find

∞ 3 2 i

x x x

∞ =

= ⋅ ⋅ ⋅ + + + + =

0 !

! 3 ! 2 1

i x

i x x x x e

so ex is the exponential generating function for the sequence 1, 1, 1,….

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

34

slide-35
SLIDE 35

The Exponential Generating Function

  • Ex 9.26 : In how many ways can four of the letters in ENGINE be

arranged?

Solution Solution

  • Using exponential generating function: f(x) = [1+x+(x2/2!)]2[1+x]2
  • E, N: [1+x+(x2/2!)]
  • G, I: [1+x]
  • The answer is the coefficient of x4/4!
  • The answer is the coefficient of x /4!.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

35

slide-36
SLIDE 36

The Exponential Generating Function

  • Ex 9.27 : Consider the Maclaurin series expansion of ex

and e-x.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

36

slide-37
SLIDE 37

The Exponential Generating Function

  • Ex 9.28 : A ship carries 48 flags, 12 each of the colors red, white,

blue and black. Twelve flags are placed on a vertical pole to communicate signal to other ships.

  • How many of these signals use an even number of blue flags

and an odd number of black flags?

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

37

slide-38
SLIDE 38

The Exponential Generating Function

  • how many of these use at least three white flags or no white

flag at all?

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

38

slide-39
SLIDE 39

The Exponential Generating Function The Exponential Generating Function

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

39

slide-40
SLIDE 40

The Exponential Generating Function

  • Ex 9.29 : A company hires 11 new employees, and they will

be assigned to four different subdivisions. Each subdivision has at least one ne emplo ee In ho man a s can has at least one new employee. In how many ways can these assignments be made?

  • Solution

Solution

  • Onto function: g: X → Y where |X| = 11, |Y| = 4.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

40

slide-41
SLIDE 41

9.5 The Summation Operator

  • Let f(x) = a0+a1x+a2x2+a3x3+…. Then f(x)/(1-x)

generate the sequence of a0, a0+a1, a0+a1+a2, a0+a1+a2+a3,… So we refer to 1/(1-x) as the summation

  • perator.

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

41

slide-42
SLIDE 42

The Summation Operator

Summation

  • Ex 9.30 :
  • 1/(1-x) is the generating function for the sequence 1, 1, 1, 1,

1

  • perator

1,…

  • [1/(1-x)]× [1/(1-x)] is the generating function for the sequence

1, 1+1, 1+1+1,… ⇒ 1, 2, 3,… + 2 i th ti f ti f th 0 1 1 0 0

  • x+x2 is the generating function for the sequence 0, 1, 1, 0, 0,

0,…

  • (x+x2) × [1/(1-x)] is the generating function for the sequence 0,

1 2 2 2 2 1, 2, 2, 2, 2, …

  • (x+x2)/(1-x)2 is the generating function for the sequence 0, 1, 3,

5, 7, 9, 11, …

  • (x+x2)/(1-x)3 is the generating function for the sequence 0, 1, 4,

9, 16, 25, 36, …

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

42

slide-43
SLIDE 43

The Summation Operator

2 2 2 2

  • Ex 9.31 : Find a formula to express 02+12+22+…+n2 as a function of

n. Solution Solution

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

43

slide-44
SLIDE 44

The Summation Operator

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

44

slide-45
SLIDE 45

Homework

9.1: 9 2: 9.2: 9.3: 9.4: 9 5: 9.5:

Discrete Mathematics Discrete Mathematics – – CH9 CH9 2009 Spring 2009 Spring

45