🏠
Guest Not signed in

Inclusion-exclusion: fix the over-counting by alternating

When events overlap, sum the singles, subtract the doubles, add the triples. Careful book-keeping that nothing is counted twice.

Method · Inclusion Exclusion
Prereqs: Complement
Intro
Three overlapping circles labelled A, B, C with the seven Venn regions clearly visible β€” the canonical inclusion-exclusion diagram.
User:Chris-martin β€” public domain · Public Domain · Wikimedia Commons

When you want the probability that at least one of several events happens and the events overlap, just summing $P(A_i)$ double-counts the pairs, triple-counts the triples, and so on. PIE corrects it with alternating signs: add the singles, subtract the pairs, add the triples. We’ll use it on the classic derangement puzzle — the same engine handles “avoid all forbidden patterns” problems.

βœ“ Intro Β· expand
Independent · Legal