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.
When no single formula applies, split into cases that do not overlap and cover everything, or count the complement ("at least one" is best counted as "all minus none"), or count with overcounting on purpose and divide by the repetition. Constructive counting — build the object one decision at a time — is the default strategy.
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 .
Cases that overlap or leave a gap. Before adding case counts, state the criterion that assigns each outcome to exactly one case.
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 ”).
How many two-digit numbers have digits that sum to ?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: Two-digit numbers with digit sum . Write the number with tens digit and units digit , so we need . For a two-digit number the tens digit must satisfy , while the units digit satisfies . Once we pick , the units digit is forced to be , and this is a valid digit (–) exactly when . Listing them:
There are such numbers.
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 .
Taking the wrong opposite. The opposite of "at least one repeated digit" is "no digit repeated", not "all digits the same". Subtracting the numbers gives , which still includes every number like with exactly one repeat and many with none. Write the complement as a sentence with "no" or "none" in it before you count it: here, all three digits distinct, numbers, so have a repeat.
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.
How many -letter strings of capital letters (–, repeats allowed) contain at least one vowel ()?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: Count the complement, strings with no vowel: each of the positions is one of the consonants, strings. All strings: . So
strings contain a vowel. Counting "exactly one vowel, exactly two, …" directly would need four cases.
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. How many seatings are possible?
Solution. The end chairs are the bottleneck, so fill them first, from the people who are neither Alice nor Bob: choices for the left end, then for the right end, ways. The three middle chairs take the three people left (Alice, Bob and one other) in any order, ways. At every step the number of choices is the same whatever happened before, so the total is .
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.
How many odd four-digit numbers have four different digits?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: Most constrained first. Units digit: odd, choices. Thousands digit: not and not the units digit, choices (the units digit is odd, so it is never , and the count is always ). Hundreds digit: any of the digits not yet used. Tens digit: . Total .
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.
Dividing when the overcount is not uniform. Bracelets of beads, black and white, with rotations and flips identified: rows number , and a square has symmetries, so "" is not even a whole number. The two actual bracelets (blacks adjacent, blacks opposite) are produced times and times among the rows, not times each, because symmetric bracelets are fixed by some of the motions. Division needs every object counted equally often; otherwise use Burnside.
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).
How many diagonals does a convex decagon ( sides) have?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: Count from each vertex: a diagonal joins it to any vertex other than itself and its neighbours, diagonals per vertex, in all. Every diagonal was counted from both of its ends, exactly twice, so there are .
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:
- 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.
In how many ways can be written as an ordered sum of positive integers (for example )?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: Line up stars. An ordered sum of positive parts is the same as cutting the row in of the gaps between neighbouring stars, one cut per gap (a gap can hold only one cut, or a part would be empty). The map is reversible: the part sizes tell you where the cuts are. So the count is .
“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.”
A coin is flipped times. How many of the possible outcomes show at least one head?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: At least one head in flips. Each flip has outcomes, so there are total sequences. Use complementary counting: the only outcome with no head is , which is outcome. Therefore the number with at least one head is
Going Deeper: Combining Strategies
Contest problems rarely use one idea in isolation. Common combinations:
- 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?
How many two-digit numbers contain the digit at least once?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: Two-digit numbers containing the digit . There are two-digit numbers in all ( through ). Count the complement — those with no . The tens digit must be one of : choices. The units digit must be one of : choices. So numbers avoid the digit , and
contain at least one .
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.
How many necklaces of beads can be made with available colours, if two necklaces are the same when one is a rotation of the other (no flipping)?
Work it on paper before revealing the answer.
Show the answerHide the answer
Answer: The group is the rotations. Cycle census on the bead positions: the identity has cycles ( fixed colourings); rotation by one or three places is a single -cycle ( each); rotation by two places swaps opposite beads, cycles (). Burnside:
There are necklaces.
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:
- 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.
Why It Works
Casework is legitimate because the cases partition the set: every object is in exactly one, so the counts add. Complementary counting is , the simplest instance of inclusion–exclusion. Dividing by symmetry works when each object is counted the same number of times — circular arrangements of people are because each seating is counted once per rotation, and all rotations of a seating are the same arrangement.
Do not read a proof the way you read a rule. Cover the last line, ask what the previous line forces, and only then uncover it. If a step feels like magic, that is the step to work by hand with a concrete number.
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.