How to Use
Enter n:
- P(≥1): Match probability
- !n: Derangement count
- Expected: E[matches]=1
The Surprise
For n=3: P≈0.667. For n=10: P≈0.6321. For n=100: P≈0.6321. The probability converges to 1-1/e ≈ 63.21% incredibly fast. This counter-intuitive stability is because the alternating series Σ(-1)^k/k! converges rapidly.
Expected Matches
E[number of matches] = 1, ALWAYS, regardless of n! By linearity of expectation: each person has 1/n chance of getting their hat, and n × 1/n = 1. This is simpler than the probability calculation.
Step-by-Step Instructions
- 1Enter n.
- 2Compute P(≥1 match).
- 3See derangements.
- 4Check convergence.
- 5Compare to 1/e.