Skip to main content

TL;DR

A permutation where no element appears in its original position. The number of derangements of n elements is \( D_n = n! \sum_{k=0}^n \frac{(-1)^k}{k!} \approx n!/e \).

By Valenke Exam Prep Team·Last updated 2026-06-03

Derangement

A permutation where no element appears in its original position. The number of derangements of n elements is \( D_n = n! \sum_{k=0}^n \frac{(-1)^k}{k!} \approx n!/e \).

Why it matters for interviews

Classic interview problem: what is the probability a random permutation has no fixed points? The answer \( \approx 1/e \) is elegant and appears in card shuffling, secret Santa, and matching problems.

Definition and Mathematical Foundation

A permutation where no element appears in its original position. The number of derangements of n elements is \( D_n = n! \sum_{k=0}^n \frac{(-1)^k}{k!} \approx n!/e \).

Application in Quantitative Finance

Classic interview problem: what is the probability a random permutation has no fixed points? The answer \( \approx 1/e \) is elegant and appears in card shuffling, secret Santa, and matching problems.

Related Concepts

Related Terms

Ready to practice for the Quant Trading Interview?

Adaptive practice powered by Item Response Theory targets your weak areas. Start with 3 free sessions.

Start free practice →

Frequently Asked Questions

What is the probability that a random permutation is a derangement?
\( D_n/n! = \sum_{k=0}^n \frac{(-1)^k}{k!} \to 1/e \approx 0.3679 \). Remarkably, this converges extremely fast -- even for n=5, the probability is within 0.3% of 1/e.
What is the recurrence for derangements?
\( D_n = (n-1)(D_{n-1} + D_{n-2}) \) with \( D_0 = 1, D_1 = 0 \). The intuition: element 1 goes to position k (n-1 choices), then either k goes to 1 (leaving D_{n-2}) or not (leaving D_{n-1}).
How is the derangement formula derived?
Apply inclusion-exclusion to the events \( A_i \) = 'element i is fixed'. \( |A_{i_1} \cap \cdots \cap A_{i_k}| = (n-k)! \). Summing with alternating signs gives the derangement formula.