Combinations and Permutations
Formulas for counting arrangements and selections.
Permutations when order matters, combinations when it does not.
Permutations (Order Matters)
A permutation counts the number of ways to arrange r items chosen from n distinct items where the order matters. Choosing A then B is different from choosing B then A.
Combinations (Order Does Not Matter)
A combination counts the number of ways to select r items from n distinct items where the order does not matter. Choosing {A, B} is the same as choosing {B, A}.
The relationship between them is simple: C(n, r) = P(n, r) / r! because each combination corresponds to r! permutations.
Variables
| Symbol | Meaning | Unit |
|---|---|---|
| n | Total number of items available | count |
| r | Number of items being chosen | count |
| n! | n factorial = n × (n−1) × ... × 2 × 1 | count |
Example 1 — Permutations
How many ways can 3 runners finish in 1st, 2nd, and 3rd place out of 8 runners?
Order matters (1st place is different from 2nd), so use permutations
P(8, 3) = 8! / (8 − 3)! = 8! / 5!
= 8 × 7 × 6 = 336
There are 336 possible podium arrangements
Example 2 — Combinations
How many ways can you choose 5 cards from a standard 52-card deck?
Order does not matter (a hand is a hand), so use combinations
C(52, 5) = 52! / [5! × 47!]
= (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1)
= 311,875,200 / 120
C(52, 5) = 2,598,960 possible poker hands
Example 3 — Comparing Both
Choose 2 people from a group of 4 (Alice, Bob, Carol, Dave)
Permutations: P(4, 2) = 4 × 3 = 12 (AB, BA, AC, CA, AD, DA, BC, CB, BD, DB, CD, DC)
Combinations: C(4, 2) = 12 / 2! = 6 (AB, AC, AD, BC, BD, CD)
12 ordered pairs vs 6 unordered pairs — combinations are always fewer
When to Use It
- Calculating lottery odds (combinations — order of drawn numbers doesn't matter)
- Counting possible PIN codes or passwords (permutations — order matters)
- Determining team selections from a roster
- Calculating probabilities in card games and dice problems
- Combinatorics problems in computer science and algorithm analysis