Permutations and Combinations
Many counting problems ask us to choose elements from a set. The key question is always the same: does order matter? If it does, we count permutations; if it does not, we count combinations.
Permutations
Def
A permutation of a set of distinct objects is an ordered arrangement of these objects. An ordered arrangement of
The number of
Theorem 1
If
The intuition is the product rule: there are
Special case
When
- Examples:
- How many ways can a gold, silver, and bronze medal be awarded among
runners? Order matters, so . - The number of permutations of the letters
is : . - How many ways can
people line up at a counter? .
- How many ways can a gold, silver, and bronze medal be awarded among
Combinations
Def
An
The number of binomial coefficient.
Theorem 2
The number of
Why divide by
Each
This is the division rule at work: counting ordered selections, then dividing out the orderings we no longer care about.
- Examples:
- How many ways can a committee of
be chosen from people? Order does not matter, so . - How many bit strings of length
contain exactly four s? Choose which of the positions hold a : . - How many hands of
cards can be dealt from a standard -card deck? .
- How many ways can a committee of
A Key Identity
Corollary
For all nonnegative integers
Choosing the
The same fact drops out of the formula. Substituting
since the two factorials in the denominator just swap places. The identity is exactly the symmetry of Pascal's triangle: reading each row left-to-right gives the same numbers as reading it right-to-left.
Boundary values
- Example:
— easier to compute by leaving out than choosing .
Combinatorial Proof (Chứng minh tổ hợp)
Ý tưởng: Thay vì biến đổi đại số để chứng minh một đẳng thức, hãy nghĩ xem hai vế đang đếm cái gì.
Nếu hai vế đều biểu diễn số lượng của cùng một đối tượng (hoặc hai tập đối tượng có cùng số phần tử), thì hai vế phải bằng nhau.
Câu hỏi quan trọng nhất khi gặp một combinatorial proof:
TIP
Hai vế này đang đếm cái gì?
- Có 2 loại Combinatorial Proof
Combinatorial Proof
│
├──────────────┐
│ │
▼ ▼
Double Counting Bijective ProofDouble Counting Proof
INFO
Đếm cùng một tập đối tượng bằng hai cách khác nhau. Nếu hai cách đều đếm cùng một thứ thì kết quả phải bằng nhau.
Cùng một tập đối tượng
★★★★★★★
↙ ↘
Cách đếm 1 Cách đếm 2
↓ ↓
Biểu thức A Biểu thức B
↓ ↓
A = B- Example 1
Chứng minh
- Vế phải: Đếm tất cả các tập con của một tập có
phần tử.
Mỗi phần tử:
- Chọn
- Không chọn
Có 2 lựa chọn.
Do đó
Vế trái: Đếm theo số phần tử của tập con.
Có
tập con có 0 phần tử. Có
tập con có 1 phần tử. ...
Có
tập con có n phần tử.
Tổng số tập con là
Hai cách đều đếm tập tất cả các tập con.
Suy ra
- Example 2
Có 30 người.
Muốn đếm số cái bắt tay.
- Cách 1
Chọn 2 người
- Cách 2
Mỗi người bắt tay với 29 người.
Có
lượt đếm.
Nhưng mỗi cái bắt tay bị đếm hai lần.
Do đó
Hai cách đếm cùng một đối tượng.
Suy ra
Bijective Proof
- Ý tưởng:
TIP
Không cần đếm.
Chỉ cần xây dựng một song ánh (bijection) giữa hai tập.
Nếu mỗi phần tử của tập A ghép đúng với một phần tử của tập B và ngược lại thì
Tập A
A1 ───── B1
A2 ───── B2
A3 ───── B3
...
↓
Ghép 1-1
↓
Hai tập có cùng số phần tử.- Example
Chứng minh
Giả sử
Ta xét:
- Tập tất cả các tập con có (r) phần tử.
- Tập tất cả các tập con có (n-r) phần tử.
Xây dựng hàm
trong đó
(chính là phần bù của (A)).
Ví dụ
S = {1,2,3,4,5}
A = {1,4}
Ā = {2,3,5}Nếu (A) có (r) phần tử thì
có
phần tử.
Mỗi tập con có đúng một phần bù.
Ngược lại, biết phần bù thì xác định lại được tập ban đầu.
Do đó đây là một bijection.
Suy ra
Intuition
Combinatorial Proof = Đừng biến đổi công thức. Hãy nghĩ xem hai vế đang đếm cái gì.
- Nếu đếm cùng một tập đối tượng bằng hai cách → Double Counting.
- Nếu ghép 1-1 giữa hai tập đối tượng → Bijective Proof.
Intuition
The single most important question is whether order matters.
| Order matters | Order does not matter | |
|---|---|---|
| What it is | Permutation (arrangement) | Combination (subset) |
| Formula | ||
| Relationship | ||
| Cue words | line up, rank, award, sequence | choose, select, committee, subset |
- Same start, different finish. Both pick
items from ; permutations then order them, combinations do not. - Divide away the order. Every combination corresponds to
permutations, so combinations are always the smaller count.