[Math] n people & n hats: probability that at least 1 person has his own hat

probabilityprobability theory

Suppose n people take n hats at random. What is the probability that
at least 1 person has his own hat?

The proposed solution uses inclusion-exclusion principle and gives the answer:

$$\sum^{n}_{r=1} (-1)^{r-1} \frac{1}{r!}$$

But I think there is simpler solution: let's calculate the complement, i.e. no one gets his own hat.

Total number of ways of distribution hats = number of permutations of hats, i.e. $n!$ Number of ways when no one gets his own hat is calculated as follows: fix a person, he can choose among n-1 hats, then, fix another person, he has n-2 hats at his disposal, and so on. This leads to $(n-1)!$

Therefore, my answer is $1 – \frac{(n-1)!}{n!} = 1 – \frac{1}{n}$ which is wrong. My question is where did I make a mistake?

Best Answer

... fix a person, he can choose among $n-1$ hats, then, fix another person, he has $n-2$ hats at his disposal

If the first person takes another person's hat, then the another person has $n-1$ different hats at his disposal.

The number you are trying to get is called the number of derangements and is also (most easily, I believe) computed by inclusion-exclusion principle.