Permutations and Combinations
7. Derangement
Derangement Definition
A derangement is a permutation of the elements of a set in which no element appears in its natural position. In other words, all the elements are in incorrect positions. It is usually denoted by \(D_n\) or \(D(n)\).
Take a simple example: suppose there are three balls and three boxes of green, blue, and red colors. We want to place the balls into the boxes in such a way that the color of the ball and the box do not match. This is an example of a derangement. The diagram below depicts that this can be done in two ways.
Take another example, suppose there are four numbers \(1,2,3,4\) then the derangements of these numbers are listed here. See that \(1\) is not at the first place, \(2\) is not at the second place, \(3\) is not at the third place and \(4\) is not at the fourth place.
There are \(9\) such permutations.
Take another example, suppose there are \(n\) letters and \(n\) corresponding envelopes, then an arrangement such that no letter goes to the right envelope is known as derangement. In general, it is an arrangement in which \(n\) things are arranged in a row and all occupy the wrong places.
Derangement Formula
Suppose \({a_1},\;{a_2},\;{a_3},\;........,\;{a_n}\) are \(n\) letters and
\({A_1},\;{A_2},\;{A_3},\;........,\;{A_n}\)are \(n\) corresponding envelopes
Then the number of ways so that \({a_1}\) is not going to \({A_1}\), \({a_2}\) is not going to \({A_2}\), etc. is given by the formula:
\(D_n=\) \(n!\left[ {1 - \cfrac{1}{{1!}} + \cfrac{1}{{2!}} - \cfrac{1}{{3!}} + \cfrac{1}{{4!}} - ........{{( - 1)}^n}\cfrac{1}{{n!}}} \right]\)
By putting \(n = 1,2,3,4,5\) we get
\({D_1} = 0,\;{D_2} = 1,\;{D_3} = 2,\;{D_4} = 9,\;{D_5} = 44\)
Similarly \(D_6=\) \(6!\left[ {1 - \cfrac{1}{{1!}} + \cfrac{1}{{2!}} - \cfrac{1}{{3!}} + \cfrac{1}{{4!}} - \cfrac{1}{{5!}} + \cfrac{1}{{6!}}} \right]\,\,\)
\( = \,\cfrac{{6!}}{{2!}} - \cfrac{{6!}}{{3!}} + \cfrac{{6!}}{{4!}} - \cfrac{{6!}}{{5!}} + \cfrac{{6!}}{{6!}}\)
\(= 360-120+30-6+1=265\)
If \(n\) things are arranged in such a way that exactly \(r\) things occupy wrong places and remaining \(n - r\) things occupy right places, then total number of ways = \({}^n{C_{n - r}}\,{D_r}\)
Example 1:
There are 6 letters and 6 corresponding envelopes. In how many ways the letters can be placed into the envelopes such that exactly one letter goes to the correct envelope?
= \(6 \times 44 = 264\) ways.