- Published on
Derangement
- Authors

- Name
- Muhammad Hasan
- @muhammadhasan01
Let's talk about Derangement, I've previously used it in some of my assignments back in my uni years here, so I'm thinking on describing it here as well.
Definition
A derangement is a permutation with no fixed points. That is, a derangement of a set leaves no element in its original place. For example, the derangements of are and , but is not a derangement of because is a fixed point.
Notation and formula
The number of derangements of an -element set is called the -th derangement number or rencontres number, or the subfactorial of and is sometimes denoted or .
This number satisfies the recurrences:
and is given by the formula
For example, the number derangements of a -element set is:
Which we know to be correct.
The first few derangements, starting from , are
Proof on Recurrence
Let's discuss the proof for the recurrences below:
We start with some base cases first, that is , , and .
Now suppose we have a permutation with elements, and we want to put an element in the -th position.
We can try to put the value where to the -th position, then we will have two cases:
Case : The position does not receive the value
Notice that for every position such that and , then cannot have the value , meanwhile the position cannot receive the value .
This is equivalent to a derangement of elements.
Since we have possibility of picking , we have a number of possibility for this case.
Case : The position receive the value
Now we will have elements remaining, this is equivalent to a derangement of elements.
Since we have possibility of picking , we have a number of possibility for this case.
Therefore considering all possible cases, then we will have:
Proof on Formula
Let's discuss on the proof of the formula:
This can be proven using Principle of Inclusion and Exclusion (PIE).
First, you take , which represents all arrangements of the whole sequence.
Then, you must subtract all arrangements in which each element appears in its original location, and now you have:
Then, you must add back in permutations in which each set of two elements stay in their original positions, as we subtracted them twice.
Now, we have:
PIE continues to give us this pattern. We have to alternate between subtracting and adding.
Now, we can change the form of .
This is written as:
We can now write our relation as
We can factor out and get:
Therefore: