07 Advanced Counting Methods
A progressive guide to choosing and applying binomial coefficients, the binomial theorem, inclusion-exclusion, and recurrence relations in advanced counting problems.
Recognizing the Structure of a Counting Problem
Advanced counting becomes manageable when the same objects can be described through complementary viewpoints: selecting a subset, expanding a power, correcting overlaps, or building larger objects from smaller ones. The first step is to identify what is being counted and whether order, repetition, overlap, or local restrictions matter.
A useful decision process is:
Select a fixed number of distinct objects with order irrelevant: use a .
Expand a power or extract one coefficient: use the .
Count objects satisfying at least one of several overlapping properties, or avoiding all listed restrictions: use inclusion-exclusion.
Construct objects by extending smaller valid objects: derive a .
Distribute identical units among distinguishable categories: consider .
The central habit is to describe the objects in a way that prevents omission and overcounting.
Takeaway: Choose the method from the structure of the objects, not merely from the size of the numbers.
Selecting Objects and Distributing Repetitions
When choosing an unordered collection of objects from distinct objects, the number of choices is
The factorials account for all arrangements while the denominator removes the ordering of the selected and unselected objects. For example, a committee of three chosen from eight people has
possible memberships.
Two identities make computation and reasoning easier:
Symmetry: . Choosing what is included is equivalent to choosing what is left out.
Pascal's identity: . Separate selections according to whether a distinguished object is included.
Summing every possible subset size gives
because each of the elements is independently included or excluded.
When repetition is allowed, the situation changes. The number of ways to select objects from types is
For instance, the nonnegative integer solutions of number
Takeaway: Use ordinary binomial coefficients for distinct objects without order, and when identical units may be repeated across distinguishable types.
Expanding Powers and Extracting Coefficients
The organizes the expansion of a power:
The coefficient appears because a term containing copies of is formed by choosing which of the factors contribute ; every remaining factor contributes .
For example,
Coefficient extraction is often faster than full expansion. The coefficient of in is
Two substitutions reveal important counting identities:
Setting gives .
Setting and gives for .
The second identity reflects cancellation between even-sized and odd-sized selections and is closely connected to inclusion-exclusion.
Takeaway: Match the requested monomial to the number of factors contributing one of its variables; the corresponding is its coefficient.
Correcting Overlaps with Inclusion-Exclusion
The corrects the overcounting caused by overlaps. For two finite sets,
The intersection is subtracted because its elements were counted twice. For three sets, add the three individual counts, subtract the three pairwise intersections, and add the triple intersection.
In general,
To count objects that avoid every restriction, let be the objects violating restriction . Then subtract their union from the whole set:
For example, among the integers from through , the counts divisible by , , or are , , and . Their pairwise intersection counts are , , and , and the triple intersection count is . Therefore,
A derangement is a permutation in which no object remains in its original position. If counts derangements of objects, inclusion-exclusion gives
Takeaway: List overlaps by intersection size and alternate signs: add singles, subtract pairs, add triples, and continue.
Building and Solving Recurrences
A is effective when valid objects can be partitioned into disjoint cases based on a first step, final step, or distinguished component. The cases must be exhaustive and disjoint, and the recurrence must be accompanied by initial conditions.
For binary strings of length with no consecutive s, inspect the final digit. Strings ending in contribute ; strings ending in must have a preceding , leaving possibilities. Thus,
For tilings of a board with dominoes, the leftmost portion is either one vertical domino or two horizontal dominoes. This gives
Some recurrences can be unrolled directly. If
then
For a second-order homogeneous recurrence, try . The resulting determines the possible exponential terms. If the roots are distinct, the general form is
with constants fixed by the initial conditions. For the Fibonacci recurrence, the roots are
which leads to
For a nonhomogeneous recurrence such as , solve the associated homogeneous recurrence, find a particular solution, combine them, and then apply the initial condition. A constant particular solution satisfies , so , giving the general form .
Takeaway: First find a sound case split; only then perform the algebra needed to solve the resulting recurrence.