The inclusion-exclusion principle
Master the inclusion-exclusion principle for Year 11 Specialist Mathematics in Queensland (QCAA). It counts the elements in a union of overlapping sets — for both two sets and three sets — without ever double-counting what they share.
You will learn to read Venn diagrams, subtract the overlaps in the right order, and answer "at least one", "neither" and divisibility questions — a core counting technique for probability later in the course.
Theory
The inclusion-exclusion principle counts the elements in a union of overlapping sets without double-counting the parts they share. In Year 11 Specialist Mathematics (QCAA, Queensland) it is used for the union of two and of three sets. This page gives the rules, Venn-diagram pictures and full worked examples.
A set is a collection of objects; \(|A|\) means the number of elements in set \(A\). The union \(A\cup B\) is everything in \(A\) or \(B\) (or both), and the intersection \(A\cap B\) is only what is in both.
If you simply add \(|A|+|B|\), every element in the overlap is counted twice. The inclusion-exclusion principle fixes this: include the sets, then exclude the overlap so it is counted once.
For three sets the shared parts are more tangled, so you add the three single totals, subtract the three pairwise overlaps, then add back the triple overlap (which the subtractions removed one time too many).
A Venn diagram makes this concrete: each separate region is counted exactly once, so the union is the sum of all the region counts. Related ideas are the complement ("neither", found by subtracting the union from the total) and "exactly one" or "exactly two".
For the union of two sets, subtract the overlap once:
For the union of three sets, subtract each pair, then add back the triple:
How to apply inclusion-exclusion
- List the totals you know: each single set, each pairwise overlap, and (for three sets) the triple overlap.
- Choose the rule: use the two-set formula for two sets, or the three-set formula for three.
- Substitute and simplify: add the singles, subtract the overlaps, add back the triple, one operation per line.
- Answer the actual question: for "neither" subtract the union from the total; for "exactly one/two" combine the matching Venn regions.
"At least one" is the union; write the two-set rule, then substitute and simplify one step at a time:
| \(|T \cup N|\) | \(=\) | \(|T| + |N| - |T \cap N|\) |
| \(=\) | \(18 + 15 - 7\) | |
| \(=\) | \(33 - 7\) | |
| \(=\) | \(26\) |
\(26\) students play at least one sport.
First count how many study at least one (the union):
| \(|F \cup J|\) | \(=\) | \(|F| + |J| - |F \cap J|\) |
| \(=\) | \(14 + 11 - 6\) | |
| \(=\) | \(25 - 6\) | |
| \(=\) | \(19\) |
Then subtract the union from the class total to leave those in neither set:
| \(\text{neither}\) | \(=\) | \(25 - |F \cup J|\) |
| \(=\) | \(25 - 19\) | |
| \(=\) | \(6\) |
\(6\) students study neither language.
Use the three-set rule: add the three singles, subtract the three pairs, add back the triple:
| \(|S \cup C \cup T|\) | \(=\) | \(|S|+|C|+|T|-|S\cap C|-|S\cap T|-|C\cap T|+|S\cap C\cap T|\) |
| \(=\) | \(28 + 20 + 18 - 10 - 8 - 6 + 3\) | |
| \(=\) | \(66 - 24 + 3\) | |
| \(=\) | \(42 + 3\) | |
| \(=\) | \(45\) |
\(45\) students play at least one sport.
Count the multiples of each; the elements in both are the multiples of \(15\) (the lowest common multiple), subtracted once:
| \(\text{multiples of } 3\) | \(=\) | \(33\) |
| \(\text{multiples of } 5\) | \(=\) | \(20\) |
| \(\text{multiples of } 15\) | \(=\) | \(6\) |
| \(\text{by } 3 \text{ or } 5\) | \(=\) | \(33 + 20 - 6\) |
| \(=\) | \(53 - 6\) | |
| \(=\) | \(47\) |
\(47\) integers are divisible by \(3\) or \(5\).
Common pitfalls
Frequently asked questions
What is the inclusion-exclusion principle?
It is a rule for counting the elements in a union of overlapping sets. You add the sizes of the sets, then subtract the sizes of the overlaps so each element is counted once.
What is the formula for the union of two sets?
\(|A\cup B| = |A| + |B| - |A\cap B|\): add the two set sizes and subtract the number in both.
What is the formula for three sets?
\(|A\cup B\cup C| = |A|+|B|+|C| - |A\cap B| - |A\cap C| - |B\cap C| + |A\cap B\cap C|\): add the singles, subtract the pairs, add back the triple.
How do you find how many are in neither set?
Find the union with inclusion-exclusion, then subtract it from the total number in the group: \(\text{neither} = n - |A\cup B|\).
Why do you subtract the intersection?
Because elements in both sets are counted once in \(|A|\) and again in \(|B|\). Subtracting \(|A\cap B|\) once removes the double count.
How do you count integers divisible by 2 or 3?
Count the multiples of \(2\), add the multiples of \(3\), then subtract the multiples of \(6\) (divisible by both), because those were counted twice.