chapter 2 combinatorial analysis 主講人 : 虞台文. content basic procedure for probability...

117
Chapter 2 Combinatorial Analysis 主主主 : 主主主

Upload: lynne-cain

Post on 13-Jan-2016

239 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

主講人 :虞台文

Page 2: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Content Basic Procedure for Probability Calculation Counting

– Ordered Samples with Replacement– Ordered Samples without Replacement Permutations– Unordered Samples without Replacement Combinations

Binomial Coefficients Some Useful Mathematic Expansions Unordered Samples with Replacement Derangement Calculus

Page 3: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Basic Procedure for

Probability Calculation

Page 4: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Basic Procedure for Probability Calculation

1. Identify the sample space .2. Assign probabilities to certain events

in A, e.g., sample point event P().3. Identify the events of interest.4. Compute the desired probabilities.

Page 5: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Counting

Page 6: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Goal of Counting

Counting the number of elements in a particular set, e.g., a sample space, an event, etc.

? E

?E

Page 7: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Cases

Ordered Samples w/ Replacement

Ordered Samples w/o Replacement

– Permutations

Unordered Samples w/o Replacement

– Combinations

Unordered Samples w/ Replacement

Page 8: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Ordered Samples

with Replacement

Page 9: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Ordered Samples

eat

ate

tea

elements in samples appearing in different orders are considered different.

Page 10: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Ordered Samples w/ Replacement

meet

teem

mete

1. Elements in samples appearing in different orders are considered different.

2. In each sample, elements are allowed repeatedly selected.

Page 11: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Ordered Samples w/ Replacement

Drawing k objects, their order is noted, among n distinct objects with replacement.

The number of possible outcomes is

ndistinctobjects

k

kn

Page 12: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 1

How many possible 16-bit binary words we may have?

2distinctobjects

16 1 16 {0,1}, 1, ,16ia a a i

162

Page 13: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 2

Randomly Choosing k digits from decimal number, Find the probability that the number is a valid octal number.

Randomly Choosing k digits from decimal number, Find the probability that the number is a valid octal number.

1 {0, ,9}, 1, ,k ia a a i k 10k

For any , P()=1/10k.

1 {0, ,7}, 1, ,k iE b b b i k 8kE

1( ) 8

10k

kP E 0.8k

Page 14: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Ordered Samples

without Replacement

Permutations

Page 15: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Permutations

清心

也可

可以清心也以清心也可清心也可以心也可以清也可以清心

可以清心也以清心也可清心也可以心也可以清也可以清心

Page 16: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Ordered Samples w/o Replacement Permutations

Drawing k objects, their order is noted, among n distinct objects without replacement.

The number of possible outcomes is

ndistinctobjects

k

( 1)( 2) ( 1)n n n n k nkP

!

( )!

n

n k

Page 17: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 3

Five letters are to be selected without replacement from the alphabet (size 26) to form a word (possibly nonsense). Find the probabilities of the following events?1. Begin with an s.2. Contains no vowel.3. Begins and ends with a consonant.4. Contains only vowels.

Five letters are to be selected without replacement from the alphabet (size 26) to form a word (possibly nonsense). Find the probabilities of the following events?1. Begin with an s.2. Contains no vowel.3. Begins and ends with a consonant.4. Contains only vowels.

Page 18: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 3

Five letters are to be selected without replacement from the alphabet (size 26) to form a word (possibly nonsense). Find the probabilities of the following events?1. Begin with an s.2. Contains no vowel.3. Begins and ends with a consonant.4. Contains only vowels.

Five letters are to be selected without replacement from the alphabet (size 26) to form a word (possibly nonsense). Find the probabilities of the following events?1. Begin with an s.2. Contains no vowel.3. Begins and ends with a consonant.4. Contains only vowels.

Define

E1: word begins with an s.E2: word contains no vowel.E3: word begins and ends with a consonant.E4: word contains only vowels.

P(E1)=? P(E2)=? P(E3)=? P(E4)=?

Page 19: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 3Define

E1: word begins with an s.E2: word contains no vowel.E3: word begins and ends with a consonant.E4: word contains only vowels.

