Maths WorkshopMaths problems with full solutions
Exercise 993Combinatorics › Inclusion-exclusionL1Added 3 Nov 2026

Derangement recurrence

#derangement#recurrence#IE

Statement

Prove the recurrence Dn=(n−1)(Dn−1+Dn−2)D_n=(n-1)(D_{n-1}+D_{n-2}).

Hint

Consider the position of element nn and use IE or combinatorial arguments.

Show solutionHide solution

Solution

Fix element nn. In a derangement, nn goes to position k≠nk\ne n.

Case 1: σ(k)=n\sigma(k)=n. Then σ\sigma on the remaining n−2n-2 elements is a derangement of those elements: Dn−2D_{n-2}.

Case 2: σ(k)≠n\sigma(k)\ne n. Then the restriction to {1,…,n−1}∖{k}\{1,\ldots,n-1\}\setminus\{k\} with σ(j)≠j\sigma(j)\ne j and σ(j)≠k\sigma(j)\ne k is a derangement of n−1n-1 elements: Dn−1D_{n-1}.

Total. (n−1)(Dn−1+Dn−2)(n-1)(D_{n-1}+D_{n-2}).

Conclusion. Dn=(n−1)(Dn−1+Dn−2)D_n=(n-1)(D_{n-1}+D_{n-2}).