Here’s a nice (surprising) example of computing an event probability. Consider the following question: We have $n$ letters to put into $n$ addressed envelopes, but we randomly put them into envelopes. What’s the chance that no letter is in the correct envelope?
After numbering (see Lists) the envelopes and letters, we model the
uncertain outcome of assignments of letters to
envelopes using the sample space $\Omega = S_n$.
Here $S_n$ denotes the symmetric group of
degree $n$, as usual (see Permutations).
We agree to interpret $\omega \in \Omega $ so
that $\omega (i)$ is the number of the
letter in the envelope numbered $i$,
where $i = 1,\dots , n$.
Suppose we put a distribution $p: \Omega \to
[0,1]$ on $\Omega $ so that every permutation is
equally likely:
\[
p(\omega ) = \frac{1}{n!}
\] \[
W = \Set{\omega \in \Omega }{\omega (s) \neq s \text{ for
all } s = 1, \dots , n}
\]
Define $A_i$ by
\[
A_i = \Set{\omega \in \Omega }{\omega (i) = i}
\] \[
\cup_{i = 1}^{n} A_i
\]
First, notice that the event
\[
\cap _{i = 1}^{n} A_i
\] \[
\num{\cap _{i = 1}^{r} A_i} = (n-r)!
\] \[
P(\cap _{i = 1}^{r} A_i) = \sum_{\omega \in \cap _{i =
1}^{r} A_i} p(\omega ) = \frac{(n-r)!}{n!}.
\] \[
{n \choose r} \frac{(n-r)!}{n!} =
\frac{n!}{r!(n-r)!}\frac{(n-r)!}{n!} = \frac{1}{r!}
\]
Finally, we apply the generalized
inclusion-exclusian formula to obtain
\[
P(A_1 \cup \cdots \cup A_n) = \frac{1}{1!} - \frac{1}{2!} +
\frac{1}{3!} + \cdots + (-1)^{n-1} \frac{1}{n!}.
\] \[
1 - P(A_1 \cup \cdots \cup A_n) = 1 + \frac{1}{2!} -
\frac{1}{3!} + \cdots + (-1)^n\frac{1}{n!}
\]
This is sometimes called the secretary problem.