1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5...

23
1 Chapter 4. Generating Fu nction( 生生生生 ) 4.1 生生 4.2 生生 4.3 生生 4.4 生生 box 4.5 Partition 4.6 Ferrers graph
  • date post

    18-Dec-2015
  • Category

    Documents

  • view

    232
  • download

    5

Transcript of 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5...

Page 1: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

1

Chapter 4. Generating Function(生成函數 )

4.1 簡介 4.2組合 4.3排列 4.4相同 box 4.5 Partition 4.6 Ferrers graph

Page 2: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

2

4.1 簡介

不選 c 選 c 選一個 object 選二個 選三個

(1 + ax)(1 + bx)(1 + cx) = 1 + (a + b + c)x + (ab + bc + ca)x2 + abcx3

不選 a 選 a 不選 b 選 b

xi之係數表選 object i個的情形 ?

Page 3: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

3

4.1 簡介

Ordinary generating function:F(x) = a0u0(x) + a1u1(x) + … + arur(x) + …

indicator function必須滿足 : 沒有不同的 sequence (a0, a1, …),有相同 F(x)值

F(x) = a0• 1 + a1(1 + x) + a2(1 – x) + a3(1 + x2) + …

則 sequences (1 3 7 0 0)與(3 2 6 1 1)

F(x) = 1 + 3(1 + x) + 7(1 – x) = 11 – 4x

F(x) =3 + 2(1 + x) + 6(1 – x) = 11 – 4x 有相同之 F(x)值

則此 indicator function 不合

最常使用的 ur(x)為 xr

即 F(x) = a0 + a1x + … + arxr + …

例如:

Page 4: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

4

4.2 組合

(1 + ax)(1 + bx)(1 + cx)

令 a = b = c = 1

(1 + x)(1 + x)(1 + x) = 1 + 3x + 3x2 + x3

若為 ordinary generating function ordinary enumerator

(1+x)n = c(n, 0) + c(n, 1)x + … + c(n, n)xn

xr之係數為 c(n, r)

選出 r個 object之個數

令 x = 1可推出

2n = c(n, 0) + … + c(n, n)

令 x = -1可推出

