- Inclusion-exclusion principle
In combinatorial

mathematics , the**inclusion-exclusion principle**(also known as the**sieve principle**) states that if "A"_{1}, ..., "A"_{"n"}are finite sets, then:$egin\{align\}iggl|igcup\_\{i=1\}^n\; A\_iiggr|\; \{\}\; =sum\_\{i=1\}^nleft|A\_i\; ight$

-sum_{i,j,:,1 le i < j le n}left|A_icap A_j ight| \& {}qquad +sum_{i,j,k,:,1 le i < j < k le n}left|A_icap A_jcap A_k ight|- cdots + left(-1 ight)^{n-1} left|A_1capcdotscap A_n ight

end{align}where |"A"| denotes the

cardinality of the set "A". For example, taking "n" = 2, we get a special case of double counting; in words: we can count the size of the union of sets "A" and "B" by adding |"A"| and |"B"| and then subtracting the size of their intersection. The name comes from the idea that the principle is based on over-generous "inclusion", followed by compensating "exclusion". When "n" > 2 the exclusion of the pairwise intersections is (possibly) too severe, and the correct formula is as shown with alternating signs.This formula is attributed to

Abraham de Moivre ; it is sometimes also named forJoseph Sylvester orHenri Poincaré .fact|date=October 2007For the case of three sets "A", "B", "C" the inclusion-exclusion principle is illustrated in the graphic on the right.

**Inclusion-exclusion principle in probability**In

probability , for events "A"_{1}, ..., "A"_{"n"}in aprobability space $scriptstyle(Omega,mathcal\{F\},mathbb\{P\})$, the inclusion-exclusion principle becomes for "n" = 2:$mathbb\{P\}(A\_1cup\; A\_2)=mathbb\{P\}(A\_1)+mathbb\{P\}(A\_2)-mathbb\{P\}(A\_1cap\; A\_2),$

for "n" = 3

:$egin\{align\}mathbb\{P\}(A\_1cup\; A\_2cup\; A\_3)=mathbb\{P\}(A\_1)+mathbb\{P\}(A\_2)+mathbb\{P\}(A\_3)\backslash qquad-mathbb\{P\}(A\_1cap\; A\_2)-mathbb\{P\}(A\_1cap\; A\_3)-mathbb\{P\}(A\_2cap\; A\_3)+mathbb\{P\}(A\_1cap\; A\_2cap\; A\_3)end\{align\}$

and in general

:$egin\{align\}mathbb\{P\}iggl(igcup\_\{i=1\}^n\; A\_iiggr)\; \{\}\; =sum\_\{i=1\}^n\; mathbb\{P\}(A\_i)-sum\_\{i,j,:,i\}mathbb\{p\}(a\_icap\; a\_j)\; \backslash qquad+sum\_\{i,j,k,:,i\}mathbb\{p\}(a\_icap\; a\_jcap\; a\_k)-\; cdots\; +(-1)^\{n-1\},\; mathbb\{p\}iggl(igcap\_\{i="1\}^n"\; a\_iiggr),end\{align\}\; math>$

which can be written in closed form as

:$mathbb\{P\}iggl(igcup\_\{i=1\}^n\; A\_iiggr)\; =sum\_\{k=1\}^n\; (-1)^\{k-1\}sum\_\{scriptstyle\; Isubset\{1,ldots,n\}atopscriptstyle|I|=k\}\; mathbb\{P\}iggl(igcap\_\{iin\; I\}\; A\_iiggr),$

where the last sum runs over all subsets "I" of the indices 1, ..., "n" which contain exactly "k" elements.

According to the Bonferroni inequalities, the sum of the first terms in the formula is alternately an upper bound and a lower bound for the LHS. This can be used in cases where the full formula is too cumbersome.

For a general

measure space ("S","Σ","μ") andmeasurable subsets "A"_{1}, ..., "A_{n"}of finite measure, the above identities also hold when the probability measure $mathbb\{P\}$ is replaced by the measure "μ".**Proof**To prove the inclusion-exclusion principle in general, we first have to verify the identity

:$1\_\{cup\_\{i=1\}^n\; A\_i\}\; =sum\_\{k=1\}^n\; (-1)^\{k-1\}sum\_\{scriptstyle\; Isubset\{1,ldots,n\}atopscriptstyle|I|=k\}\; 1\_\{cap\_\{iin\; I\}\; A\_i\}qquad(*)$

for

indicator function s. There are at least two ways to do this:**First possibility:**If suffices to do this for every "x" in the union of "A"_{1}, ..., "A_{n"}. Suppose "x" belongs to exactly "m" sets with 1 ≤ "m" ≤ "n", for simplicity of notation say "A"_{1}, ..., "A_{m"}. Then the identity at "x" reduces to:$1\; =sum\_\{k=1\}^m\; (-1)^\{k-1\}sum\_\{scriptstyle\; Isubset\{1,ldots,m\}atopscriptstyle|I|=k\}\; 1.$

The number of subsets of cardinality "k" of an "m"-element set is the combinatorical interpretation of the

binomial coefficient $extstyleinom\; mk$ . Since $extstyle1=inom\; m0$ , we have:$inom\; m0\; =sum\_\{k=1\}^m\; (-1)^\{k-1\}inom\; mk.$

Putting all terms to the left-hand side of the equation, we obtain the expansion for (1 – 1)

