Interactive demo · Introduction to Mathematical Statistics · Chapter 2

Inclusion–exclusion and the matching problem

For events A1, ..., An, Theorem 2.3.7 writes P(A1 ∪ ... ∪ An) = S1 − S2 + S3 − ..., where Sj adds the probabilities of all j-fold intersections. Stopping after J terms gives the partial sum TJ: odd J overshoot the union, even J undershoot it (the Bonferroni inequalities). The top panel plots TJ (gold) against the exact union (teal dashed); the bottom panel simulates the number of events that occur, whose zero class is the complement of the union. Matching: n letters are put at random into n envelopes and Ai says letter i is correct; then Sj = 1/j! for every n.

Events

Number of events n

Probability of each event p

Terms used J

Simulated trials R

Try these

Independent events: Sj = C(n,j)pj and the union has probability 1 − (1 − p)n. Matching: the number of letters in the right envelope has, for large n, nearly the Poisson distribution with mean 1, and the probability that at least one is right tends to 1 − 1/e = 0.6321. The simulation of the matching problem shuffles the letters with the Fisher–Yates method.

In the lecture notes