P(E1)=? P(E2)=? P(E3)=? P(E4)=?

1 2 3 4 5

{ , , }

,i

i j

a a za a a a a

a a i j

265P

For any , P()=1/||.

26 25 24 23 22

1 1 25 24 23 22E

2 21 20 19 18 17E

3 21 24 23 22 20E

4 5 4 3 2 1E

1 1

1( )

| |P E E

2 2

1( )

| |P E E

3 3

1( )

| |P E E

4 4

1( )

| |P E E

0.0385

0.3093

0.6462

21.52 10

Page 20: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Unordered Samples

without Replacement

Combinations

Page 21: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Combinations

n distinctobjects

Choose k objectsChoose k objects

How many choices?How many choices?

Page 22: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Combinations

Drawing k objects, their order is unnoted, among n distinct objects w/o replacement, the number of possible outcomes is

nkC

n

k

( 1) ( 1)

!

n n n k

k

!

( )! !

n

n k k

This notation is preferred

n distinctobjects

Choose k objectsChoose k objects

How many choices?

How many choices?

Page 23: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

More onn

k

( 1) ( 1)0

!0 0

n n n kn k

kk

k

Page 24: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Examples

( 1) ( 1)0

!0 0

n n n kn k

kk

k

2.5

3

2.5 1.5 0.5

3!

1

3

1 2 3

3!

1

0.3125

Page 25: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 4

The mathematics department consists of 25 full professors, and 15 associate professors, and 35 assistant professors. A committee of 6 is selected at random from the faculty of the department. Find the probability that all the members of the committee are assistant professors.

The mathematics department consists of 25 full professors, and 15 associate professors, and 35 assistant professors. A committee of 6 is selected at random from the faculty of the department. Find the probability that all the members of the committee are assistant professors.

x

Denoting the all-assistant event as E,

75

6

35

6E

35 751( )

6 6P E E

Page 26: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 5

A poker hand has five cards drawn from an ordinary deck of 52 cards. Find the probability that the poker hand has exactly 2 kings.

A poker hand has five cards drawn from an ordinary deck of 52 cards. Find the probability that the poker hand has exactly 2 kings.

x

Denoting the 2-king event as E,

52

5

4 48

2 3E

4 48

2 31( )

52

5

P E E

Page 27: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

Two boxes both have r balls numbered 1, 2, … , r. Two random samples of size m and n are drawn without replacement from the 1st and 2nd boxes, respectively. Find the probability that these two samples have exactly k balls with common numbers.

Two boxes both have r balls numbered 1, 2, … , r. Two random samples of size m and n are drawn without replacement from the 1st and 2nd boxes, respectively. Find the probability that these two samples have exactly k balls with common numbers.

11 22 33 rr

11 22 33 rr

m

n P(“k matches”) = ?

E

||=?

|E|=?

1( ) | |

| |E EP

Page 28: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

11 22 33 rr

11 22 33 rr

m

n| |

m n

r r

1( ) | |

| |E EP

| |n

Em

k

m

m

r r

k

# possible outcomes from the 1st box.

# possible k-matches.

# possible outcomes from the 2nd box for each k-match.

Page 29: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

11 22 33 rr

11 22 33 rr

m

n| |

m n

r r

1( ) | |

| |E EP

| |n

Em

k

m

m

r r

k

( )n

m

k kE

r

n

m

Pr

Page 30: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

11 22 33 rr

11 22 33 rr

m

n| |

m n

r r

1( ) | |

| |E EP

| |n

Em

k

m

m

r r

k

( )n

m

k kE

r

n

m

Pr

樂透和本例有何關係 ?

樂透和本例有何關係 ?

Page 31: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

11 22 33 rr

11 22 33 rr

m

n

1( ) | |

| |E EP

( )n

m

k kE

r

n

m

Pr

本式觀念上係由第一口箱子

出發所推得本式觀念上係

由第一口箱子出發所推得

Page 32: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

11 22 33 rr

11 22 33 rr

m

n

1( ) | |

| |E EP

( )nk k

