Derangement Calculator — Count Permutations With No Fixed Points
Our Derangement Calculator computes the subfactorial !n, the number of ways to permute n objects so that not a single one ends up in its original position, using the recurrence !n = (n − 1) × (!(n − 1) + !(n − 2)), computed with exact BigInt precision so results stay exact no matter how large n is.
Quick Answer
!n counts the permutations of n objects with no fixed points. Enter n below to instantly get the exact subfactorial via its recurrence, computed with BigInt precision.
How to Use the Derangement (Subfactorial) Calculator — !n Online
- 1
Enter n, the number of objects to derange.
- 2
Click 'Calculate' to get the exact number of derangements !n.
- 3
Review the recurrence used to compute the result.
Why Use Derangement (Subfactorial) Calculator — !n Online?
A derangement is a permutation with no fixed points — every object ends up somewhere other than its original spot, the classic setup behind puzzles like 'in how many ways can n people's hats get mixed up so nobody gets their own hat back.' The count of derangements, denoted !n, satisfies a simple recurrence built from smaller derangement counts, and is closely approximated by n!/e for large n — in fact, the probability that a random permutation is a derangement converges to 1/e, a surprising appearance of Euler's number in pure combinatorics. This calculator computes !n exactly using BigInt arithmetic via the standard recurrence.
Frequently Asked Questions
Related Tools
Factorial Calculator — Calculate n! Online
Calculate the factorial of any non-negative integer (n!) instantly. Free factorial calculator with step-by-step expansion, scientific notation, and digit-count analysis for values up to 1,000,000.
Permutation Calculator — Calculate P(n,r) Online
Calculate permutations P(n,r) — the number of ways to arrange r items from n total items where order matters. Free calculator with step-by-step solutions and formula breakdowns.
Stirling Numbers Calculator — First & Second Kind Online
Calculate Stirling numbers of the first kind c(n,k) or second kind S(n,k) via their standard recurrences. Free calculator with exact BigInt precision.