Maths & numbers

Derangement count calculator

Count permutations in which every item moves from its original position.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

One object cannot move to a new position on its own. With two objects, swapping them is the only solution.

THE FORMULADₙ = (n−1)(Dₙ₋₁ + Dₙ₋₂)

A worked example

For five items there are 44 such permutations.

Good to know

The empty arrangement counts as one derangement.

Exclude every original position

A derangement moves every distinct item away from its own position. With three items A, B and C, the orders BCA and CAB qualify. Orders such as BAC fail because C remains third. The default input five gives 44 derangements among the 5! = 120 unrestricted permutations.

The recurrence Dₙ = (n − 1)(Dₙ₋₁ + Dₙ₋₂) can build the count from smaller cases. Starting with D₀ = 1 and D₁ = 0 gives D₂ = 1, D₃ = 2, D₄ = 9 and D₅ = 44. The two initial values are important because the recurrence alone does not establish them.

Original positions A B C become B C A so that every item movesABCBCA
The lines connect each original letter with its new slot. None remains in the same position. This is one of two derangements of three items.

Interpret the count as a probability only with a sampling model

If all 120 permutations of five labelled items are equally likely, the chance of no item remaining in place is 44/120 = 11/30, about 36.67%. This probability statement needs the equal-likelihood assumption. The calculator itself returns a count and does not make a claim about how assignments were sampled.

The Multinomial arrangements calculator allows identical copies within categories, while derangements require an identifiable original position for each distinct item. Typical mathematical examples include letters placed into addressed envelopes or assignments that exclude self-matches. Any further restriction, such as forbidding particular pairs of people, needs a separate constrained-counting model.

A few questions, answered

Why is the empty case counted as one?

There is one empty permutation and it violates no position restrictions.

Why is there no derangement of one item?

With only one position available, that item must remain in its original position.

Find your calculator

Start typing to explore the library.