PROBABILITY & STATISTICS / 1. COUNTING & COMBINATORICS
Counting — Permutations & Combinations
Counting outcomes precisely — the foundation of probability
EXPLANATION
Before you can compute probabilities, you need to count outcomes correctly. Fundamental Counting Principle: If event A can happen in m ways and event B in n ways, together they can happen in m × n ways. Permutations — ORDER MATTERS: P(n, r) = n! / (n-r)! "How many ways to arrange r items from n?" Example: 3-digit PIN from digits 0-9 with no repeat = P(10,3) = 720 Combinations — ORDER DOES NOT MATTER: C(n, r) = n! / (r! × (n-r)!) also written as ⁿCᵣ or C(n,r) "How many ways to choose r items from n?" Example: Choose 3 students from 10 for a team = C(10,3) = 120 Key insight: C(n,r) = P(n,r) / r! — combinations are permutations divided by the number of ways to arrange the chosen items (which we don't care about). With repetition: • Permutations with repetition: nʳ • Combinations with repetition: C(n+r-1, r)
DIAGRAM
n=4 items: {A, B, C, D} choose r=2
Permutations (order matters): AB ≠ BA
AB, AC, AD, BA, BC, BD, CA, CB, CD, DA, DB, DC
P(4,2) = 4!/(4-2)! = 12
Combinations (order doesn't matter): AB = BA
AB, AC, AD, BC, BD, CD
C(4,2) = 4!/(2! × 2!) = 6
Pascal's Triangle (combinations):
C(0,0) = 1
C(1,0) C(1,1) = 1 1
C(2,0) C(2,1) C(2,2) = 1 2 1
C(3,0) C(3,1) C(3,2) C(3,3) = 1 3 3 1
Each entry = sum of two above itCODE