m

n

r

Pr

m

E

觀念上,若改由第二口箱子

出發結果將如何 ?

觀念上,若改由第二口箱子

出發結果將如何 ?

Page 33: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 6

11 22 33 rr

11 22 33 rr

m

n

1( ) | |

| |E EP

( )nk k

m

n

r

Pr

m

E

k km

r

m

r

n n

Page 34: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Exercise11 22 33 rr

11 22 33 rr

m

n

1( ) | |

| |E EP

( )nk k

m

n

r

Pr

m

E

k km

r

m

r

n n

r r

r

k k

m m n n

n m

m

k k

n

r

證明

r r

r

k k

m m n n

n m

m

k k

n

r

證明

Page 35: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Binomial Coefficients

Page 36: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Binomial Coefficients

0

1

2 2 2

3 3 2 2 3

4 4 3 2 2 3 4

1

2

3 3

4 6 4

x y

x y x y

x y x xy y

x y x x y xy y

x y x x y x y xy y

Page 37: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Binomial Coefficients

0

1

2 2 2

3 3 2 2 3

4 4 3 2 2 3 4

1

2

3 3

4 6 4

x y

x y x y

x y x xy y

x y x x y xy y

x y x x y x y xy y

?n

x y

Page 38: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Binomial Coefficients ?

nx y

nx y x y x y x y x y

1 2 2? ? ?n kn nkn nx x y x y x y y

n terms

Page 39: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Binomial Coefficients ?

nx y

nx y x y x y x y x y

1 2 2? ? ?n kn nkn nx x y x y x y y

n boxes

1

n 2

n

n

k

0

n

n

n

Page 40: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Binomial Coefficients

nx y x y x y x y x y

0

nn k k

k

yn

kx

0

nk n k

k

n

kx y

Facts: 0 for 1. n

k nk

0 for 02.n

kk

0

n k k

k kx y

n

0

k n k

k

n

kx y

n k k

k

xk

yn

k n k

k

n

kx y

Page 41: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

Page 42: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

0 0

1 1n n

k n k

k k

n n

k k

0

nn k n k

k

x y x yn

k

1 1n

2n

Page 43: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

0 0

1 1 1n n

k k n k

k k

n n

k k

0

nn k n k

k

x y x yn

k

1 1n

0

Page 44: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

0

nn k n k

k

x y x yn

k

Exercise

Page 45: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

n 不 同 物 件 任 取 k 個

第一類取法 :

第二類取法 :

1n

k

1

1

n

k

Page 46: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

1 1

1

n n n

k k k

1

0

1

1

2

0

2

1

2

2

0

0

3

0

3

1

3

2

3

3

4

0

4

1

4

2

4

3

4

4

Pascal Triangular

Page 47: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

1

0

1

1

2

0

2

1

2

2

0

0

3

0

3

1

3

2

3

3

4

0

4

1

4

2

4

3

4

4

Pascal Triangular

1

1

1

1

1

1

1

1

1

2

3 3

4 6 4

1 1

1

n n n

k k k

Page 48: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Properties of Binomial Coefficients

 吸星大法

1

1

n nk n

k k

Page 49: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 7-1

0

nk

k

nx

k

0

1n

k n k

k

nx

k

1

nx

Page 50: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 7-2

0

n

k

nk

k

0

k n

k

nk

k

1

k n

k

nk

k

1

1

1

k n

k

nn

k

1

1

1

k n

k

nn

k

kx+11

1 1

1

1 1

x n

x

nn

x

1

0

1x n

x

nn

x

1

0

1k n

k

nn

k

1

0

1n

k

nn

k

12nn

Fact:0

2n

n

k

n

k

?

Page 51: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 7-2

0

n

k

nk

k

1

k n

k

nk

k

1

1

1

k n

k

nn

k

kk+1

1

0

1n

k

nn

k

12nn

簡化版

Page 52: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 7-3

0

( 1)n

k

nk k

k

2

( 1)k n

k

nk k

k

kk+2

2( 1)2nn n

簡化版

2

1( 1)

1

k n

k

nn k

k

