Derangements
A derangement is a permutation in which no element stays in its original position (for example, nobody gets their own hat back). The ratio quickly approaches . It is used in probability puzzles such as the secret-Santa or hat-check problem.
LaTeX
!n=n!\sum_{k=0}^{n}\frac{(-1)^k}{k!}Variables
- number of derangements of n objects
Example
Count derangements of 4 objects.
- .
Answer: .