Maths WorkshopMaths problems with full solutions
Exercise 1606Combinatorics › Counting principlesL1Added 3 Nov 2026

Derangements

#derangements#inclusion-exclusion#permutations

Statement

A derangement is a permutation with no fixed point. Compute the number DnD_n of derangements of nn elements for n=3,4n=3,4.

Hint

Dn=n!∑k=0n(−1)kk!D_n=n!\sum_{k=0}^n\frac{(-1)^k}{k!}.

Show solutionHide solution

Solution

Formula. Dn=n!∑k=0n(−1)kk!D_n=n!\sum_{k=0}^n\frac{(-1)^k}{k!}.

For n=3n=3. D3=6(1−1+1/2−1/6)=6(1/3)=2D_3=6(1-1+1/2-1/6)=6(1/3)=2.

For n=4n=4. D4=24(1−1+1/2−1/6+1/24)=24⋅9/24=9D_4=24(1-1+1/2-1/6+1/24)=24\cdot9/24=9.

Conclusion. D3=2D_3=2, D4=9D_4=9.

Check n=3n=3. Permutations with no fixed point: (123)(123) and (132)(132). ✓