Vol. I a living index of named laws · est. mmxxvi no ads · no account
The Law Tomeindex of named laws

The Inclusion-Exclusion Principle

also known as — Inclusion-exclusion, The sieve formula
"To count a union, add the parts, subtract the overlaps, add back the triple overlaps, and so on."
In plain English

What does The Inclusion-Exclusion Principle mean?

The inclusion-exclusion principle is a counting formula for the size of a union of sets. For two sets it says the size of their union is the sum of their sizes minus the size of their overlap; for three, one adds the three individual sizes, subtracts the three pairwise overlaps, and adds back the triple overlap. In general one adds the sizes of the single sets, subtracts all pairwise intersections, adds all triple intersections, and continues with strictly alternating signs to the full intersection. The rule corrects the double-counting that arises from naively summing sizes, and it is a fundamental tool of enumerative combinatorics and probability, turning a tangled overlapping count into an exact alternating sum.

Reliability

Rated Empirical: grounded in studies or measurable evidence. The other 608.

How it works

How does The Inclusion-Exclusion Principle work?

The alternation is bookkeeping for over- and under-counting. Adding the sizes of the sets counts each element once for every set it belongs to, so elements in overlaps are counted too many times. Subtracting the pairwise intersections removes that excess, but it over-corrects for elements lying in three sets, which must then be added back; the correction for four-way elements over-shoots again, and so on, each layer of intersections flipping the sign. The upshot is that every element, whatever overlaps it lies in, is counted exactly once overall, which is why the signs must strictly alternate through the full intersection. The same principle holds for probabilities of unions of events, giving an exact expansion whose truncations yield the Bonferroni bounds.

Figure illustrating The Inclusion-Exclusion Principle
The Inclusion-Exclusion Principle — SilverStar, at, English Wikipedia · CC BY 2.5 · source
Where you'll see it

What are examples of The Inclusion-Exclusion Principle?

Derangements Counting permutations with no element in its original place uses inclusion-exclusion; the probability a random shuffle fixes nothing approaches one over e, about zero point three seven, the hat-check problem.
Euler's totient The count of numbers below n sharing no factor with it is found by inclusion-exclusion over n's distinct prime divisors, giving Euler's totient function.
Sieve methods The sieve of Eratosthenes and its refinements, like Legendre's and Brun's sieves in number theory, are inclusion-exclusion applied to counting numbers free of certain prime factors.
Types & variants

What are the types of The Inclusion-Exclusion Principle?

The probabilistic form§

The version for the probability of a union of events, an alternating sum of probabilities of intersections, also called Poincare's formula.

The Bonferroni inequalities§

The bounds obtained by truncating the alternating sum after some terms, giving alternating over- and under-estimates that refine the simple union bound.

Why it matters

Why does The Inclusion-Exclusion Principle matter?

The inclusion-exclusion principle is a fundamental tool of combinatorics and probability, the standard way to count or measure a union when the parts overlap. It counts derangements and surjections, computes Euler's totient function, underlies the sieve methods of number theory from Eratosthenes to Brun, and in probability gives exact expansions whose truncations, the Bonferroni inequalities, provide practical bounds. Its idea, correcting a sum by alternately removing and restoring overlaps, is so general that it recurs across mathematics wherever overlapping cases must be counted without double-counting, making it one of the most broadly useful identities in enumeration.

Working with it

How do you apply The Inclusion-Exclusion Principle?

  • Add, subtract, add — sum the individual set sizes, subtract every pairwise overlap, add every triple overlap, and continue with alternating signs to the full intersection.
  • Aim for exactly once — trust that the alternation makes every element counted exactly one time overall, whatever combination of sets it lies in.
  • Truncate for bounds — stop the alternating sum early to get the Bonferroni inequalities, alternating upper and lower estimates when the full computation is too costly.
Where it breaks down

What are the limits of The Inclusion-Exclusion Principle?

The formula is exact, not an approximation, but its full form has a term for every subset of the sets, so for many sets the number of intersection terms grows explosively and the computation becomes impractical, which is why the truncated Bonferroni bounds are often used instead. It requires knowing the sizes of all the intersections, which may themselves be hard to determine. The signs must strictly alternate, and dropping a term or misplacing a sign is the usual error. It applies to finite sets and to probabilities of events, and its usefulness depends on the intersections being simpler to count than the union directly.

What it doesn't say

What are common misconceptions about The Inclusion-Exclusion Principle?

The principle is an exact equality, not an estimate; truncating it gives the Bonferroni inequalities, but the full formula is precise. The signs strictly alternate all the way to the full intersection, so it is not merely add-the-parts-subtract-the-overlaps and stop, which would be wrong for three or more sets. And no single person originated it: early uses trace to de Moivre, with independent nineteenth-century formulations by da Silva, Sylvester, and Poincare, so it is a shared discovery rather than one author's theorem.

Is it real?

Is The Inclusion-Exclusion Principle real?

Yes, as far as the evidence goes. The Inclusion-Exclusion Principle is rated Empirical here: it rests on studies or measurements rather than on a saying.

Rated from two sources. 609 of the 1,116 entries carry this rating. How the scale works.

Rarely printedin printed books: one of 196 names in its band, of 903 measured
38 of 51entries in mathematics & proof carry the same rating

The best-known laws are the least likely to rest on measurement.

Origin

Where did The Inclusion-Exclusion Principle come from?

Used early by Abraham de Moivre in 1718 and given explicit general formulations independently in the nineteenth century by Daniel da Silva in 1854, J.J. Sylvester in 1883, and, in probabilistic form, Henri Poincare in 1896.

How the name spread

When did people start saying “The Inclusion-Exclusion Principle”?

18002019
How often “Inclusion - Exclusion Principle” appears in printed English, which takes hold around 1974 and peaks around 2010. This tracks the phrase and not the idea. A law is usually older than the name for it. Source: Google Books Ngrams.
Known elsewhere as

What is The Inclusion-Exclusion Principle called in other languages?

  • GermanPrinzip von Inklusion und Exklusion
  • Spanishprincipio de inclusión-exclusión
  • Frenchprincipe d'inclusion-exclusion
  • Italianprincipio di inclusione ed esclusione
  • Japanese包除原理
  • Portugueseprincípio da inclusão-exclusão
  • RussianФормула включений-исключений
  • Chinese排容原理

8 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.

Sources

Sources & further reading

  1. 1Inclusion-exclusion principle, Wikipedia. — the two-set and three-set formulas, the alternating general form, the derangement and totient applications, and the Bonferroni inequalities.secondary
  2. 2Inclusion-Exclusion Principle, Wolfram MathWorld. — the union-counting formula, the alternating signs, and the da Silva and Sylvester history.secondary

Everything above traces to en.wikipedia.org and mathworld.wolfram.com: two secondary sources, accounts of the original rather than the original itself, which has not been located for this entry. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.

What we checked

  • 1,116entries in the tomeListed one by one on the browse page.
  • 1,116of them citing a sourceOpen any entry: its sources sit at the foot of the page.
  • 2,489source references in allEach is named, and linked wherever the source is online.