Understand the subject
What is a derangement?
A <strong>derangement</strong> is a permutation in which no object remains in its original position.
Use it for reassignment problems, secret-santa-style matching, and no-fixed-point arrangements.
See the structure
Every original match is forbidden
A ↛ AB ↛ BC ↛ CD ↛ D!4 = 9
Worked example
Check the rule with a small case
Four objects have !4 = 9 no-fixed-position arrangements.
Interpret with care
Choose the right counting model
This counts a complete one-to-one reassignment, not merely an arrangement with at least one moved object.
Use the Permutation & Combination Generator when a small case needs to be inspected rather than only counted.
Quick guide
How to use this calculator
- Enter the number of distinct objects.
- Every object is required to move from its original position.
- Read the exact derangement, also called the subfactorial.
Calculation method
Use the derangement recurrence
The recurrence !n=(n−1)(!(n−1)+!(n−2)) starts from !0=1 and !1=0.
Worked example
Derange four objects
There are nine permutations of four objects with no fixed positions.
!4 = 3(!3+!2) = 9
Supported inputs
Precision and limits
Discrete domain
Inputs are whole counts. Negative, fractional, grouped, and scientific-notation inputs are rejected.
Exact integers
Results use arbitrary-precision integers and are never rounded. Inputs and output size are bounded to keep the page responsive.