# Derangements

Derangement is a type of combinatorial problem that involves permutations with no fixed points. In other words, a derangement is a permutation of a set of elements ranking from 1 to n in which none of the elements is left at its original place.

The number of derangements of a set of size n is known as the subfactorial of n or the n-th derangement number or n-th de Montmort number (after Pierre Remond de Montmort).

#### Key Concepts

**Formula**: The formula for the number of derangements D(n) of a set with n objects is

D(n) = n![1-1/1!+1/2!-1/3!…1/N!].

#### Examples

**Example 1**: In how many ways can 6 people be arranged in 6 seats such that none of them are occupying their original positions?

This is an example of a derangement problem.

The number of ways to arrange 6 people in 6 seats is 6!.

The number of derangements of a set of size 6 is D(6) = 265.

Therefore, the number of ways to arrange 6 people in 6 seats

such that none of them are occupying their original positions is

6! × D(6) = 265,252,800

**Example 2**: In how many ways can 5 students A, B, C, D, and E grade their 5 tests such that no student grades their own test?

This is an example of a derangement problem.

The number of ways to grade the tests is 5!.

The number of derangements of a set of size 5 is D(5) = 44.

Therefore, the number of ways to grade the tests such that no student grades their own test is

5! × D(5) = 52,800