You are on page 1of 23

Combinatorial

Analysis Y.C. Wong


Contents

1.1 Introduction
1.2 Basic Principle of Counting
 Excel
1.3 Permutations
1.4 Combinations

2
1.1 Introduction

3
Example

• 問題: 由n支外觀相同的天線排成一列構成一個通訊系統。
只要相鄰的兩支天線不會同時故障,系統就能正常運轉。
若n支天線中有m支故障,則該系統能正常運轉的機率為
何?
• 簡化的解答: (For general solution, see example 4c)
• In the special case where n=4 and m=2 there are 6 possible
configuration
• The desired probability is 1/2
YYN N
YNYN
YNNY
N NYY
NYNY [Tip] 數一數有幾種可能
NYYN 4
1.2 Basic Principle of
Counting

5
計數原理 (Counting Principle)

• 假設將進行兩個實驗。若實驗一將產生m種可能的結果,
且對於實驗一的每一種結果,實驗二皆有n種可能的結果,
則此兩個實驗共有mn種可能的結果。

• 說明:
• Exp 1: 丟銅板 H or T
• Exp 2: 丟骰子 1, 2, 3, 4, 5, or 6
• (Exp 1, Exp 2):
• (H, 1), (H, 2), (H, 3), (H, 4), (H, 5), (H, 6)
• (T, 1), (T, 2), (T, 3), (T, 4), (T, 5), (T, 6)
2*6

6
Example

• Ex2c. 前三位是英文字母且後四位是阿拉伯數字的七位置
牌照,共有幾種相異的排列? [Excel]
• Ans.
26  26  26  10  10  10  10 =PRODUCT(26, 26, 26)
=PRODUCT(A2:A8)

• Ex2e. 續上例,若字母或數字皆不可重複出現,則共有幾
種相異的排列?
• Ans.
26  25  24  10  9  8  7
7
1.3 Permutations

8
Permutation

• Suppose that we have n objects. There are


n*(n-1)*…1 = n! different permutations of the n
objects.
• 說明:
• Assume there are three objects {a, b, c}
• 窮舉法: 6 different permutations
• 系統性: 6 = 3 * 2 * 1

9
Excel Lab

• =FACT(5)
• 使用cell存放資料 5
• 將資料與公式分開
• 在許多情況,資料是透過其他管道取得

• MATLAB
• SPSS
• R
• Python
• …
10
Example

• Ex3a. 由九位球員組成的棒球隊,共有幾種不同的打擊順
序?
• Sol. 9!

• Ex3b. 某班級有6個男生和4個女生。假設期中考沒有人同
分。(a) 共有幾種可能的排名? (b) 若男生與女生分開排名
(先男後女),則有幾種可能的排名?
• Sol.
• 10!
• 6! * 4! = 17280

11
Example

• Ex3c. 李同學要把10本書放到書架上。其中有4本數學、3
本化學、2本歷史、1本英文。相同科目的書須放在一起,
請問共有幾種相異的排列?
• Ans.
4!  (4 !  3 !  2 !  1!)

12
自我練習

13
Answer

• Ex10 Ans.
• 8!
• 2 * 7!
• 5! * 4!
• 24 * 4!
• Ex11 Ans.
• 6!
• 3! (3!)(2!)
• 3! (4!)

14
Example

• Ex3d. 字母PEPPER可以構成幾種不同的排列?
• Ans.
grouping
(1) PEPPER  P1E1P2P3E2R 6!
6!
(2)
(3!)(2!)

PPEPER

15
自我練習

16
Answer

• Ex8 Ans.
• 5!
7!

(2!)(2!)
11!

(4!)(4!)(2!)
7!

(2!)(2!)

• Ex9 Ans.
12!

(6!)(4!)

17
1.4 Combinations

18
Combinations

• 說明:
• How many groups of 3 could be selected from {A, B, C, D, E}?
5 5∗4∗3
• 3
= // (ABC, ACB, BAC, BCA, CAB, CBA) was counted 6 times
3!
5∗4∗3∗2∗1
=
3!∗2∗1
5!
=
3!∗2!

19
Example

5 2 5 2 5
2
[ 0 3
+ 1 2
]
20
Example Lab

• COMBIN(20,3) = C(20, 3) = 1140


• 使用cell存放資料 20, 3

21
自我練習

• Ex15. 一個舞蹈班有10位女生和12位男生。若自其中選取
5男5女來配對,共有幾種不同的選取法?

• Ex19. 自8女6男的群體中選出3女3男組成一個委員會。請
問會有幾種不同的組合? (a) 有兩位男人不願同時在委員
會(b) 有兩位女人不願同時在委員會 (c) 有1男1女不願同
時在委員會。

22
Answer

• Ex15 Sol.
10 12
5!  5
 5

• Ex19 Sol.
8 2 4 2 4
(a) 3
[ 0 3
+ 1 2

6 2 6 2 6
(b) 3
[ 0 3
+ 1 2
]

7 5 7 5 7 5
(c) 3 3
+ 2 3
+ 3 2

x x v x x v 23

You might also like