## Textbook’s version of the problem

If $n$ people write their names on a card, place the $n$ cards in a hat, and each person draws a card at random (and independently, without replacement), what is the expected number of people that draw their own name?

We can let $X$ be the r.v. that equals the number of people that draw their own name. We want to find $E(X)$. We can use an Indicator variable for each person, and let $X_{i}=1$ if the $i$th person draws their own name. By LOE, we have $E(X)=∑_{i=1}P(X_{i}=1)$.

For the $i$th person to draw their name, the previous $i−1$ people must *not* have drawn their name. then we can express $P(X_{i}=1)$ as a chain of probabilities:

The final $n−ii $ term is the probability that the $i$th person draws their own card.

The result $n1 $ seems counterintuitive at first. Since we’re drawing cards without replacing, it seemed like the probability should depend on what $i$ is. But every indicator variable only depends on $n$.

We have $E(X)=∑_{i=1}P(X_{i}=1)=∑_{i=1}n1 =1$.

## Original question

The original version of this question involves returning $n$ hats back to their respective owner, and asked what the probability that no one gets their own hat back is, hence the name of the problem.

It turns out that as $lim_{n→∞}$, the probability approaches $e1 $.