Opening the book…
The Inclusion-Exclusion Principle is a counting method used when groups overlap. It helps you count the total number of distinct items without counting any item more than once.
Two Sets
If you have two sets, A and B:
- Start by adding the number of elements in each set.
- Because any element that belongs to both sets is counted twice, subtract the overlap once.
n(A ∪ B) = n(A) + n(B) − n(A ∩ B)

Example:
In a class:
- 18 students play soccer.
- 12 students play basketball.
- 5 students play both.
The total number of students who play at least one of the sports is
18+12−5=25.18 + 12 - 5 = 25.18+12−5=25.
The 5 students who play both sports were counted twice, so we subtract them once.
Three Sets
With three sets, the idea is similar, but there is one extra step.
- Add the sizes of all three sets.
- Subtract each pairwise overlap.
- Add back the overlap of all three sets because it was subtracted too many times.

1.2.2: Inclusion Exclusion Principle is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.
The book could not be loaded just now.