Combinatorics: Permutations and Combinations For students.
Combinatorics is the mathematics of counting: how many ways can you arrange, choose or order a collection of objects? Whether the objects are passwords, lottery tickets, team selections or delivery routes, combinatorics gives the exact count without forcing you to list every single possibility.
It matters because computers count possibilities constantly. Password strength is measured in combinations, algorithms are analysed by counting their steps, and probability itself is just "favourable outcomes divided by total outcomes" — combinatorics supplies both of those numbers. Any engineer who estimates, schedules or tests software is using combinatorics, often without realising it.
Key Concepts
- Factorial (n!): the product n × (n−1) × … × 2 × 1. By definition 0! = 1, which keeps the formulas consistent. Example: 5! = 120.
- Permutation: an arrangement where order matters, like the finishing order of a race or the digits of a PIN.
- Combination: a selection where order does not matter, like the members of a committee or the numbers on a lottery ticket.
- Multiplication principle: if one choice has m options and a second independent choice has n options, there are m × n combined outcomes.
- Addition principle: if two kinds of outcomes cannot happen together, the total count is their sum.
- Repetition: some problems allow reusing objects (password characters can repeat), others do not (committee members cannot repeat).
Formulas
- Permutations of r from n (no repetition): P(n, r) = n! / (n−r)!. Each position has one fewer choice than the last. Assumption: r ≤ n and no object is reused.
- Combinations of r from n (no repetition): C(n, r) = n! / (r! × (n−r)!). This divides the permutations by r! because the r chosen objects can be ordered in r! ways that we do not care about.
- Combinations with repetition: C(n+r−1, r). Example: choosing 3 scoops from 5 flavours, repeats allowed, gives C(7, 3) = 35 possibilities.
- Permutations of a multiset: n! / (n1! × n2! × …) where n1, n2, … are the counts of each repeated item. The word "LEVEL" (5 letters, with L and E each twice) has 5! / (2! × 2!) = 30 arrangements.
Worked Example
A teacher must choose a 3-member committee from 10 students. How many different committees are possible? And how many ways could she pick a president, vice-president and secretary instead?
- A committee has no ordering, so this is a combination: C(10, 3) = 10! / (3! × 7!).
- Cancel 7! from top and bottom: = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120 committees.
- The officer roles are ordered — president versus secretary matters — so this is a permutation: P(10, 3) = 10 × 9 × 8 = 720.
- Notice 720 is exactly 6 times 120, because each unordered trio of students can be assigned the three distinct roles in 3! = 6 ways.
- Sanity check: the ordered count must always be at least as large as the unordered count, and 720 ≥ 120 holds.
Common Misconceptions
- "Permutation and combination are interchangeable." They answer different questions. Ask first: does swapping two chosen items create a new outcome? If yes, it is a permutation; if no, a combination. Committees are combinations, passwords are permutations.
- "C(n, r) = C(n, n−r) means P(n, r) = P(n, n−r) too." The first identity is true — choosing which 3 to include is the same as choosing which 7 to exclude — but the permutation version is false. P(10, 3) = 720 while P(10, 7) = 6,048,000.
- "0! should be 0." It is defined as 1, and this is not arbitrary: there is exactly one way to arrange nothing, and it makes formulas like C(n, 0) = 1 work correctly.
Real-World Applications
- Passwords and security: a 4-digit PIN has 10^4 = 10,000 possibilities; each extra character multiplies an attacker's work, which is why length matters so much.
- Lotteries and games: the odds of any draw are a combinations calculation, which is why jackpot odds look so extreme.
- Scheduling: assigning shifts, exam slots or tournament fixtures is counting valid arrangements under constraints.
- Algorithm analysis: sorting and searching algorithms are compared by counting the operations they perform in the worst case.
Combinatorics turns "how many ways?" from a guessing game into exact arithmetic. Learn to spot whether order matters and whether repetition is allowed, and you can count committees, passwords, routes and schedules with just factorials and a division.
Related blogs
- Propositional and Predicate Logic: Complete Beginner's Guide
- Proof Techniques: Induction and Contradiction For students.
- Sets, Relations and Functions: Complete Beginner's Guide
- Recurrence Relations: Complete Beginner's Guide Guide.
- Graph Theory: Paths, Trees and Coloring With easy examples.
- Boolean Algebra: Complete Beginner's Guide For students.