Work out inclusion exclusion principle instantly with clear inputs, formula shown and shareable results.
Inclusion-exclusion corrects for double counting with alternating signs: add the singles, subtract the pairs, add the triples, and so on. Each element then contributes exactly once to the union.
Three sets
|A∪B∪C| = Σ|Aᵢ| − Σ|Aᵢ∩Aⱼ| + |A∩B∩C|
120 − 37 + 5 = 88 in the union.
An element in exactly k sets is counted C(k,1) − C(k,2) + C(k,3) − … times, which telescopes to exactly 1.