...)()(...)()( n3

n1

n2

n0

Page 5: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

5

4.2 組合

例 1. 証明

)()...()...()()( 2nn

2nn

2nr

2n1

2n0

例 2.

The number of 8-digit binary sequences which are such that the number 0’s

in the first 4 digits of a sequences is equal to the number of 0’s in the last 4

digits of the sequences is

例 3.證明

1nnn

nr

n2

n1 n2)n( ...)r(...)2()(

Page 6: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

6

4.2 組合

例 4.證明

1nnnn

nr

n1

n0 n22)1)((n...)1)((r...)2()(

例 5.

Show that the ordinary generating function of the sequences

.)..)...()()(( 2rr

42

21

00 is 2

1

4x)(1

Page 7: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

7

4.2 組合

重覆組合

(1) (1 + ax + a2x2) (1 + bx) (1 + cx)

不選 a 選一個 a 選 2個 a

enumerator (1 + x + x2) (1 + x) (1 + x) = 1 + 3x + 4x2 + 3x3 + x4

(2) (1 + ax) (1 + a2x) (1 + bx) (1 + cx)

不選 a 選 a 不選 a2 選 a2

相當於

Page 8: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

8

4.2 組合

重覆組合

例 1. Given two each of p kinds of objects and one each of q additional kinds of

objects, in how many ways can r objects be selected?

例 2. 2種物件,每種 2個,另 1種物件每種 3個,選出 5個物件的方法?

例 3. 求 n個物件重覆選出 r個之 ordinary enumerator

例 4 . 5個相同的球放入 2個不同 box,box為 1~3個球,則有多少種?

例 5:r個相同的球,放入 2個不同 box,一個 box為 1~3球,另一個 2~4球,若3 r 7則有多少種?

Page 9: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

9

4.2 組合

重覆組合

例 6. r個相同的球,放入 n個不同的 box每個 box的球介於 9 ~ 9 + z - 1個

例 7. [高考 86] 擲骰子 4次,和為 17之方法有多少種?

Page 10: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

10

4.3 排列組合時:F(x) = C(n, 0) + C(n, 1)x + …+ C(n, r)xr + C(n, n)xn

=(1 + x)n

排列 F(x) = p(n, 0) + p(n, 1)x + …+ p(n, n)xn

沒有 close form

another way

nrn xn

nnpx

r

rnpx

npx

npx

!

),(...

!

),(...

!2

)2,(

!1

)1,(1)1( 2

令 F(x) = ...)(!

...)(!1

)(!0 1

10

0 xur

axu

axu

ar

r

為 exponential generating function

*exponential enumerator

(1 + x)n的!r

x r

係數為 P(n, r)

Page 11: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

11

4.3 排列例 1.(a)求(p(0, 0), p(2, 1), …p(2r, r)…)之 exponential generating function.

0 0 0

),2(!!

)!2(

!

),2(

i i i

iii xiiCxii

ix

i

iip

2

1

)41(

x

(b) 求(1, 1, …1, …)之 exponential generating function

xexx ...!2

1

!1

11 2

Page 12: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

12

4.3 排列

(c) 求(1, -1, 1, -1,…1, -1,…)之 exponential generating function

xexx ...!2

1

!1

1-1 2

(d) 求(1, 0, 1, 0,…1, 0,…)之 exponential generating function

2/)( xx ee

(e) 求(0, 1, 0, 1,…0, 1,…)之 exponential generating function

2/)( xx ee

Page 13: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

13

4.3 排列一種物件,每種一個排列之 exponential enumerator為

1+ x

不選 選

n種物件每種一個排列之 exponential enumerator

(1+x) (1+x) …(1+x) = (1+x)n

一種物件,有 p個(相同)之 exponential enumerator

pxp

xx!

1...

!2

1

!1

11 2

例 2有(p + q)個物件,其中 P個一類,q個為另一類,選出 r個排列,其 exponential

enumerator為何?

Page 14: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

14

4.3 排列類 2.2.有 5個物件,2個一類,另 3個一類,則選出 5個排列的方法有多少種?

例 3. n個物件重覆取出 r個排列之 exponential enumerator?

[解法]

0

2

!)(...)

!2

11(

r

rr

nxnxn xr

neexx

例 4. Find the number of r-digit quaternary sequences in which each of the digits 1, 2,

and 3 appears at least once.

例 5. Find the number of r-digit quaternary (0,1 ,2 ,3 ) sequences that contain an even

number of 0’s

例 6. r個或小於 r個不同的球放入 n個 boxes且 order要考慮

Page 15: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

15

4.4 相同 box

S(r, n): r個不同的球放入 n個相同的 box且 no box is empty, r n

導法: r個不同的球放入 n個不同的 box且 no box is empty

n

ba

xn ex

x )1(...)!2

(2

0 0

)()()(i

n

i

iinni

inini

n bababa

0 0

0 0

0

))(()1(!

))(!

1()1)((

)()1)((

r

n

i

rni

ir

n

i r

rrini

i

inxini

inr

x

xinr

e

Page 16: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

16

4.4 相同 box

n

i

rni

i in0

))(()1( = n!S(r, n)

∴ S(r, n)

n

i

rni

i rnn

def

0

))(()1(!

1

Stirling number of the second kind

例1. r個不同的球放入 n個相同的 box,但 box允許空的

1)1( xee 之!r

x r

之係數

Page 17: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

17

4.5 Partition

4之 partition

1111

112

22

13

4

a partition of the integer n

n 個相同的球放入 n個相同的 box, 且 box可以為空

1+2+3+2+1

2

42

63

1

1

1

xx

xx

xx

x

x

2

22

3x

o

o o o

Page 18: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

18

4.5 Partition

係數之 111

1

1111

2

3422

nn

n

xxxx

xxxxxxxF

若 r 個相同的球放入 n 個相同的 box 且 box 至多有 3 個球 :

係數之 111

1

32rx

xxxxF

partition the integer r such that the parts do not exceed 3.

Page 19: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

19

4.5 Partition

例1. 將整數 n分割, 且每個分割均為奇數

n 個相同的球, 放入 n個相同的 box, box容量 0, 1, 3, 5, 例2. [證明 : 整數 n 分割(part)成奇數分割(odd parts) = 整數 n 分割成不同分

割(distinct parts)

例3. 證明 : 任何整數之二進位表示法唯一

例 4. 證明任何整數之十進位表示法唯一

Find a generating function for the number of partitions of the integer n into summands where (a) each summand must appear an even number of times(b) Each summand must be even

Page 20: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

20

4.6 Ferrers graph

consists of rows of dotsThe dots are arranged in such a way that an upper row has at least as many dots as lower row.

6

3

3

2

111344

partition 2336

Page 21: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

21

4.6 Ferrers graph From Ferrers graph, 一個整數分成 m 部分等於分成的各部分的最大值 m

24

1122

114

1113

一個整數分成最多 m 部分

= 分成的各部分值 m

一個整數分成剛好 m 部分之 ordinary enumerator

m

m

mm

xx

x

xxxxxx

11

111

1 -

111

1122

Page 22: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

22

4.6 Ferrers graph

一個整數 n分成剛好 m 個不同 parts

+ (m-1) dots

+(m-2) dots

(m-3)

.

. .

. 1

0

2

1

mmn n

parts m 個不同

Page 23: 1 Chapter 4. Generating Function( 生成函數 ) 4.1 簡介 4.2 組合 4.3 排列 4.4 相同 box 4.5 Partition 4.6 Ferrers graph.

23

4.6 Ferrers graph

整數

2

1

mmn 分成 m parts

11對 整數 n 分成 m 個不同 parts

係數之 11

2

1n

mm

m

m

xxxx

x