Calculator Scope

Calculator Scope - Smart Online Calculators for Everything

From math, science, finance, health, and construction to marketing, text tools, developer utilities, and more. All calculators in one fast, accurate, easy-to-use platform.

Derangement Number Calculator

Derangement Number Calculator

Advertisement 1
Advertisement 2
This calculator counts permutations where no item ends up in its original position, e.g. 4 items have 9 such derangements, written !4 = 9.

A derangement is a special kind of permutation where absolutely no item ends up back in its original position — the classic illustration is the hat-check problem, where a derangement is any outcome in which nobody gets their own hat back. Enter the number of items, and this calculator finds exactly how many derangements are possible using a well-known recurrence relation. Perhaps surprisingly, roughly 37% of all permutations turn out to be derangements as the number of items grows, a ratio that converges quickly.

Advertisement 3
  • A derangement is a permutation where absolutely no element lands in its original position, unlike ordinary permutations, which allow any arrangement including ones where some items don't move.
  • The classic example is a hat-check problem: if n people each check a hat and the hats are returned randomly, a derangement is any outcome where nobody gets their own hat back.
  • Derangements are surprisingly common: for large n, roughly 1/e (about 37%) of all permutations are derangements, a ratio that converges quickly as n grows.

How is a derangement calculated?

Using the recurrence !n = (n−1)(!(n−1) + !(n−2)), starting from !0 = 1 and !1 = 0.

How many derangements does a set of 4 items have?

9 — there are 9 ways to rearrange 4 items so that none stays in its original position.