Subfactorial Calculator
Find the number of derangements of n items.
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
The subfactorial !n, also called the number of derangements of n, counts the permutations of n objects in which no object ends up in its original position. It's defined by !n = n! · Σ(k=0 to n) (−1)^k/k!, and grows very close to n!/e for large n — in fact !n is the nearest integer to n!/e. For example !4 = 9: out of the 24 permutations of 4 items, only 9 leave every item out of place.
The classic illustration is the "hat-check problem" (or "misaddressed letters problem"): if n people check their hats and they're returned randomly, !n is the number of ways every single person gets the wrong hat back. Combinatorics students, probability courses and puzzle enthusiasts use subfactorial calculations to solve derangement problems, and the concept extends into cryptography and coding theory wherever "nothing stays in its original slot" permutations matter.
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)