3-3. 組合
- n 件相異物不允許重複取 r 件組合的方法數: Crn = C(n, r) = (rn) = r!n(n−1)...(n−r+1) = (n−r)!r!n!, n≥r
∵ 組合 = 無次序排列 = r!Prn
- n 件相異物允許重複取 r 件組合的方法數: (rn+r−1) = r!(n−1)!(n+r−1)!
ex. 4 件相異物 A, B, C, D 無次序取 7 件作組合:
取 |
A |
B |
C |
D |
AABBCCD |
xx |
xx |
xx |
x |
AACCCCD |
xx |
|
xxxx |
x |
→ 等同於: r 個 x 與 n - 1 個間隔的不全相異物排列,其等價問題:
- r 個相同球放入 n 個相異箱子,允許空箱之方法數
- x1 + x2 + ... + xn = r 之非負整數整數解個數
→ Corollary: n 個箱內必有物 ⇒(r−nn+(r−n)−1) = (r−nr−1) = (n−1r−1)
- r 個相同球放入 n 個相異箱子,不允許空箱之方法數
- x1 + x2 + ... + xn = r 之正整數整數解個數
Example:
x1 + x2 + ... + xn≤r 之非負或正整數整數解個數?
solution:
令 xn+1 = r - (x1 + x2 + ... + xn) ⇒x1 + x2 + ... + xn + xn+1 = r, xn+1≥ (正整數: >) 0, 其中 xn+1 稱為鬆弛變數 (slack variable)
Theorem of Combination
(rn) = (rn−1) + (r−nr−1)
proof:
利用組合證法,n 個相異物取 r 個組合,固定一物 A
- 不取 A: (rn−1)
- 取到 A: (r−1n−1)
∵「沒取到 A 」與「有取到 A」為互斥事件
∴(rn) = (rn−1) + (r−nr−1)
Corollary of Combination
(rn) = (r−2n−2) + 2(r−1n−2) + (rn−2)
固定一物 A 和 B
- 取到 A 和 B: (r−2n−2)
- 不取 A 或 B: (r−1n−2)
- 不取 A 和 B: (rn−2)
Vandermonde's Convolution
(nr+s) = (0r)(ns) + (1r)(n−1s) + ... + (nr)(0s) = k=0∑n(kr)(n−ks)
⇒r = s = n 代入: (n2n) = (0n)2 + (1n)2 + ... + (nn)2 = k=0∑n(kn)2
Binomial Theorem
(x + y)n = k=0∑n(rn)xryn−r, n∈Z+
proof:
(x + y)n 展開後 xryn−r 之係數 (rn) 相當於「 n 個 bits 中恰含 r 個 1 與 n - r 個 0 之 bit string 個數」
Corollary of Binomial Theorem
(x1 + x2 + ... + xk)n = n=i=1∑knk,0≤ni≤nk∑(n1,n2,...,nkn)x1n1x2n2 ... xkn2, n∈Z+