ProofComplete

Probability Spaces and Events - Key Proof

We present a detailed proof of the inclusion-exclusion principle, one of the most important counting and probability formulas. This result generalizes the simple addition rule for disjoint events.

The Inclusion-Exclusion Principle

Theorem

For events A1,A2,,AnA_1, A_2, \ldots, A_n in a probability space: P(i=1nAi)=k=1n(1)k+11i1<<iknP(Ai1Aik)P\left(\bigcup_{i=1}^n A_i\right) = \sum_{k=1}^n (-1)^{k+1} \sum_{1 \leq i_1 < \cdots < i_k \leq n} P(A_{i_1} \cap \cdots \cap A_{i_k})

Equivalently: P(A1An)=iP(Ai)i<jP(AiAj)+i<j<kP(AiAjAk)+(1)n+1P(A1An)P(A_1 \cup \cdots \cup A_n) = \sum_i P(A_i) - \sum_{i<j} P(A_i \cap A_j) + \sum_{i<j<k} P(A_i \cap A_j \cap A_k) - \cdots + (-1)^{n+1} P(A_1 \cap \cdots \cap A_n)

Proof

We prove by induction on nn.

Base Case (n=2n=2): We need to show: P(A1A2)=P(A1)+P(A2)P(A1A2)P(A_1 \cup A_2) = P(A_1) + P(A_2) - P(A_1 \cap A_2)

Decompose A1A2A_1 \cup A_2 into disjoint pieces: A1A2=A1(A2A1)A_1 \cup A_2 = A_1 \cup (A_2 \setminus A_1)

By additivity: P(A1A2)=P(A1)+P(A2A1)P(A_1 \cup A_2) = P(A_1) + P(A_2 \setminus A_1)

Since A2=(A2A1)(A2A1)A_2 = (A_2 \cap A_1) \cup (A_2 \setminus A_1) is a disjoint union: P(A2)=P(A2A1)+P(A2A1)P(A_2) = P(A_2 \cap A_1) + P(A_2 \setminus A_1)

Therefore P(A2A1)=P(A2)P(A1A2)P(A_2 \setminus A_1) = P(A_2) - P(A_1 \cap A_2), and: P(A1A2)=P(A1)+P(A2)P(A1A2)P(A_1 \cup A_2) = P(A_1) + P(A_2) - P(A_1 \cap A_2)

Inductive Step: Assume the formula holds for n1n-1 events. For nn events, write: i=1nAi=(i=1n1Ai)An\bigcup_{i=1}^n A_i = \left(\bigcup_{i=1}^{n-1} A_i\right) \cup A_n

By the base case: P(i=1nAi)=P(i=1n1Ai)+P(An)P[(i=1n1Ai)An]P\left(\bigcup_{i=1}^n A_i\right) = P\left(\bigcup_{i=1}^{n-1} A_i\right) + P(A_n) - P\left[\left(\bigcup_{i=1}^{n-1} A_i\right) \cap A_n\right]

By the inductive hypothesis applied to A1,,An1A_1, \ldots, A_{n-1}: P(i=1n1Ai)=k=1n1(1)k+11i1<<ikn1P(Ai1Aik)P\left(\bigcup_{i=1}^{n-1} A_i\right) = \sum_{k=1}^{n-1} (-1)^{k+1} \sum_{1 \leq i_1 < \cdots < i_k \leq n-1} P(A_{i_1} \cap \cdots \cap A_{i_k})

For the intersection term, note: (i=1n1Ai)An=i=1n1(AiAn)\left(\bigcup_{i=1}^{n-1} A_i\right) \cap A_n = \bigcup_{i=1}^{n-1} (A_i \cap A_n)

Applying the inductive hypothesis to events A1An,,An1AnA_1 \cap A_n, \ldots, A_{n-1} \cap A_n: P(i=1n1(AiAn))=k=1n1(1)k+11i1<<ikn1P(Ai1AikAn)P\left(\bigcup_{i=1}^{n-1} (A_i \cap A_n)\right) = \sum_{k=1}^{n-1} (-1)^{k+1} \sum_{1 \leq i_1 < \cdots < i_k \leq n-1} P(A_{i_1} \cap \cdots \cap A_{i_k} \cap A_n)

Combining these expressions and collecting terms by the size of intersections yields the inclusion-exclusion formula for nn events. □

Application: Derangements

Example

A derangement is a permutation where no element appears in its original position. The probability that a random permutation of nn elements is a derangement can be computed using inclusion-exclusion.

Let AiA_i = "element ii is in position ii". The probability of at least one fixed point is: P(i=1nAi)P\left(\bigcup_{i=1}^n A_i\right)

We have:

  • P(Ai)=(n1)!/n!=1/nP(A_i) = (n-1)!/n! = 1/n
  • P(AiAj)=(n2)!/n!=1/(n(n1))P(A_i \cap A_j) = (n-2)!/n! = 1/(n(n-1))
  • P(Ai1Aik)=(nk)!/n!=1/(n(n1)(nk+1))P(A_{i_1} \cap \cdots \cap A_{i_k}) = (n-k)!/n! = 1/(n(n-1)\cdots(n-k+1))

There are (nk)\binom{n}{k} terms in the kk-th sum, so: P(i=1nAi)=k=1n(1)k+1(nk)(nk)!n!=k=1n(1)k+1k!P\left(\bigcup_{i=1}^n A_i\right) = \sum_{k=1}^n (-1)^{k+1} \binom{n}{k} \frac{(n-k)!}{n!} = \sum_{k=1}^n \frac{(-1)^{k+1}}{k!}

The probability of a derangement is: P(derangement)=1k=1n(1)k+1k!=k=0n(1)kk!e10.368P(\text{derangement}) = 1 - \sum_{k=1}^n \frac{(-1)^{k+1}}{k!} = \sum_{k=0}^n \frac{(-1)^k}{k!} \approx e^{-1} \approx 0.368

Remark

The inclusion-exclusion principle has both combinatorial and probabilistic interpretations. It corrects for overcounting when computing the size or probability of a union by alternately adding and subtracting intersection terms.