2

2( 1)

2

k n

k

nn n

k

2

0

2( 1)

n

k

nn n

k

?

Page 53: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Negative Binomial Coefficients

11

k

k k

n kn

Page 54: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Negative Binomial Coefficients

11

k

k k

n kn

How to memorize?

1 1

kn k

k k

n

k

k k (n) 1

Page 55: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Negative Binomial Coefficients

11

k

k k

n kn

這公式真的對嗎 ?

1 1

k

k

n

k

k k (n+k1) 1 1

k 1k

1

k

n

Page 56: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Negative Binomial Coefficients

( 1) ( 1)

!

n n n k

k

k

n

( 1) ( 1)1

!k kn n n

k

( 1) ( 1)1

!k n

k

nk n

11

k kn

k

Page 57: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Some Useful Mathematic Expansions

Page 58: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

Page 59: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

1 1 z1

1 zz

z

2z z2z2 3z z

2z

3z

Page 60: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

1 1

1 1 ( )z z

2 431 ( ) )(( )) (z z zz

2 3 41 z zz z

Page 61: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

21

1 z

211

1z z

z

2 3 41 ? ? ? ?z z z z

2 21 1z z z z

Page 62: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

21

1 z

211

1z z

z

2 3 41 2 3 4 5z z z z

2 21 1z z z z

31

1 z

2 3 41 ? ? ? ?z z z z

2 2 21 1 1z z z z z z

1

1

n

z

2 3 41 ? ? ? ?z z z z

Page 63: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

211

1z z

z

1

1

n

z

1 ( )n

z

0

( ) 1k n k

k

nz

k

( ) 1n

z

0

( 1)k k

k

nz

k

0

1( 1) ( 1)k k k

k

n kz

k

0

1 k

k

n kz

k

Page 64: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

Page 65: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

2 2 1 2 31 1k k k kz z z z z z z z

2 1 21 1kz z z z z 11

1 1

kz

z z

11

1

kz

z

z值沒有任何限制

Page 66: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Useful Mathematic Expansions

Page 67: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Unordered Samples with Replacement

Page 68: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Discussion

投返 非投返

有序

無序

knn

kP

n

k

?

Page 69: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Unordered Samples with Replacement

n不同物件任取 k個可重複選取

n不同物件,每一中物件均無窮多個從其中任取 k個

Page 70: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Unordered Samples with Replacement

0 1 2 3z z z z 0 1 2 3z z z z 0 1 2 3z z z z

此多項式乘開後zk之係數有何意義 ?

Page 71: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Unordered Samples with Replacement

0 1 2 3z z z z 0 1 2 3z z z z 0 1 2 3z z z z

2 3 2 3 2 31 1 1z z z z z z z z z

2 31n

z z z

1

1

n

z

0

1 k

k

n k

kz

Page 72: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Unordered Samples with Replacement

投返 非投返

有序

無序

knn

kP

n

k

1n k

k

Page 73: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 8

Suppose there are 3 boxes which can supply infinite red balls, green balls, and blue balls, respectively. How many possible outcomes if ten balls are chosen from them?

n = 3k = 10

3 10 1 12

10 10

Page 74: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

There are 3 boxes, the 1st box contains 5 red balls, the 2nd box contains 3 green balls, and the 3rd box contains infinite many blue balls. How many possible outcomes if k balls are chosen from them.

k=1有幾種取法k=2有幾種取法k=3有幾種取法k=4有幾種取法

觀察 :

Page 75: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

2 3 4 51 z z z z z 2 31 z z z 2 31 z z z

此多項式乘開後zk之係數卽為解

Page 76: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

2 3 4 51 z z z z z 2 31 z z z 2 31 z z z

6 41 1 1

1 1 1

z z

z z z

36 4 1

1 11

z zz

3

4 6 10 11

1z z z

z

4 6 10

0

3 11 j

j

jz z z z

j

4 6 10

0

21 j

j

jz z z z

j

此多項式乘開後zk之係數卽為解

Page 77: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

此多項式乘開後zk之係數卽為解

4 6 10

0

21 j

j

jz z z z

j

0 0 0 0

4 6 102 2 2 2j j j j

j j j j

z zj j j j

z z zj j j j

z z

0 0 0

4 10

0

62 2 2 2j j j j

j j j j

j j j jz z z z

j j j j

Coef(zk)=?

Page 78: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

4 6 1

0

0

0 0 0

2 2 2 2j j j j

j j j j

j j j jz z z z

j j j j

Coef(zk)=?

從 z0 開 始 從 z4 開 始 從 z6 開 始 從 z10 開 始

0 4 6 10

2 2 4 8

4 6 10k k k k

k k k k

k k k kz z z z

k k k k

jk4 jk6 jk10jk

Page 79: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

4 6 1

0

0

0 0 0

2 2 2 2j j j j

j j j j

j j j jz z z z

j j j j

Coef(zk)=?

從 z0 開 始 從 z4 開 始 從 z6 開 始 從 z10 開 始

0 4 6 10

2 2 4 8

4 6 10k k k k

k k k k

k k k kz z z z

k k k k

jk4 jk6 jk10jk

Page 80: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

0 4 6 10

2 2 4 8

4 6 10k k k k

k k k k

k k k kz z z z

k k k k

20 4

2 24 6

4( )

2 2 46 10

4 6

2 2 4 810

4 6 10

k

kk

k

k kk

k kCoef z

k k kk

k k k

k k k kk

k k k k

Page 81: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 9

20 4

2 24 6

4( )

2 2 46 10

4 6

2 2 4 810

4 6 10

k

kk

k

k kk

k kCoef z

k k kk

k k k

k k k kk

k k k k

2 2 4 8( )

4 6 10k k k k k

Coef zk k k k

Page 82: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Derangement

Page 83: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Derangement

最後 ! ! !每一個人都拿到別人的帽子

錯排

Page 84: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10

nkE 0

nE

n人中正好 k人拿對自己的帽子n人中正好 k人拿對自己的帽子 n人中無人拿

對自己的帽子n人中無人拿對自己的帽子

). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Page 85: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10

