The hat-check problem for 4 people
Need a hint?
Count the arrangements with no fixed point (derangements) with inclusion–exclusion.
The probability that nobody gets their own hat is 9/24 = 3/8 = 0.375 (about 1/e for many people).
How to work it out
There are ways to return the hats. Inclusion–exclusion on 'someone gets their own hat':
(1)So nine of the 24 arrangements have no fixed point:
(2)As the number of people grows, the probability tends to : with 4 people it is already close.
LaTeX source of the formulas on this page
\[ \frac{9}{24}=\frac38 \]
\[ !4=4!-\binom41 3!+\binom42 2!-\binom43 1!+\binom44 0!=24-24+12-4+1=9 \]
\[ P=\frac{9}{24}=\frac38=0.375 \]Questions
What is the answer to: The hat-check problem for 4 people?
The probability that nobody gets their own hat is 9/24 = 3/8 = 0.375 (about 1/e for many people).
What is the key idea?
Inclusion–exclusion counts permutations with no fixed point.
Is there a hint?
Count the arrangements with no fixed point (derangements) with inclusion–exclusion.