Counting Without Listing
Sometimes the easiest way to count what you want is to count what you do NOT want: .
In plain terms. Count everything, count the "bad" ones, subtract.
Example. How many 3-digit numbers contain at least one 7? Total: . With no 7s: . So .
Why "not" is so often easier: a condition like "contains at least one " can be met in many overlapping ways (the could be in any position, or in several), but its opposite, "contains no ", is one restriction applied to every digit separately — and independent restrictions multiply. Parity arguments are the same kind of shortcut: they replace a computation by a count of odd terms.
Split the count into cases that do not overlap and together cover everything, then add the case counts.
In plain terms. Sort the possibilities into non-overlapping piles and count each pile.
Example. Two dice sum to : the cases are — exactly ways.
The parity of a sum depends only on how many ODD terms it has — an even number of odd terms gives an even sum.
In plain terms. You can often decide odd vs. even without computing anything.
Example. is odd because it contains five odd terms, and is odd.
How many integers from to do not contain the digit ?
Step 1 — pad with zeros so every number has three digits, to .
Step 2 — each digit avoids in ways, independently: strings.
Step 3 — that includes , which is not in the range: . Padding makes the positions independent; removing is the price.
Can people each shake hands with exactly of the others?
Step 1 — add up the handshakes each person makes: .
Step 2 — every handshake involves two people, so this total counts each handshake twice and must be even.
Step 3 — is odd. Impossible. Parity settled it without trying a single arrangement.
Padding without un-padding. Counting " to " as to is a good trick, but the extra string has to be removed, and for questions like "how many are three-digit numbers?" the padded ones with a leading must go too.
How many four-digit numbers contain at least one even digit?
Show the answerHide the answer
Total four-digit numbers: . With every digit odd: (the first digit is odd, so it is automatically not ). At least one even digit: .
Paths, Pairs and Handshakes
Paths from to moving only right and up: , because a path is a word in Rs and Us.
From to there are paths. Blocked squares are handled by subtraction: count all paths, then subtract those through the blocked point, which is a product of two smaller path counts. That "through a point" factorisation — paths to it, times paths from it — is the whole technique.
people each shaking every other hand once make handshakes; the same count gives diagonals of a polygon, , after removing the sides.
Ten people make handshakes; a decagon has diagonals. The trap is the factor of two: counting "each of people shakes hands" gives , which counts every handshake from both ends. Whenever a count seems to be exactly twice what it should be, look for an ordered/unordered mismatch.
How many right/up paths from to avoid the point ?
Step 1 — all paths: .
Step 2 — paths through : .
Step 3 — subtract: . The middle step is the product rule: a path through is a path to it followed by a path from it, chosen independently.
Which polygon has exactly diagonals?
Step 1 — the diagonal count is : each vertex joins to the vertices that are not itself or its neighbors, and each diagonal is counted from both ends.
Step 2 — ; try values: gives .
Step 3 — an octagon.
Counting grid points instead of steps. A path across a block of squares has right steps and up steps — paths — even though there are columns and rows of intersection points. Count the moves, not the dots.
At a party every pair of the guests shakes hands once. How many handshakes?
Show the answerHide the answer
.
Venn Diagrams and Inclusion–Exclusion
For two sets, . For three, .
Why the corrections: counts everything in the overlap twice, once in each set, so the overlap is subtracted once. With three sets, a point in all three is added three times and subtracted three times, leaving it uncounted — so it is added back once. The Venn diagram shows the same bookkeeping region by region, and filling it from the INSIDE out (triple overlap first) avoids every sign error.
In a class of , students play soccer, play basketball, and play both. How many play neither?
Step 1 — at least one sport: .
Step 2 — neither: . In the diagram: both , soccer only , basketball only , and .
How many integers from to are divisible by or by ?
Step 1 — multiples of : ; of : .
Step 2 — both means divisible by : of them.
Step 3 — .
How many integers from to are divisible by , or ?
Step 1 — singles: .
Step 2 — pairs: divisible by : ; by : ; by : ; subtract .
Step 3 — all three, divisible by : ; add back.
Step 4 — . So numbers from to are divisible by none of , , .
Forgetting to add back the triple overlap. Stopping at leaves the numbers uncounted: each was added three times and subtracted three times.
In a group of people, like apples, like bananas, and like neither. How many like both?
Show the answerHide the answer
At least one: . Then , so both .
Putting It Together
How many integers from to are divisible by neither nor ?
Step 1 — complement: count those divisible by or and subtract from .
Step 2 — inclusion–exclusion: (the are multiples of ).
Step 3 — . These are the numbers leaving remainder or on division by : two in every block of six, and is ten blocks.
Does order matter? Is there an "at least" (complement)? Do the categories overlap (inclusion–exclusion)? Is there a parity or pairing that makes the answer immediate? Answer these first and most AMC 8 counting problems become one line.
How many three-digit numbers have all digits odd and at least one digit equal to ?
Show the answerHide the answer
All digits odd: . All odd and no (digits from ): . At least one : .