Derangement Calculator
Enter the number of items to find how many derangements exist.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- Use the Share button to copy a link to your result.
About this calculator
A derangement is a permutation in which no element ends up in its original position — the classic illustration is the “hat-check problem,” where n people check their hats and every single one is handed back the wrong one. The count of derangements, written !n, follows the formula !n = n! × Σ(−1)^k/k! for k = 0 to n, and also satisfies the tidy recurrence !n = (n−1)(!(n−1) + !(n−2)).
This calculator computes !n for any number of items and the probability that a random permutation happens to be a derangement — a value that converges quickly to 1/e ≈ 36.8% as n grows. It’s a staple example in combinatorics and discrete math courses, and the underlying reasoning shows up in algorithm design and cryptography problems involving permutations with no fixed points, as well as in the well-known “Secret Santa” gift-exchange puzzle.
Was this helpful?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)