^{"m"}given by thebinomial theorem , hence we see that (*) is true for "x".**Second possibility:**Let "A" denote the union of the sets "A"_{1}, ..., "A_{n"}. Then:$0=(1\_A-1\_\{A\_1\})(1\_A-1\_\{A\_2\})cdots(1\_A-1\_\{A\_n\}),,$

because both sides are zero for an "x" not in "A", and if "x" belongs to one of the sets, say "A

_{m}", then the corresponding "m"th factor is zero. By expanding the product on the right-hand side, equation (*) follows.**Use of (*):**To prove the inclusion-exclusion principle for the cardinality of sets, sum the equation (*) over all "x" in the union of "A"_{1}, ..., "A"_{"n"}. To derive the version used in probability, take the expectation in (*). In general, integrate the equation (*) with respect to "μ". Always use linearity.**Other forms**The principle is sometimes stated in the form that says that if

:$g(A)=sum\_\{S,:,Ssubseteq\; A\}f(S)$

then

:$f(A)=sum\_\{S,:,Ssubseteq\; A\}(-1)^\{left|A\; ight|-left|S\; ightg(S)$

In that form it is seen to be the

Möbius inversion formula for theincidence algebra of thepartially ordered set of all subsets of "A".**Applications**In many cases where the principle could give an exact formula (in particular, counting

prime number s using thesieve of Eratosthenes ), the formula arising doesn't offer useful content because the number of terms in it is excessive. If each term individually can be estimated accurately, the accumulation of errors may imply that the inclusion-exclusion formula isn't directly applicable. Innumber theory , this difficulty was addressed byViggo Brun . After a slow start, his ideas were taken up by others, and a large variety ofsieve method s developed. These for example may try to find upper bounds for the "sieved" sets, rather than an exact formula.**Derangements**A well-known application of the inclusion-exclusion principle is to the combinatorial problem of counting all

derangement s of a finite set. A "derangement" of a set "A" is abijection from "A" into itself that has no fixed points. Via the inclusion-exclusion principle one can show that if the cardinality of "A" is "n", then the number of derangements is ["n"! / "e"] where ["x"] denotes the nearest integer to "x"; a detailed proof is available here.This is also known as the

subfactorial of "n", written !"n". It follows that if all bijections are assigned the same probability then the probability that a random bijection is a derangement quickly approaches 1/"e" as "n" grows.**Counting intersections**The principle of inclusion-exclusion, combined with

de Morgan's theorem , can be used to count the intersection of sets as well. Let $scriptstyleoverline\{A\}\_k$ represent the complement of "A"_{"k"}with respect to some universal set "A" such that $scriptstyle\; A\_k,\; subseteq,\; A$ for each "k". Then we have:$igcap\_\{i=1\}^n\; A\_i\; =\; overline\{igcup\_\{i=1\}^n\; overline\{A\}\_i\}$

thereby turning the problem of finding an intersection into the problem of finding a union.

**ee also***

Combinatorial principles

*Boole's inequality

*Necklace problem

*Schuette–Nesbitt formula

*Maximum-minimums identity **References**

*Wikimedia Foundation.
2010.*

### Look at other dictionaries:

**Inclusion**— For inclusion and exclusion of Wikipedia templates, see Wikipedia:Template inclusion. Inclusion may refer to: Contents 1 Metallurgy 2 Social inclusion of persons 3 Mathematics … Wikipedia**Combinatorial principles**— In proving results in combinatorics several useful combinatorial rules or combinatorial principles are commonly recognized and used. The rule of sum, rule of product, and inclusion exclusion principle are often used for enumerative purposes.… … Wikipedia**Set (mathematics)**— This article gives an introduction to what mathematicians call intuitive or naive set theory; for a more detailed account see Naive set theory. For a rigorous modern axiomatic treatment of sets, see Set theory. The intersection of two sets is… … Wikipedia**Bernoulli number**— In mathematics, the Bernoulli numbers Bn are a sequence of rational numbers with deep connections to number theory. They are closely related to the values of the Riemann zeta function at negative integers. There are several conventions for… … Wikipedia**Derangement**— For the psychological condition, see psychosis. Number of possible permutations and derangements of n elements. P(n) is the number of n permutations; D(n) is the number of derangements (n permutations where all of the n elements change their… … Wikipedia**Boole's inequality**— In probability theory, Boole s inequality, named after George Boole, (also known as the union bound) says that for any finite or countable set of events, the probability that at least one of the events happens is no greater than the sum of the… … Wikipedia**Schuette–Nesbitt formula**— In probability theory, the Schuette–Nesbitt formula is a generalization of the probabilistic version of the inclusion exclusion principle. It is named after Donald R. Schuette and Cecil J. Nesbitt. The Schuette–Nesbitt formula has practical… … Wikipedia**List of combinatorics topics**— This is a list of combinatorics topics.A few decades ago it might have been said that combinatorics is little more than a way to classify poorly understood problems, and some standard remedies. Great progress has been made since 1960.This page is … Wikipedia**Logical connective**— This article is about connectives in classical logic. For connectors in natural languages, see discourse connective. For connectives and operators in other logics, see logical constant. For other logical symbols, see table of logic symbols. In… … Wikipedia**List of mathematics articles (I)**— NOTOC Ia IA automorphism ICER Icosagon Icosahedral 120 cell Icosahedral prism Icosahedral symmetry Icosahedron Icosian Calculus Icosian game Icosidodecadodecahedron Icosidodecahedron Icositetrachoric honeycomb Icositruncated dodecadodecahedron… … Wikipedia