Nobody Gets Their Own Hat
The puzzle
Four guests leave their hats at a cloakroom. The attendant loses the tickets and hands the four hats back in a random order.
What is the probability that not one guest receives their own hat?
Stuck?
One at a time, smallest first. Open only as many as you need — the whole point of the puzzle is the part you work out yourself.
Hint 1
There are 4! = 24 orders in all. Count the ones with no guest matched to their own hat.
Hint 2
Count the bad arrangements instead - those with at least one match - using inclusion and exclusion.
Show the answer Hide the answer
9 out of 24, which is 3/8 or 37.5%.
How to get there
Arrangements with nobody matched are called derangements. Count them by inclusion and exclusion: from 24 total, subtract the arrangements fixing at least one guest, add back those fixing at least two, and so on.
That gives 24 - 4*6 + 6*2 - 4*1 + 1 = 24 - 24 + 12 - 4 + 1 = 9. So the probability is 9/24 = 0.375.
The answer is remarkably stable as the party grows. For n guests the probability tends to 1/e = 0.3679, and it is already within a percentage point at n = 4. With a hundred guests it is still about 37% - more people does not make a complete mismatch less likely.
The technique worth keeping
When a condition forbids many overlapping things at once, count the violations with inclusion and exclusion and subtract. Alternating sums look fiddly but they are mechanical, and they handle "none of these" cleanly.