Advanced Counting Techniques
Some counting problems exceed the reach of simple permutations and combinations. Several powerful techniques handle harder cases. Inclusion-exclusion handles unions of overlapping sets: to count items in A or B or C, you add the sizes of A, B, C, subtract the pairwise intersections, and add back the triple intersection (with appropriate signs continuing for more sets). Generating functions encode counting problems as power series; algebraic operations on the series correspond to combinatorial operations on the underlying objects, often producing closed-form answers. Recurrence relations express the count of n-step problems in terms of the count for fewer steps, often solved with characteristic equations or generating functions.
A classic example uses inclusion-exclusion. How many integers from 1 to 100 are divisible by 2, 3, or 5? The naive approach overcounts numbers divisible by multiple. Using inclusion-exclusion: 50 (divisible by 2) + 33 (divisible by 3) + 20 (divisible by 5) - 16 (divisible by 6) - 10 (divisible by 10) - 6 (divisible by 15) + 3 (divisible by 30) = 74. The formula handles overlap precisely. Inclusion-exclusion appears in probability (P(A or B or C)), set theory, and many real applications (counting valid passwords with required character types, counting spanning trees in graphs).
Why is inclusion-exclusion needed when counting unions of overlapping sets?
Recurrence relations are central to combinatorics and computer science. The Fibonacci sequence (F(n) = F(n-1) + F(n-2)) is the most famous, but recurrences appear everywhere: counting paths in graphs, analyzing recursive algorithms, computing tournament outcomes, modeling biological growth. The Catalan numbers count many seemingly different objects (balanced parentheses, binary tree structures, monotonic lattice paths) and satisfy a non-trivial recurrence. Master theorems for recurrences let computer scientists analyze divide-and-conquer algorithms (like merge sort, where T(n) = 2 T(n/2) + n produces O(n log n) running time). Strong combinatorial training pays off across many fields.
Solve a Recurrence
How many ways can you tile a 1-by-n strip with 1-by-1 squares and 1-by-2 dominoes? Let T(n) be the answer. T(1) = 1, T(2) = 2 (two squares or one domino), T(3) = 3, T(4) = 5. Notice the pattern: each T(n) = T(n-1) + T(n-2). The answer is the n-th Fibonacci number. The exercise reveals how recurrences emerge from real counting problems.
Combinatorics is one of the most useful and surprisingly elegant branches of mathematics. The principles in this unit, basic counting, permutations, combinations, the binomial theorem, and advanced techniques, will keep paying off in probability, computer science, statistics, and many practical problems involving counting and arrangement.
Want to keep learning?
Sign up for free to access the full curriculum — all subjects, all ages.
Start Learning Free