How to Use
Enter n:
- !n: Subfactorial value
- n!: For comparison
- Ratio: !n/n! → 1/e
Hat Check Problem
n guests check hats. Hats returned randomly. What's the probability NO ONE gets their own hat? Answer: !n/n! → 1/e. Even for n=5, it's already !5/120 = 44/120 ≈ 36.7%.
Formulas
- !n = n! · Σ(-1)^k/k! (k=0..n)
- !n = round(n!/e)
- !n = (n-1)·(!(n-1)+!(n-2))
- !n = n·!(n-1) + (-1)^n
Step-by-Step Instructions
- 1Enter n.
- 2Compute !n.
- 3Compare to n!.
- 4Check ratio.
- 5Browse sequence.