Idea: Add, then repair
Count each group alone, then subtract what you counted twice.
- Multiples of up to :
- Of : ; of both, that is of :
- Total:
Formula: Inclusion and exclusion
Add the sets, then subtract the overlap once.
Common mistake: Both means the least common multiple
Divisible by and is not divisible by .
Instead Use the least common multiple, . The product works only when the numbers share no factor.
Idea: Why the signs alternate
With more sets: add the singles, subtract the pairs, add the triples, and so on.
- An element in sets:
- Every element ends up counted exactly once
Idea: Count what you do not want
"Not adjacent", "at least one" and "none" signal the complement.
- A pair not adjacent in a row of :
Example: No letter in its own envelope
letters go into addressed envelopes. In how many ways does no letter reach its own?
- At least one right:
- None right:
Formula: Derangements
Start from D(1) = 0 and D(2) = 1. The share of derangements settles near 1/e.
Quick check: 5 letters, 5 envelopes
In how many ways can letters go into addressed envelopes with no letter in its own?
Show the answer
Answer:
, which is .
Idea: Narrate the correction
State the sets, then what got counted twice and how you repair it.
- Say so before you switch to the complement
- Close with a case you can list, such as
Courses / Combinatorics for interviews