How this calculation works
One object cannot move to a new position on its own. With two objects, swapping them is the only solution.
Dₙ = (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.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
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.
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.