Counting & Combinatorics
"How many ways are there to…?" sounds like a question you answer by listing them all and counting. For anything real — possible passwords, lottery tickets, ways to seat a team — that list is astronomically long, and listing is hopeless. Combinatorics is the art of getting the count without the list, and it rests on a few small, powerful rules.
This guide builds them up: the multiplication principle (the engine behind almost all counting), then the crucial fork between permutations (when order matters) and combinations (when it doesn't), and finally why this matters far beyond puzzles — it's the foundation of probability, the reason a long password is strong, and the reason some problems are too big to brute-force. By the end, "how many ways" becomes a calculation, not a guess.
How to read this
- Want the one rule that does the most? Phase 1 — the multiplication principle.
- Want the whole toolkit? Read in order — permutations and combinations (Phase 2) build on it.
The phases
- The Multiplication Principle — counting independent choices by multiplying, and the "and vs or" rule.
- Permutations & Combinations — order matters vs order doesn't, factorials, and the formulas (with runnable code).
- Why Counting Matters — the bridge to probability, password strength, and combinatorial explosion (why brute force fails).
This builds on Numbers & Number Systems and the set idea from Sets, Relations & Functions. It sets up the last foundation: probability and statistics.