In one sentence
Why these seven terms, with these signs? Look at any single element. If it belongs to exactly of the sets (), the formula counts it
times: no more, no less, exactly once. The figure above spreads this out for you: each term you switch on adds one to, or takes one from, the “times counted” of the regions it covers.
Example: how many numbers from 1 to 100 are multiples of 2, 3 or 5?
Step 1 / 4- First add the single sets
, , . The regions where two sets overlap are counted times; the very middle is counted times.
Predict first
After adding the three single sets and subtracting the three pairwise intersections, how many times in total has the region common to all three () been counted?
times. So the last term is not a “small correction”: it is essential. Without it, the elements in all three sets are not counted at all. Switch off the last term in the figure above and look at the badges.
Stop 1 · Operations on Sets (Vol. 1)
“Satisfies none of them” is the intersection . By De Morgan's laws it equals : count the union first, then subtract it from the universal set.
Example: how many numbers from 1 to 1000 are multiples of none of 2, 3 and 5?
Step 1 / 4- De Morgan
We are counting the intersection of three complements, which is the complement of the union.
Stop 2 · Counting the Elements of a Finite Set (Vol. 1)
Count surjections: every element of the target is hit at least once. The opposite is “some element is never hit”, which is exactly what inclusion–exclusion does best.
Example: how many surjections are there from a 5-element set onto the 3-element set {a, b, c}?
Step 1 / 4- All mappings
Each element has places to go.
Stop 3 · Inclusion–Exclusion and derangements (Vol. 1)
letters go into addressed envelopes. In how many ways can every letter go into the wrong envelope? That is the derangement number .
Example: find D₄
Step 1 / 4- Bad events
: letter is in the right envelope. A derangement is when none of the happens.
Practice
How many of are multiples of or multiples of ?
How many of are divisible by none of ?
people each write a greeting card. The cards are collected, shuffled and handed out, one per person. In how many ways can this happen so that nobody gets their own card?
In how many ways can different balls be put into different boxes so that every box gets at least one ball?