Exercise 5.2-4

Use indicator random variables to solve the following problem, which is known as the hat-check problem. Each of \(n\) customers gives a hat to a hat-check person at a restaurant. The hat-check person gives the hats back to the customers in a random order. What is the expected number of customers who get back their own hat?

Let the random variable \(X\) represent the number of customers that get their hat back and let \(X_i\) be the indicator random variable that denotes whether customer \(i\) gets the correct hat back. This implies that \(X = X_1 + X_2 + \cdots + X_n\). We will calculate the expected value of \(X\) to answer this question.

Each indvidual customer has a \(\frac{1}{n}\) chance of receiving the correct hat back. So \(Pr\{X_i = 1\} = \frac{1}{n} \implies E[X_i] = \frac{1}{n}\).

\[\begin{split} E[X] &= E[\sum\limits_{i=1}^{n} X_i] \\ &= \sum\limits_{i=1}^{n} E[X_i] \\ &= \sum\limits_{i=1}^{n} \frac{1}{n} \\ &= 1 \end{split}\]

We therefore expect just one customer to receive back the correct hat.