For finite sets , the cardinality of their union isAdd the individual cardinalities, subtract pairwise intersection counts, add triple intersection counts, and continue alternating. This is useful whenever one object can satisfy several conditions: a search result can match several filters, or a permutation can have several forbidden fixed points.
Among the integers from 1 to 30, let contain the multiples of 2 and the multiples of 3. Then , , and , because their common multiples are the multiples of 6. The naive sum counts those five twice; the correct union size is . The regions contain ten in alone, five in both, five in alone, and ten in neither.
Subtracting overlap counts each selected integer once; a third divisibility condition requires adding the triple overlap back
. Details. Add a third set containing the multiples of 5. Its size is 6; the three pairwise intersections have sizes ; and the triple intersection contains only 30. The inclusion-exclusion principle gives integers divisible by at least one of 2, 3, and 5.
The alternating corrections have a local explanation. An object belonging to exactly of the sets is counted times, by the binomial theorem applied to . An object in none contributes zero. Thus overlapping descriptions are repaired without requiring the sets themselves to be disjoint. For probability, the same calculation applies to event probabilities in place of cardinalities, giving the inclusion-exclusion principle for probabilities.
For a finite family of events, the probability of their union is the alternating sum of their intersection probabilities, with the same pattern as the inclusion-exclusion principle. Expand the indicator function of the union and apply linearity of expectation; this does not require independent events.
For finite subsets of a finite ambient set , the indicator function of their complement is . Expanding this finite product and summing it against any weight proves the weighted formula. The empty intersection is . Negative weights are allowed; finiteness removes every convergence issue.
Suppose disjoint blocks each have elements. The number of -element subsets having exactly elements in at least one block is the displayed sum, with and invalid binomial coefficients interpreted as zero. For a specified set of blocks, choose elements in each and all remaining elements outside those blocks; inclusion-exclusion then counts the union of the exact-occupancy events. Excluding the rest of each specified block is essential.
// Target: algebra.bigb
Let take values in the additive cyclic group on a cycle with vertices. A constraint on edge prescribes . Any proper selection of edges leaves disjoint paths, hence free initial values and solutions. The full cycle has solutions if and none otherwise. Combining these intersection counts with the inclusion-exclusion principle giveswhere is or zero according to the full-cycle consistency condition. This is a useful example in which every proper collection of local constraints is independent, but the full collection has one global obstruction.
Truncating the inclusion-exclusion principle after an odd number of terms gives an upper bound, and truncating after an even number gives a lower bound. In particular,
For the number of occurring events, write and . Then odd truncations bound below and even truncations above. For each integer , the truncated binomial sum equals when , and is zero otherwise. Its sign proves the bounds on taking expectations. This is the exact-count version of the Bonferroni inequalities.
Articles by others on the same topic
The Inclusion-Exclusion Principle is a fundamental concept in combinatorics and probability theory that is used to calculate the size of the union of multiple sets when there is overlap between the sets. It provides a systematic way to count the number of elements in the union of several sets by including the sizes of the individual sets and then systematically excluding the sizes of their intersections to avoid over-counting.