nkE 0

nE

). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

? ?nkE 0 ?nE

Page 86: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10nkE

0nE

). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

n人中正好 k人拿對自己的帽子 n人中無人拿對自己的帽子

!n

20( ) ?EP 3

0( ) ?EP

1 2

2 1

1 2

2 3

3

1

3 1 2

1/2! 2/3!

Page 87: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10nkE

0nE

). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

n人中正好 k人拿對自己的帽子 n人中無人拿對自己的帽子

!n

令 Ai表第 i個人拿了自己帽子

0 0( ) 1 ( )n nP E P E 1 21 ( )nP A A A

Page 88: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

Page 89: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

1 2 n

1

( 1)!( )

!i

nP A

n

. . .

. . .

Page 90: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

1 2 n

1 2

( 1)!( )

!i

nP A

n

. . .

. . .

( 2)!( ) ,

!i j

nP A A i j

n

Page 91: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

( 1)!( )

!i

nP A

n

( 2)!( ) ,

!i j

nP A A i j

n

( 3)!( ) ,

!i j k

nP A A A i j k

n

1

n

計 項1

n

計 項2

n

計 項2

n

計 項

3

n

計 項3

n

計 項

( )!

!k

n n kS

k n

! ( )!

!( )! !

n n k

k n k n

1

!k

Page 92: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

( )!

!k

n n kS

k n

! ( )!

!( )! !

n n k

k n k n

1

!k 1

0

1 1 1( ) 1 1 1

2! 3! !nnP E

n

1

0

1 1 1( ) 1 1 1

2! 3! !nnP E

n

11 1 11 1

2! 3! !n

n

Page 93: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

1

0

1 1 1( ) 1 1 1

2! 3! !nnP E

n

1

0

1 1 1( ) 1 1 1

2! 3! !nnP E

n

20

1 1( ) 1 1

2! 2P E

30

1 1 1( ) 1 1

2! 3! 3P E

40

1 1 1 3( ) 1 1

2! 3! 4! 8P E

Page 94: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第 i個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

