Casework Counting
When a counting problem has no single clean formula, split it into cases that are mutually exclusive (no outcome lands in two cases) and exhaustive (every outcome lands in some case). Count each case separately, then add.
Choose your cases along the feature that is causing the trouble: the value of the largest digit, whether a coin came up heads, how many objects of a certain type were chosen, and so on. Good cases make each sub-count easy.
How many ordered pairs with have a multiple of ?
Case : — ways. Case : — ways. Case : — ways. Case : — way. These cases are disjoint and cover all multiples of between and , so the total is .
How many three-digit numbers have digits summing to ? Write the number as with . Case on the hundreds digit : for each the tens and units must sum to , giving ordered choices. Summing, numbers.
Pitfall: cases must not overlap. If an outcome could be counted in two cases, you will double count. Before adding, ask: “Could a single outcome satisfy two of my case descriptions?” If yes, redefine the cases (e.g. “exactly ” instead of “at least ”).
Complementary Counting
Sometimes counting what you don't want is far easier than counting what you do. If there are total outcomes and “bad” outcomes, then the number of “good” outcomes is
This shines when the good outcomes fracture into many messy cases but the bad ones form a tidy family (often a single case).
How many three-digit numbers ( to ) have at least one repeated digit? Total three-digit numbers: . The complement is “all digits distinct”: the hundreds digit has choices (--), the tens digit choices (any but the hundreds), the units choices, giving . Therefore the answer is .
Tip: the complement trick pairs perfectly with the phrase “at least one.” The opposite of “at least one” is “none,” which is usually one clean product. See the final section.
Constructive Counting
Build a valid configuration one decision at a time, and multiply the number of choices at each step (the multiplication principle). The art is choosing an order of decisions so that the number of options at each step does not depend on the earlier choices in a way you cannot track. Make the most constrained decision first.
Five people sit in a row of five chairs, but Alice and Bob refuse to sit in the two end chairs. Build the seating: first place the three “unrestricted” people (call them the others). Actually, seat the restricted pair first, since they are the bottleneck. The two end chairs must be filled by non-restricted people: choose an ordered pair for the two ends in ways. The remaining chairs take the remaining people in ways. Total .
How many length- strings over have no two adjacent 's? Build left to right and case on the number of 's. Equivalently, place the 's in gaps around the 's: with 's there are gaps and we choose positions for the 's. For A's we get .
Pitfall: the multiplication principle needs the count of options at each step to be constant, even if the specific options change. If step 3 sometimes offers choices and sometimes depending on step 1, split into cases first, then multiply within each case.
Overcounting and Correcting
Often the easiest count treats some outcomes as different when they should be the same. If every final object is produced the same number of times by your over-count , then
The classic example: arranging distinct objects in a circle. Linear arrangements give , but each circular arrangement appears times (one per rotation), so the count is .
How many distinct necklaces use different colored beads if rotations and reflections are considered the same? Line them up: arrangements. Each necklace can be rotated ways and flipped ways, so it is counted times. Answer: .
A club counts committees of from people by “pick a first member ( ways), pick a second ( ways)” getting . But and are the same committee, counted times. The true count is , showing is exactly correcting for the orderings.
Pitfall: division only works when every object is overcounted the same number of times. If some beads repeat, or a symmetric arrangement is fixed by a rotation, the copies are not all distinct and simple division fails — you need Burnside-style counting (final section).
Bijections & Correspondences
To count a hard set , find a bijection (a one-to-one, onto pairing) with an easier set ; then . A bijection guarantees “no misses, no doubles.” Two famous correspondences:
- 1pt
- Subsets binary strings: subsets of an -set correspond to
length- strings of
0/1, so there are subsets. - Stars and bars: the number of ways to write as an ordered sum of nonnegative integers equals , by pairing each solution with an arrangement of stars and bars.
How many solutions in nonnegative integers does have? Represent a solution as stars split by bars, e.g. . Each arrangement of stars and bars gives exactly one solution, so the count is .
How many shortest grid paths go from to moving only right/up? Each path is a sequence of R's and U's — a bijection with strings, so .
Tip: to prove your map is a bijection, describe the inverse: given an object in , recover exactly one object in . If you can undo the map uniquely, it is a bijection.
“At Least One” via the Complement
The event “at least one” is the complement of “none.” In counting,
and in probability, . Because “none” usually means every trial avoids independently, its count/probability is a single product.
Roll a fair die times. Probability of at least one six? “No six” on all four rolls has probability . So .
Tip: watch for the words at least, at most, some, none. These almost always signal complementary counting. “At least one” subtract “none”; “at most one” subtract “two or more.”
Going Deeper: Combining Strategies
Contest problems rarely use one idea in isolation. Common combinations:
- 2pt
- Casework complementary: split off the easy-to-count bad outcomes with cases, subtract from the total. E.g. “at least two of a kind” total (all distinct).
- Constructive overcounting: build with the multiplication principle, then divide out an ordering or symmetry you introduced (this is exactly how arises).
- Casework inside a bijection: map to an easier set, then do casework there.
When simple division fails because some arrangements are fixed by a symmetry, use the Burnside idea: the number of distinct arrangements equals the average number of arrangements left unchanged by each symmetry:
where is the group of symmetries (e.g. the rotations of a circle) and counts colorings unchanged by . When no nontrivial symmetry fixes any coloring, every except the identity, and Burnside collapses to the plain division .
Color the beads of a triangular bracelet with colors, rotations only ( has elements: rotate by ). Identity fixes all colorings; each nontrivial rotation fixes only the monochromatic colorings. By Burnside, distinct bracelets.
Big picture: every strategy here answers the same question — “how do I count each valid outcome exactly once?” Casework partitions the outcomes; complementary counting flips to the easier side; constructive counting sequences the decisions; overcounting/Burnside repairs double counts; bijections transport the problem somewhere friendlier. When stuck, ask three questions: Is the opposite easier to count? Can I break this into clean cases? Am I counting anything more than once?
Burnside's Lemma (Orbit-Counting Theorem)
Let a finite group of symmetries act on a set of configurations (colorings, labelings, …). Two configurations are “the same” when one can be carried to the other by some ; the resulting equivalence classes are called orbits. The number of distinct configurations is the number of orbits, and
where is the set of configurations left unchanged by . In words: the number of distinct objects equals the average number of colorings fixed by a symmetry. This is the rigorous repair for the “divide by symmetry” shortcut, and it never overcounts even when some configurations have extra symmetry.
When permutes the “slots” (beads, faces, cells) and you may color each slot freely with colors, a coloring is fixed by iff every slot in a cycle of receives the same color. Hence
where is the number of disjoint cycles of (fixed points count as -cycles). So the whole problem reduces to a cycle census of the group.
Count the distinct bracelets of beads, each black or white, where rotations and reflections are considered the same. The symmetry group is the dihedral group with . Take a cycle census, using .
Rotations by positions have cycles:
Reflections (six of them, since is even): axes pass through two opposite beads ( fixed beads swaps cycles each), and axes pass through opposite edges ( swaps cycles each). Reflection sum . Therefore
(Rotations alone would give necklaces; folding in reflections identifies one mirror pair, leaving .)
How many distinct ways can the faces of a cube be painted using available colors, where two paintings are the same if a rotation of the cube carries one to the other? The rotation group has . Census of how each rotation type permutes the faces:
Averaging over the group,
The same recipe with colors gives colorings.
Method: (1) identify the symmetry group and its size; (2) sort the elements into a few types (identity, rotations by angle, reflections through this-or-that axis); (3) for each type find and multiply by how many elements have that type; (4) add and divide by . The answer is always an integer — a fast sanity check on your census.
The “Divide by Symmetry” Trap, Formalized
The shortcut (over-count divided by the number of symmetries) is valid exactly when the group action is free: no nontrivial symmetry fixes any configuration, so every orbit has the full size . This is the regular/free case. Equivalently, by the orbit--stabilizer theorem,
so orbits all have size precisely when every stabilizer is trivial. If some configuration is fixed by a nontrivial (a symmetric coloring), its orbit is smaller than , plain division undercounts the collapse and gives the wrong answer, and you must use Burnside.
Naively “ colorings, divide by symmetries” gives — not even an integer, a red flag. The action is not free: the all-black bracelet is fixed by all symmetries (stabilizer size , orbit size ), and a bracelet like BWBWBW is fixed by several rotations and reflections. These small orbits are exactly what Burnside's averaging accounts for, producing the correct from the previous section. Plain division is only correct for the asymmetric colorings, whose orbits genuinely have full size .
Seat distinct people around a round table; rotations are equivalent (no reflections). No nontrivial rotation can fix an arrangement of distinct people, so the action of the rotations is free and every orbit has size . Plain division is valid: . The distinctness of the objects is what guarantees freeness.
Decision rule: before dividing by , ask “could any nontrivial symmetry leave a configuration unchanged?” If the objects being arranged are all distinct and is just rotations, usually no — divide freely. If repeats are allowed (colorings) or reflections are included, symmetric configurations almost always exist — reach for Burnside. A non-integer after dividing is proof the action was not free.
Complementary Counting Meets Inclusion--Exclusion
The strongest complementary arguments subtract a union of bad events, and unions are handled by inclusion--exclusion:
Use this when “good” means “avoids every one of several forbidden features.” The intersections are usually easy products, even when the individual good count is a casework nightmare.
How many integers in are divisible by none of ? Let be the multiples of . Then ; pairwise ; and . The count divisible by at least one is
so the answer is the complement .
How many functions from a -element set onto a -element set are there? Let be the functions that miss value . A surjection avoids every , so
Direct casework on the “shape” of the preimages ( vs. ) also works but is error-prone; the complementary/IE form is mechanical.
Tip: inclusion--exclusion signs alternate, so a sign slip is the most common mistake. Check the last term's sign: with forbidden properties it is . Also verify a small case by hand (e.g. surjections from a -set onto a -set should give ) before trusting the general formula.
Systematic Casework and Generating Functions
Two cases are not equal in quality. Aim for a parameter that is most constraining and symmetry-friendly:
- 2pt
- Case on the extreme: the largest element, the maximum multiplicity, the position of the first success. Extremes split the problem into independent “above” and “below” pieces.
- Exploit symmetry to fuse cases: if the roles of two variables are interchangeable, count one ordering and multiply (remember to halve the tie case). This can cut the case count in half or more.
- Prefer few fat cases over many thin ones: a parameter taking values, each an easy product, beats one taking values you must enumerate.
A generating function replaces casework with algebra: the number of ways to choose objects with a target total is a coefficient in a product of polynomials/series. Each factor encodes one independent choice; multiplying performs the “add over all splits” automatically. Bounded choices give finite polynomials; a single die is .
In how many ordered ways do three dice (--) sum to ? The generating function is , and we want the coefficient of . Shift each die by (let , etc.), so we need with . Unbounded stars and bars gives ; subtract the solutions where some variable exceeds (i.e. is ). Forcing one variable up by leaves a sum of among three nonnegative variables, ways, and there are choices of which variable overflowed (no two can overflow since ). Thus
Compare the raw casework: summing over forces you to track the -- bounds on case by case; the GF/IE route handles every bound in one subtraction.
Tip: the substitution “” turns any constraint into a nonnegativity constraint so stars and bars applies; each upper bound violation is then removed by one inclusion--exclusion term (shift the offending variable past its ceiling). If at most one variable can overflow, that correction is a single clean subtraction, as above.
Formulas, Proofs & Tips
What it means. Sometimes it is easier to count what you do not want.
Example. At least one head in flips: .
Why it works. Every outcome is either in or not, and never both, so the two counts partition the whole set and must add to the total.
Tip. Split into cases that are disjoint and exhaustive — no overlap, nothing missed — then add the case counts.