Classical combinatorial numbers · Definition

Derangement

enumerative combinatoricsclassical combinatorial numbers

Before you start you need to know

The hat-check problem asks how many permutations avoid every fixed point. The answer follows directly from the inclusion-exclusion principle.

Definition

A derangement is a permutation of \(n\) elements with no fixed points; the number of derangements is \(D_n\).

\[D_n = n!\sum_{k=0}^{n}\frac{(-1)^k}{k!}\]

Let \(A_i\) be the set of permutations that fix element \(i\). Since \(|A_{i_1}\cap\cdots\cap A_{i_k}|=(n-k)!\), inclusion-exclusion gives the formula above. Moreover, \(D_n=(n-1)(D_{n-1}+D_{n-2})\) and \(D_n/n!\to e^{-1}\).

For \(n=4\) we add \(4!\), subtract \(\binom{4}{1}3!\), add \(\binom{4}{2}2!\), subtract \(\binom{4}{3}1!\), and add \(\binom{4}{4}0!\), which gives \(9\). For example, \(2143\) and \(4321\) are two of these derangements.

Typical error: keeping only the first term of the series and writing \(D_n\approx n!-1\), forgetting that higher-order terms correct the overlaps between fixed-point sets.

Think about it

Why does \(n!-\sum_i |A_i|\) give zero instead of \(D_n\)?

Because \(\sum_i |A_i|=n\,(n-1)!=n!\) overcounts permutations with several fixed points; the intersections must be added back.

Exercises 10

References

  • Richard P. Stanley, Enumerative Combinatorics, Volume 1, 2nd edition, Cambridge University Press, 2012.
  • Herbert S. Wilf, generatingfunctionology, 3rd edition, A K Peters, 2006.