Counting Principles and Combinatorial Identities
Learning objectives
- Apply the multiplication and addition principles to multi-stage selections
- Distinguish ordered (permutation) from unordered (combination) counts and pick the right formula
- Compute and manipulate binomial coefficients using Pascal's recurrence
- Recognise the binomial theorem as the algebraic shadow of counting subsets
- Apply inclusion-exclusion to count unions of overlapping sets
Counting is harder than it looks, and it underlies every probability calculation you will ever do. The question "in how many ways can this happen?" sounds elementary, but it secretly drives every result downstream, the probability of a poker hand, the expected runtime of a randomised algorithm, the number of training examples a neural network can in principle distinguish. The trick is to spot which of two structural moves you are making: a sequence of decisions (multiplication), or a partition into cases (addition). Permutations, combinations, the binomial theorem, and inclusion-exclusion are all built from those two atoms.
The multiplication and addition principles
The multiplication principle says: if a process consists of sequential stages with independent choices at each stage, the total number of outcomes is the product . Use it whenever your decisions are made in sequence and the count at each stage does not depend on previous choices.
The addition principle says: if a process can be split into mutually exclusive cases with outcomes each, the total is . Use it when you partition the possibilities by some discrete attribute (which suit was drawn, whether the first toss was heads, etc.).
A typical counting argument interleaves both rules: split into disjoint cases (addition), count each case by stages (multiplication), then sum.
Permutations and combinations
A permutation of objects chosen from is an ORDERED selection: there are of them. A combination is an UNORDERED selection: there are . The connecting identity is , every unordered choice of items can be ordered in ways, so dividing by collapses permutations down to combinations.
When you read a problem, ask: does swapping two items give a different outcome? Yes → permutation. No → combination. Card hands are combinations (a hand is a set of cards); seating arrangements are permutations (who sits next to whom matters).
Binomial coefficients and Pascal's triangle
The number has a wealth of algebraic identities, but the load-bearing one is Pascal's recurrence: . Combinatorial proof: to choose items from , either the last item is in the chosen set (and we need from the first ) or it is not (and we need from the first ). These cases are disjoint, so by the addition principle we sum. Pascal's triangle is exactly this recurrence laid out as a number wall.
The binomial theorem states . Why does the coefficient of equal ? Because when you expand , each term comes from choosing in of the factors and in the remaining . The number of such choices is exactly . Setting gives the satisfying identity : an -element set has subsets in total.
The widget above lets you select small and values and enumerate every ordered (or unordered) selection. Notice that toggling between "order matters" and "order does not matter" divides the count by exactly , the formula made visible.
Inclusion-exclusion
When two sets overlap, the naive sum double-counts the intersection. The inclusion-exclusion principle corrects this: . For three sets the formula adds back the triple intersection: . In general the signs alternate by the size of the intersection.
- Cryptography: The security of a password depends on the size of the keyspace. A 12-character password from a 94-character alphabet gives possibilities, pure multiplication principle. An 80-bit key space () is the modern minimum-acceptable security level; smaller spaces fall to exhaustive search.
- Machine learning, train/test splits: Picking a held-out test set of size from examples is ways. Cross-validation schemes pick disjoint folds, and the variance of the estimator depends on these combinatorial counts.
- Lottery odds: A "pick 6 of 49" lottery has tickets. Probability of jackpot is one over that, under one in 13 million. Combinations, not permutations, because the order of drawn numbers does not matter.
- Genomics and combinatorial chemistry: A short DNA primer of length 20 has possible sequences. Library design (which primers to synthesise, which compounds to test) starts from these counts.
- Birthday-paradox attacks: Collisions in a hash function with outputs become likely after roughly random queries, a counting fact about pairs ( when ). This shapes hash-output-length choice in every cryptographic protocol.
Pause and think: In how many ways can the letters of the word "BANANA" be arranged? Why is the answer rather than ? (Hint: identical letters cannot be distinguished by position.)
Try it
- Predict first: how many 5-card poker hands are there? Now compute and check.
- How many ways can 8 distinct books be split into two unordered piles of 4? Why is the answer rather than ?
- Use Pascal's recurrence to compute from and . Verify against the direct formula.
- True or false: . Give a one-sentence combinatorial proof.
- In a class of 30 students, 18 study calculus, 14 study probability, and 8 study both. How many study at least one? How many study neither?
A trap to watch for
The most common counting mistake is double-counting indistinguishable arrangements. If you count by stages (first choose the captain, then choose the 4 other team members), you are imposing an order on a team that has none, and your count will be too large by a factor of . The fix is either to count unordered from the start (use ), or to count ordered and divide by the over-count factor. Another classic trap: when sampling without replacement, the number of choices at each stage decreases, , whereas with-replacement counts give . Mixing these up turns birthday paradoxes into nonsense and inflates poker probabilities by orders of magnitude.
What you now know
You can pick the right counting tool by checking ordered-vs-unordered and disjoint-vs-overlapping, compute binomial coefficients via formula or Pascal's recurrence, expand binomial powers, and correct over-counts with inclusion-exclusion. The next section turns these counts into PROBABILITIES, ratios of favourable outcomes to total outcomes, and lays out the axioms that make those ratios behave consistently across compound events.
Mark section complete →
References
- Garrity, T. (2002). All the Mathematics You Missed: But Need to Know for Graduate School. Cambridge University Press, ch. 15.
- Ross, S. M. (2014). A First Course in Probability (9th ed.). Pearson, ch. 1.
- Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1 (3rd ed.). Wiley, ch. 2.
- Graham, R. L., Knuth, D. E., Patashnik, O. (1994). Concrete Mathematics (2nd ed.). Addison-Wesley, ch. 5.
- Stanley, R. P. (2011). Enumerative Combinatorics, Vol. 1 (2nd ed.). Cambridge University Press, ch. 1.