Derangement of Objects
On this page
Direct answer
A derangement is a permutation in which no object stays in its original position — every letter in the wrong envelope. The count is D(n) = n!·(1 − 1/1! + 1/2! − 1/3! + ... + (−1)^n/n!), which is n! times the truncated expansion of e^(−1), so D(n) is the nearest integer to n!/e for n ≥ 2. Two recurrences regenerate values: D(n) = (n − 1)·[D(n − 1) + D(n − 2)] and D(n) = n·D(n − 1) + (−1)^n. The memorised ladder runs D(2) = 1, D(3) = 2, D(4) = 9, D(5) = 44, D(6) = 265, D(7) = 1854 — JEE numerical questions live almost entirely on this ladder and on the exactly-r-fixed-points formula C(n, r)·D(n − r).
What you must remember
- Formula: D(n) = n!·Σ(−1)^k/k! from k = 0 to n — inclusion-exclusion on "at least one fixed point", subtracted from n!.
- Value ladder: D(1) = 0, D(2) = 1, D(3) = 2, D(4) = 9, D(5) = 44, D(6) = 265 — recall beats recomputation under time pressure.
- Nearest-integer fact: D(n) is the integer closest to n!/e; for n = 5, 120/e ≈ 44.15, rounding to 44.
- Recurrence: D(n) = (n − 1)[D(n − 1) + D(n − 2)] — derive it by tracking where object 1 goes: n − 1 choices, then two disjoint sub-cases.
- Exactly r fixed points: choose the r objects that stay put, derange the rest: C(n, r)·D(n − r); for n = 4, exactly one fixed point gives 4 × D(3) = 8.
- At least one fixed point: n! − D(n); with n = 4 that is 24 − 9 = 15, a standard single-correct option trap.
- Probability language: P(no one gets their own) = D(n)/n! → 1/e ≈ 0.368 as n grows — the counterintuitive limit that probability questions exploit.
Letters and envelopes
Five letters, five addressed envelopes, inserted randomly: what is the probability exactly two letters find their homes? Choose which two are correct — C(5,2) = 10 ways — then derange the remaining three letters among three envelopes: D(3) = 2. Total favourable = 20 out of 5! = 120, so the probability is 1/6. The same skeleton answers every variant: exactly one correct (5 × D(4) = 5 × 9 = 45), at least one correct (120 − 44 = 76), none correct (44). Notice how the problem decomposes into "choose the fixed set, derange the rest" — a clean multiplication, never a fresh inclusion-exclusion from scratch.
The richer skill is knowing when derangement language is present but the formula is wrong. Seat 4 couples so that no husband sits opposite his own wife: opposite pairs are fixed slots in pairs — this is a derangement of 4 pairs times internal arrangements, D(4) = 9 with 2⁴ left-right swaps. But "no husband adjacent to his own wife at a round table" is not a derangement at all; it needs arrangement-plus-gap reasoning. The tell-tale is whether each object has exactly one forbidden position (derangement) or a web of forbidden positions (general rook polynomial territory, beyond the syllabus, so JEE keeps such counts small).
Beyond the formula
The trap with the highest strike rate: answering "exactly one object in its original place" with D(n − 1) alone, forgetting the factor C(n, 1) that chooses which object stays. The mirror trap treats "at least one fixed" as 1 − D(n)/n!... which is right as a probability but must be multiplied back by n! for a count. Main-level papers stay on the ladder: compute D(4) or C(5,2)D(3) numerically. Advanced dresses derangement in games — hats returned randomly at a counter, books shelved blindly — and the expected-number bridge (expected fixed points = 1, from linearity of expectation) connects this page to probability. One quotable curiosity for interviews and multiple-correct items: D(n)/n! exceeds 1/e for even n and falls below it for odd n, wobbling toward 0.3679 from alternating sides.
Frequently asked questions
What is the formula for the number of derangements of n objects?
D(n) = n!·(1 − 1/1! + 1/2! − ... + (−1)^n/n!), the nearest integer to n!/e.
In how many ways can exactly 2 of 5 letters reach correct envelopes?
Choose the two correct letters, derange the other three: C(5,2)·D(3) = 10 × 2 = 20 ways.
Which recurrence generates derangement numbers?
D(n) = (n − 1)·[D(n − 1) + D(n − 2)], starting from D(1) = 0 and D(2) = 1.
What is the probability that a random permutation fixes at least one point?
1 − D(n)/n!, approaching 1 − 1/e ≈ 0.632 as n grows.
When is a "no object in place" problem not a derangement?
When forbidden positions are not one-per-object — adjacency bans or multiple forbidden slots need different counting, not D(n).