Inclusion–exclusion principle
Statement
For finite sets , .
Why is it true?
Simply adding the sizes of overlapping sets double-counts elements that lie in more than one set. Subtracting the pairwise overlaps corrects the double-counting, but now triple overlaps have been removed too many times, so they must be added back, and so on, alternating sign until every element of the union is counted exactly once.
Proof sketch
Fix an element in the union that belongs to exactly of the sets. Show that its net contribution to the alternating sum is , which by the binomial theorem applied to equals . Since every element of the union contributes exactly and elements outside the union contribute , the alternating sum equals .
Topics that use this theorem
Related theorems
Step-by-step proofs
No step-by-step proof yet for this theorem.
References
- J. H. van Lint, R. M. Wilson (2001). A Course in Combinatorics