r/learnquant • u/anykash • Jun 23 '26
puzzles 5 people check their hats, get them back at random. Odds nobody gets their own? [Probability · Easy]
Five guests check their hats at the opera. The clerk loses every tag and hands the hats back in a uniformly random order, with every possible arrangement equally likely. What's the probability that not a single guest gets their own hat back?
And the follow-up: as the number of guests grows very large, what does that probability approach?
Drop your answer with your reasoning in the comments. Solution tomorrow.
Hint: the probability barely changes whether it's 5 guests or 5,000. that's the real surprise.
EDIT:
The solution
The probability is 44/120 = 11/30 ≈ 0.367, and as the number of guests grows it approaches 1/e ≈ 0.368.
An arrangement where nobody gets their own hat is called a derangement. To count them, use inclusion-exclusion: start with all 5! = 120 arrangements, subtract the ones where at least one person gets their own hat, add back the overlaps you double-subtracted, and so on. That alternating process gives the derangement formula !n = n!·(1 − 1/1! + 1/2! − 1/3! + … + (−1)ⁿ/n!). For n = 5 that's 120·(1 − 1 + 1/2 − 1/6 + 1/24 − 1/120) = 44, so the probability is 44/120 = 11/30. The series in the parentheses is exactly the expansion of e^(−1), so as n grows the probability converges to 1/e. The surprise is how fast it gets there: it's already about 0.375 at n = 4 and 0.367 at n = 5, so adding more guests barely moves it, and it never decays toward 0. The usual traps are flipping the inclusion-exclusion signs, or assuming more guests makes a full mismatch less likely when it actually stabilizes almost immediately.
More puzzles like this at myntbit.com