Handle the constrained choice first
If the first digit cannot be 0, choose it first (9 ways) and then the rest freely. Choosing left to right regardless is what creates the difficulty.
Restrictions make counting harder in a specific way: they break the product rule's uniformity. Three techniques repair it — apply the constraint first, split into cases, or count the complement.
Core ideas
A restriction is a place where the product rule stops applying directly. Each technique restores it.
If the first digit cannot be 0, choose it first (9 ways) and then the rest freely. Choosing left to right regardless is what creates the difficulty.
Cases must be disjoint and exhaustive — the same discipline as a proof by cases in “Cases, Counterexamples, and Writing a Proof” in Logic and Proof.
The complement of "at least one" is "none", which is a single unrestricted count.
The material
The three techniques, each on an example where it is clearly the right one.
How many 4-digit numbers are there? The first digit cannot be 0, so choose it first: 9 ways, then 10 · 10 · 10 for the rest, giving 9000. Working left to right without noticing the restriction gives 10⁴ and counts 0123 as a four-digit number.
Four-digit numbers, first digit nonzero and last digit even. Constrain both ends first: 9 choices for the first, 5 for the last, then 10 · 10 in the middle — 9 · 10 · 10 · 5 = 4500. Order of consideration is free; order of positions is not.
Four-digit numbers with first digit nonzero and all digits distinct. Constrain first: 9 choices for the leading digit. The second digit may be anything except the first, including 0, so 9 choices; then 8; then 7. Total 9 · 9 · 8 · 7 = 4536. Note the second count is 9 and not 8 — 0 becomes available exactly because it was excluded from the first position.
Where two restrictions genuinely interact, cases are unavoidable. To count the strings of length 4 over {a, b, c} with at least two as, split by the number of as — exactly two, exactly three, exactly four — count each, and add. The cases are disjoint because a string has one definite number of as. The worked example below does it, and then does it again by complement.
How many 5-digit PINs have at least one repeated digit? All PINs: 10⁵ = 100000. All-distinct PINs: 10 · 9 · 8 · 7 · 6 = 30240. Answer 69760. The direct count would need cases for one pair, two pairs, a triple, and so on — overlapping and easy to get wrong.
The general signal: if the condition is "at least" something, or "not all", or "some", the complement is usually a single clean count. If it is "exactly", cases are usually right.
Interactive
Enumerated while enumeration is possible
Method
Identify what the restriction breaks, then choose the repair.
Deal with them first so the remaining choices are uniform. This alone handles most restrictions.
Choose the case variable so that within each case the product rule applies cleanly.
Total minus the objects failing the condition. One subtraction, no overlap.
Shrink the parameters until enumeration is possible and compare. A formula that disagrees with a list is wrong.
How many strings of length 4 over {a, b, c} have at least two as?
Two independent routes to 33. That agreement is the real check: a single method producing a plausible number is not evidence that the classification was right, and the case method is where a missing case would show up. The six position pairs were listed by hand; “Combinations” gives them a name and a formula, C(4, 2) = 6, and from then on they need not be listed.
Count the 4-digit numbers (leading digit nonzero) that contain at least one 7, by complement and by cases on the position of the first 7 — a classification that is disjoint and exhaustive because every such number has exactly one first 7. Constrain the leading digit first in every case. If the two totals agree you have both the arithmetic and the classification right.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.