6

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?

Astudent
  • 157

4 Answers4

7

... 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.

Antoine
  • 3,499
  • 1
    There is a closed form $\left[ \dfrac{n!}{e} \right]$ (rounding to closest integer) for the number of derangements. This can then be divided by $n!$ to give a probability; as with many such problems this is approximately $e^{-1}$. – Henry Sep 07 '14 at 17:41
7

The mistake is that the number of possibilities for the second person (and subsequent ones) to pick a hat besides his depends on what's happened before. For example, if person number 1 picked hat number 2, there will be $n-1$ possibilities. Otherwise, $n-2$. I'm not sure how easy it is to give a proof along these lines that keeps track of these possibilities.

Dave
  • 2,157
4

Adding to one other responder's solution and explaining how to use derrangement in this kind of problem, I have taken n to be equal to 4 to lay down the foundation:

The total number of ways 4 people will receive 4 hats $= 4!$

The total number of ways that none of the person will get his own hat often defined as the derrangement notated by $(!4) = 9$ (Check Wolfram or Wiki).

Thus the probability that none of the 4 people will get their hats back $$= \frac{!4}{4!} = \frac{9}{24}$$

Thus the probability that atleast one person will get his hat back $$ = 1 - \frac{9}{24} = \frac{15}{24}$$

If you evaluate the series in your answer for the problem, you will

$$ = 1 - \frac{1}{2!}+\frac{1}{3!}-\frac{1}{4!} = \frac{15}{24}$$

Thanks Satish

Satish Ramanathan
  • 12,424
  • 3
  • 20
  • 29
1

I have the same question and I came up with an answer that gives light on the error.

At first I thought "I have $(n-1)!$ ways to assign hats such that no hat matches". But this is wrong.

Your suppose $A = \{1,2,3\}, B= \{1,2,3\}$. Then there are 3! = 6 bijections $f$, such that $f: A \rightarrow B$ such that $n\in A \rightarrow m\in B$. Of these 6, only 2! are dearrangements called $g: A\rightarrow B$ such that $g = f$ and $g(n) \neq n$:

$g(1) = 2, g(2) = 3, g(3) = 1$ and $g(1) = 3, g(2) = 1, g(3) = 2$. Then your proposed solution works.

But if $A=\{1,2,3,4\}, B=\{1,2,3,4\}$ then it's wrong to say that there are $(n-1)!$ different $g$'s.

At first $(n-1)!$ seems to work: To assign $g(1)$ I have $3$ options: $2, 3, 4$. If $g(1) = 2$ then, I have $2$ options to assign to $g(2)$: $3, 4$. If $g(2) = 3$, I'm left with $1$ option for $g(3)$ which is $4$ and "no option" for $g(4)$ 'cos we're meant to assign it $3$.

But what happens if $g(1) = 3$? Now $g(2)$ has only two ($(n-2)$) options! So, we can't use the multiplication rule: in some cases we have to chose between n-1 and in others among n-2.

This is the same answer as @Dave 's but a bit more digested. It also helped me to reason this.

agus
  • 51