Resources For Teachers For Tutors For Students & Parents Pricing
Year 11 Specialist (Unit 1 & 2) Combinatorics

The inclusion-exclusion principle

20 practice questions 0 video lessons Theory + worked examples

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.

Create a free accountTrack your progress and save your work as you go.
Create free account

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".

Two-set Venn diagram Two overlapping circles A and B. A-only region shows 7, the overlap shows 5, and B-only shows 4, from |A| = 12, |B| = 9 and |A intersect B| = 5. 7 5 4 A B
Two sets: \(|A|=12,\ |B|=9,\ |A\cap B|=5\) give regions \(7,5,4\), so \(|A\cup B|=16\).
Three-set Venn diagram Three overlapping circles A, B and C. Only-A shows 8, only-B shows 6, only-C shows 5; the A-B overlap shows 3, A-C shows 2, B-C shows 1, and the centre triple overlap shows 2. 8 6 5 3 2 1 2 A B C
Three sets: each region counted once; single totals \(15,12,10\), pair overlaps \(5,4,3\), triple \(2\).

For the union of two sets, subtract the overlap once:

\[ |A\cup B| = |A| + |B| - |A\cap B| \]
|AB|=|A|+|B||AB|

For the union of three sets, subtract each pair, then add back the triple:

\[ |A\cup B\cup C| = |A|+|B|+|C| - |A\cap B| - |A\cap C| - |B\cap C| + |A\cap B\cap C| \]
|ABC|=|A|+|B|+|C||AB||AC||BC|+|ABC|
Sign pattern. Add the single sets, subtract the pairwise overlaps, add back the triple overlap. For "neither", subtract the whole union from the total: \(\text{neither} = n - |A\cup B|\).

How to apply inclusion-exclusion

  1. List the totals you know: each single set, each pairwise overlap, and (for three sets) the triple overlap.
  2. Choose the rule: use the two-set formula for two sets, or the three-set formula for three.
  3. Substitute and simplify: add the singles, subtract the overlaps, add back the triple, one operation per line.
  4. Answer the actual question: for "neither" subtract the union from the total; for "exactly one/two" combine the matching Venn regions.
Example 1 — Union of two sets
In a group of \(30\) students, \(18\) play tennis and \(15\) play netball; \(7\) play both. How many play at least one of the two sports?
Solution

"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.

Example 2 — Complement (neither)
In a class of \(25\) students, \(14\) study French, \(11\) study Japanese and \(6\) study both. How many study neither language?
Solution

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.

Example 3 — Union of three sets
In a year group, \(28\) play soccer, \(20\) cricket and \(18\) tennis; \(10\) play soccer and cricket, \(8\) soccer and tennis, \(6\) cricket and tennis, and \(3\) play all three. How many play at least one sport?
Solution

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.

Sports Venn diagram Three circles for Soccer, Cricket and Tennis. Soccer-only 13, Cricket-only 7, Tennis-only 7; Soccer-Cricket 7, Soccer-Tennis 5, Cricket-Tennis 3, all three 3. 13 7 7 7 5 3 3 S C T
Example 4 — Counting a divisibility union
How many integers from \(1\) to \(100\) are divisible by \(3\) or \(5\)?
Solution

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

Forgetting to subtract the overlap. Watch out for adding \(|A|+|B|\) and stopping — that counts everyone in both sets twice. Always subtract \(|A\cap B|\) once.
Wrong signs for three sets. The pattern is add singles, subtract pairs, add back the triple. Subtracting the triple (or forgetting it) is the most common slip.
Mishandling "neither". "Neither" is not \(n-|A|-|B|\). Find the union first, then subtract it from the total: \(\text{neither}=n-|A\cup B|\).
"Both" divisors means the LCM. Numbers divisible by both \(4\) and \(6\) are multiples of \(12\), their lowest common multiple — not multiples of \(24\).

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.