1

0

1 1 1( ) 1 1 1

2! 3! !nnP E

n

11 1 1 11 1

1! 2! 3! !n

n

0

1 1 1 1( ) 1 1

1! 2! 3! !nnP E

n

Page 95: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

Ai表第個人拿了自己帽子

0 1 2( ) 1 ( )nnP E P A A A

1

0

1 1 1( ) 1 1 1

2! 3! !nnP E

n

11 1 1 11 1

1! 2! 3! !n

n

10im ( )l

n

nEP e

10im ( )l

n

nEP e

0

1 1 1 1( ) 1 1

1! 2! 3! !nnP E

n

Page 96: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

0

0( )!

n

nE

P En

( )!

nkn

k

EP E

n

0 0! ( )n nE n P E

?nkE

0

1 1 1 1( ) 1 1

1! 2! 3! !nnP E

n

Page 97: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

0

0( )!

n

nE

P En

( )!

nkn

k

EP E

n

0 0! ( )n nE n P E

?nkE

. . .. . .

. . .. . .

k matches n k mismatches

n

k

0n kE 0

!

n kEn

k n

0

1( ) ( )

!n n kkP E P E

k

0( )!

! ( )!

n kEn n k

k n n k

Page 98: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 10 ). ?3 ( nkEP

0 ). ?1 ( nEP

0 ) ?2. lim (n

nP E

52( ) ?P E 3

0

1

2!P E

0

1( ) ( )

!n n kkP E P E

k

1 1

2! 3

Page 99: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Remark

0

( ?)n

nk

k

P E

1

Page 100: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Chapter 2Combinatorial Analysis

Calculus

Page 101: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Some Important Derivatives

Derivatives for multiplications —

Derivatives for divisions —

Chain rule —

duvu v uv

dx

2

d v uv u v

dx u u

dy dy du

dx du dx ( )

( )

y f u

u g x

Page 102: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

L’Hopital rule

Suppose as we hav( )

, .(

0e or

0)

f xx c

g x

( ) ( )lim lim

( ) ( )x c x c

f x f x

g x g x

Page 103: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Examples

Page 104: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Integration by Part

duv udv vdu

duv udv vdu uv udv vdu

Page 105: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Integration by Part

uv udv vdu udv uv vdu

b bb

aa audv uv vdu

Page 106: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

The Gamma Function

1

0( ) , 0xx e dx

Page 107: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

Page 108: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

0(1) xe dx

0

xe

0 ( 1)

1

Page 109: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

Page 110: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

0

Example 12

1

0( ) , 0xx e dx

1

0( ) xx e dx

1

0

xx de

1 1

0 0

x xx e e dx 1 2

0 0( 1)x xx e x e dx

( 1)

( 1) ( 1)

Page 111: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

( ) ( 1) ( 1)

( 1)( 2) ( 2)

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

( 1)!

Page 112: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

2 / 2 ?xe dx

2 / 2 ?xe dx

Page 113: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

2 / 2 ?xe dx

2 / 2 ?xe dx

2 2 2/ 2 / 2 / 2x x ye dx e dx e dy

2I

2 2

2 2

x y

I e dxdy

22 / 2

0 0

re rdrd

22

2 / 2

0 0 2r r

e d d

2

0d

2

2

Page 114: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

2 / 2 2xe dx

Page 115: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1/ 2

0

1

2xx e dx

2 / 2 2xe dx

1

0( ) , 0xx e dx

2et 2L /x y1/ 2

0

x x

xx e dx

222

2

2

1/ 22 2/ 2

0 2 2

y

y

yy ye d

2 / 2

0

2y y

ye ydy

y

2 / 2

02 ye dy

2 / 22

2ye dy

Page 116: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

Page 117: Chapter 2 Combinatorial Analysis 主講人 : 虞台文. Content Basic Procedure for Probability Calculation Counting – Ordered Samples with Replacement – Ordered

Example 12

1

0( ) , 0xx e dx

?3

2

?5

2

?7

2

1 1

2 2 2

3 3

2 2

3

4

5 5

2 2

15

8