Skip to content
ENExplore Calculators

Derangement Count Calculator

Work out derangement count instantly with clear inputs, formula shown and shareable results.

About Derangement Count Calculator

A derangement leaves nothing in its original position. Inclusion-exclusion gives Dₙ = n!·Σ(−1)ᵏ/k!, and the ratio Dₙ/n! converges rapidly to 1/e ≈ 0.3678794.

Formulas

Derangement count

Dₙ = n·Dₙ₋₁ + (−1)ⁿ = n!·Σₖ₌₀ⁿ (−1)ᵏ/k!

Exactly k fixed

C(n, k) · D₍ₙ₋ₖ₎

Worked example

With the default values below, Derangement Count Calculator returns Derangements Dₙ of 14,833. Change any input above and every figure here is recalculated in your browser.

Inputs used

Number of items naccepts 0–170
8
Count permutations with exactly this many fixed pointsaccepts 0–170
1

Results

Derangements Dₙ
14,833
Total permutations n!
40,320
Probability of a random derangement
0.36788194
Permutations with exactly k fixed points
14,832

Step by step

  1. 1Values used
  2. 2Derangement count
  3. 3Exactly k fixed
  4. 4Derangements Dₙ= 14,833
  5. 5Total permutations n!= 40,320
  6. 6Probability of a random derangement= 0.36788194
  7. 7Permutations with exactly k fixed points= 14,832

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How many derangements of 8 items?

14833 out of 40320 permutations, a probability of 0.3678792 — already matching 1/e to six decimals.

What is the secret Santa problem?

Drawing names so nobody gets themselves is exactly a derangement, and the chance of a valid random draw is about 37%.

Derangement Count Calculator – Calculate Derangements Dₙ