0
$\begingroup$

Stuck on this question and wondering if I could get some help.

Suppose n people go to a party and leave their hats at the door. At the end of the party, each person picks up a hat at random. Assume each assignment of hats to persons is equally likely.

What is the expected number of people that get their own hats back?


So what I was thinking is that the first person who picks up a hat will pick their own hat with a prob of $\frac{1}{n}$. The second would have prob $\frac{1}{n-1}$ etc.. I'm not convinced however that this is the right way to go about the question.

  • 0
    $1$ setup out of $n!$ will be profitable. Not a very large chance.2017-02-22
  • 0
    Wait they now get to pick their own hate? Is that really wise to let them do that?2017-02-22
  • 1
    You were right in being unconvinced. The second only has probability $\frac{1}{n-1}$ if the first hasn't picked up the second's hat; otherwise, the second's probability is $0$. The probability of the first not picking up the hat of the second is $\frac{n-1}{n}$. When you take that into account, you find that the probability of the second going home wearing the right hat is again $\frac{1}{n}$. The argument extends to all the other people claiming their hats.2017-02-22

1 Answers 1

4

This sort of problem is a lot easier with indicator variables. Let $X_i$ be the indicator variable for the event "the $i^{th}$ person gets their hat back". Then, of course, $$E[X_i]=\frac 1n$$

By the Linearity of Expectations the answer you seek is $$E\left[\sum X_i\right]=\sum E[X_i]=n\times \frac 1n = 1$$