Download Careers360 App
Derangement: Concepts, Definition & Solved Examples

Derangement: Concepts, Definition & Solved Examples

Edited By Komal Miglani | Updated on Jul 02, 2025 07:43 PM IST

Derangement is a permutation of the elements of a set, such that no element appears in its original position. One of the common examples of derangement is as follows: There are n letters and corresponding envelopes. Then derangement means no letter is placed in its corresponding(correct) envelope. In real life, we use derangement in puzzles, crystallography, and probability.

This Story also Contains
  1. Derangement: definition
  2. Shortcut to solve derangement questions
  3. Example of Derangement
  4. Solved Example Based on Derangement
Derangement: Concepts, Definition & Solved Examples
Derangement: Concepts, Definition & Solved Examples

In this article, we will learn about the Derangement. This topic falls under the broader category of Permutations and combinations, which is a crucial chapter in Class 11 Mathematics. This is very important not only for board exams but also for competitive exams, which even include the Joint Entrance Examination Main and other entrance exams: SRM Joint Engineering Entrance, BITSAT, WBJEE, and BCECE.

Derangement: definition

Derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, we can say derangement is a permutation that has no fixed points. One of the common examples of derangement is as follows: There are n letters and corresponding envelopes. Then derangement means no letter is placed in its corresponding(correct) envelope.

Derangement: If there are n things and n places, one correct place corresponds to each object. Then an arrangement in which none of the objects is in its right place is called a derangement.

The number of ways of doing this is denoted by D(n) (the number of ways of deranging ‘n’ objects).

The formula for the derangement is given by

$\mathrm{D}(\mathrm{n})=\mathrm{n}!\left(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\ldots+(-1)^{\mathrm{n}} \frac{1}{\mathrm{n}!}\right)$

Shortcut to solve derangement questions

Substituting the value of ‘n’ as 1, 2, 3, 4, 5, 6 we will get,

D(1)= 0

D(2)= 1

D(3)= 2

D(4)= 9

D(5)= 44

D(6)= 265

A quicker way to find out the total number of possible derangements is just to memorize the above values by heart and use them instantly in the questions.

Example of Derangement

Example: In how many ways can you form a dancing couple from 3 boys and 3 girls so that no boy dances with his respective girlfriend?

Solution: This is clearly a case of derangement of 3 boys and 3 girls.

The value can be interpreted as D(3) =2 ways

Recommended Video Based on Derangement:


Solved Example Based on Derangement

Example 1: In an examination, 5 students have been allotted their seats as per their roll numbers. The number of ways, in which none of the students sits on the allotted seat, is ______: [JEE MAINS 2023]

Solution

$\mathrm{D}_5=5!\left(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}\right)$

$\begin{aligned} \text { Derangement of 5 students } & =120\left(\frac{1}{2}-\frac{1}{6}+\frac{1}{24}-\frac{1}{120}\right) \\ & =60-20+5-1 \\ & =40+4 \\ & =44\end{aligned}$

Hence, the answer is 44.

Example 2: The number of ways in which a matrix match arrangement of order 5 $\times$ 5 with one-to-one correspondence can be attempted such that none of the parts is correctly matched is

Solution: We know that,

If n things are arranged in a row, the number of ways in which they can be arranged, so that none of them occupies its correct place is

$=n!\left(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}+\ldots+(-1)^n \frac{1}{n!}\right)$

Now,

Clearly, number of ways = D(5) = $5!\left(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}\right)=60-20+5-1=44$

Hence, the answer is 44

Example 3: In how many ways can 10 letters be placed in 10 addressed envelopes such that exactly 9 letters are in the correct envelope?

Solution: If exactly 9 letters are in their correct envelopes, then the 10th will definitely be in its correct envelope as well

So, no such way

Hence, the answer is 0

Example 4: A person writes letters to five friends and addresses the corresponding envelopes. In how many ways can the letters be placed in the envelopes such that at least two of them are in the wrong envelope?

Solution: The standard formula for calculating D(n)

$
\mathrm{D}(\mathrm{n})=\mathrm{n}!\left(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\ldots+(-1)^{\mathrm{n}} \frac{1}{\mathrm{n}!}\right)
$

Also, $D(1)=0, D(2)=1, D(3)=2, D(4)=9, D(5)=44, D(6)=265$
Now,

$
\begin{array}{lllll}
\mathrm{L}_1 & \mathrm{~L}_2 & \mathrm{~L}_3 & \mathrm{~L}_4 & \mathrm{~L}_5 \\
& & & & \\
\mathrm{E}_1 & \mathrm{E}_2 & \mathrm{E}_3 & \mathrm{E}_4 & \mathrm{E}_5
\end{array}
$

The total number of ways of putting 5 letters into 5 envelopes is 5!

The number of ways to place all letters to correct envelopes is 1

Number of ways to place 1 letter in the wrong envelope and the other 4 into the correct envelope = 0

Hence, the number of ways in which at least two letters go into the wrong envelopes

= Total ways - ways to put 0 letters in the wrong place - ways to put one letter in the wrong place

= 5! - 1 - 0

= 119

Hence, the answer is 119

Example 5: The number of arrangements of all digits of 12345 such that at least 3 digits will not come in its position is:

Solution: Total number of ways such that at least 3 digits will not come in its position.

=Derangement of 3 digits +Derangement of 4 digits +Derangement of 5 digits

$\begin{aligned}= & { }^5 \mathrm{C}_3\left\{3!-{ }^3 \mathrm{C}_1 2!+{ }^3 \mathrm{C}_2 1!-{ }^3 \mathrm{C}_3 0!\right\} \\ + & +{ }^5 \mathrm{C}_4\left[4!-{ }^4 \mathrm{C}_1(3!)+{ }^4 \mathrm{C}_2(2!)-{ }^4 \mathrm{C}_3(1!)+{ }^4 \mathrm{C}_4(0!)\right\} \\ & +{ }^5 \mathrm{C}_5\left\{5!-{ }^5 \mathrm{C}_1 4!+{ }^5 \mathrm{C}_2 3!-{ }^5 \mathrm{C}_3 2!+{ }^5 \mathrm{C}_4 1!-{ }^5 \mathrm{C}_5(0!)\right\} \\ = & 10(2)+5(9)+(44) \\ = & 20+45+44=109\end{aligned}$

Hence, the answer is 109


Frequently Asked Questions (FAQs)

1. What is a derangement in mathematics?
A derangement is a permutation of elements where no element appears in its original position. In other words, it's a rearrangement where every element is moved from its initial place.
2. How does a derangement differ from a regular permutation?
While a permutation can have elements in their original positions, a derangement specifically requires that no element remains in its initial place. Every item must be moved to a different position.
3. What is the symbol used to represent the number of derangements of n elements?
The number of derangements of n elements is typically denoted by !n (read as "subfactorial n" or "derangement of n").
4. Why is !1 (derangement of 1 element) equal to 0?
!1 = 0 because it's impossible to rearrange a single element without putting it back in its original position. By definition, a derangement requires all elements to be moved.
5. How do derangements relate to the concept of fixed points in permutations?
Derangements are permutations with no fixed points. A fixed point in a permutation is an element that remains in its original position, which is not allowed in a derangement.
6. Can you have a derangement of 2 elements? Why or why not?
Yes, you can have a derangement of 2 elements. There is only one way to do this: by swapping the two elements. This is why !2 = 1.
7. Why is it important to understand derangements in the study of permutations?
Understanding derangements provides insights into a special class of permutations, enhances problem-solving skills, and is crucial for certain probability calculations and combinatorial analyses.
8. What is the connection between derangements and the hat-check problem?
The hat-check problem is a classic application of derangements. It asks for the probability that no one receives their own hat when n people randomly pick up hats after checking them in.
9. How does the concept of derangements apply to real-world scenarios?
Derangements apply to situations where complete mismatching is desired or analyzed, such as in cryptography, shuffling algorithms, or analyzing probabilities in matching problems.
10. What is the "nearest neighbor" property in derangements?
The "nearest neighbor" property states that in a random derangement, the probability that an element moves to a position adjacent to its original position approaches 2/e as n approaches infinity.
11. What is the recursive formula for calculating derangements?
The recursive formula for derangements is: !n = (n-1) * (!(n-1) + !(n-2)), where !0 = 1 and !1 = 0.
12. What is the explicit formula for calculating the number of derangements?
The explicit formula for derangements is: !n = n! * (1/0! - 1/1! + 1/2! - 1/3! + ... + (-1)^n/n!)
13. How does the number of derangements relate to the total number of permutations?
The number of derangements is always slightly less than (n-1)/e times the total number of permutations, where e is Euler's number (approximately 2.71828).
14. How is the derangement formula derived?
The derangement formula is derived using the principle of inclusion-exclusion. It considers all permutations and then subtracts those with fixed points, accounting for overcounting.
15. What is the probability of obtaining a derangement when randomly shuffling n distinct objects?
As n approaches infinity, the probability of obtaining a derangement when randomly shuffling n distinct objects approaches 1/e (approximately 0.3679).
16. What is the connection between derangements and the Möbius function in number theory?
The Möbius function and derangements are related through the principle of inclusion-exclusion. The alternating sum in the derangement formula is similar to sums involving the Möbius function in certain number-theoretic contexts.
17. What is the connection between derangements and the Laguerre polynomials in mathematics?
The exponential generating function for derangements is closely related to Laguerre polynomials. This connection provides a link between combinatorics and orthogonal polynomials, useful in various areas of mathematics and physics.
18. How can the concept of derangements be extended to infinite sets?
Extending derangements to infinite sets involves considering permutations of infinite sets where no element remains in its original position. This concept connects to areas of set theory and can lead to interesting paradoxes and theoretical considerations in infinite combinatorics.
19. How can you use the concept of complementary counting to solve derangement problems?
Complementary counting involves finding the total number of permutations and subtracting those that are not derangements. This can sometimes simplify calculations, especially for small n values.
20. What is the significance of alternating signs in the derangement formula?
The alternating signs in the formula !n = n! * (1/0! - 1/1! + 1/2! - 1/3! + ... + (-1)^n/n!) come from the inclusion-exclusion principle and ensure correct counting by avoiding overcounting.
21. How does the number of derangements grow as n increases?
The number of derangements grows rapidly with n, but at a slightly slower rate than n!. The ratio of !n to n! approaches 1/e as n approaches infinity.
22. What is the relationship between derangements and the Taylor series of e^(-x)?
The Taylor series of e^(-x) is related to derangements. The probability of a random permutation being a derangement (1/0! - 1/1! + 1/2! - ...) is equal to e^(-1).
23. How can you use generating functions to study derangements?
Generating functions provide a powerful tool for analyzing derangements. The exponential generating function for derangements is D(x) = e^(-x) / (1-x), which encodes the sequence of derangement numbers.
24. How do derangements relate to the concept of permutation inversions?
While derangements focus on elements not being in their original positions, permutation inversions count pairs of elements that are out of order. Derangements typically have more inversions than average permutations.
25. Can you have partial derangements? If so, what are they?
Yes, partial derangements exist. A partial derangement is a permutation where some (but not necessarily all) elements are moved from their original positions. The study of partial derangements generalizes the concept of complete derangements.
26. How does the concept of derangements extend to multisets?
Derangements of multisets (sets with repeated elements) are more complex. The formula needs to be adjusted to account for the repetitions, and the number of possible derangements is generally lower than for sets with distinct elements.
27. How can you use the pigeonhole principle to prove that derangements exist for n > 1?
The pigeonhole principle can prove that derangements exist for n > 1 by showing that if you try to place n > 1 elements so that at least one is in its original position, you'll always have at least one element left that can be placed in a non-original position.
28. What is the asymptotic behavior of !n as n approaches infinity?
Asymptotically, !n is very close to n!/e rounded to the nearest integer. This approximation becomes increasingly accurate as n grows larger.
29. How does the concept of derangements apply in card shuffling?
In card shuffling, a derangement would represent a shuffle where no card ends up in its original position. The probability of achieving this in a random shuffle approaches 1/e for a large deck of cards.
30. Can you explain the role of derangements in the "Secretary Problem" or the "Marriage Problem"?
In these problems, derangements represent scenarios where no candidate is matched with their optimal choice. Understanding derangements helps in analyzing the probabilities of various outcomes in these matching scenarios.
31. How do derangements relate to the concept of permutation cycles?
Derangements are permutations with no cycles of length 1 (fixed points). They consist entirely of cycles of length 2 or greater, which is why they're sometimes called "fixed-point-free permutations."
32. What is the relationship between derangements and stirling numbers of the first kind?
Stirling numbers of the first kind count permutations with a specific number of cycles. Derangements are related to these numbers, as they are permutations with no 1-cycles (fixed points).
33. How can you use the principle of mathematical induction to prove properties of derangements?
Mathematical induction can be used to prove properties of derangements by establishing a base case (usually for n=1 and n=2) and then showing that if the property holds for n, it must also hold for n+1, often using the recursive formula for derangements.
34. What is the "100 prisoners problem" and how does it relate to derangements?
The "100 prisoners problem" is a probability puzzle where the worst-case scenario involves derangements. Understanding derangements helps in analyzing the probabilities and developing optimal strategies for this problem.
35. How do derangements factor into the study of random permutations?
In the study of random permutations, derangements represent an important subset. The probability that a random permutation is a derangement approaches 1/e, which is a key result in this field.
36. Can you explain how derangements are used in cryptography?
In cryptography, derangements can be used in certain encryption schemes to ensure that no element is encoded as itself. This property is useful in creating confusion and diffusion in cryptographic algorithms.
37. How do derangements relate to the concept of permutation statistics?
In permutation statistics, derangements represent permutations with a specific excedance number (number of positions where the permuted value exceeds the position). This connection helps in studying distributions of various permutation statistics.
38. What is the "Problème des Rencontres" and how does it relate to derangements?
The "Problème des Rencontres" (Problem of Coincidences) is essentially the derangement problem. It asks for the probability that in a group of n people, no one draws their own name in a random draw, which is exactly what derangements calculate.
39. How can you use the concept of derangements to solve problems involving mismatched pairs?
Derangements are perfect for solving problems involving mismatched pairs, such as calculating the probability of no matches in a random pairing. The derangement formula directly gives the number of ways to create complete mismatches.
40. What is the significance of derangements in the study of permutation groups?
In permutation groups, derangements form an important conjugacy class. They play a role in understanding the structure of these groups and in various theorems related to permutation group actions.
41. How do derangements relate to the concept of "desarrangements" in combinatorial theory?
"Desarrangements" is another term for derangements. The concept is the same, but this term is sometimes used in French mathematical literature and in some English texts influenced by French terminology.
42. Can you explain how derangements are used in the analysis of card tricks?
In card tricks, derangements can be used to analyze the probability of certain outcomes, especially in tricks that involve shuffling or rearranging cards. Understanding derangements helps magicians design tricks with specific probabilities of success.
43. What is the role of derangements in the study of random walks on symmetric groups?
In the study of random walks on symmetric groups, derangements play a role in understanding how quickly the walk "mixes" or approaches a uniform distribution. The proportion of derangements affects the mixing time of these random walks.
44. How can you use the concept of derangements to solve problems in operations research?
In operations research, derangements can model scenarios where complete reassignment or reallocation is required. For example, in job scheduling or resource allocation problems where no item should remain in its original position.
45. What is the connection between derangements and the Euler's totient function?
While not directly related, both derangements and Euler's totient function involve counting elements with certain properties in sets. They both use similar mathematical techniques, such as the principle of inclusion-exclusion.
46. How do derangements factor into the study of permutation patterns?
In permutation pattern theory, derangements represent permutations that avoid the pattern 1 (in the sense of pattern avoidance). This connection helps in studying more complex pattern avoidance problems.
47. Can you explain how derangements are used in the analysis of riffle shuffles?
In analyzing riffle shuffles, derangements can help in understanding the probability that no card remains in its original position after shuffling. This is particularly relevant for studying the effectiveness of shuffling techniques.
48. What is the significance of derangements in the study of permutation statistics like descents and major index?
Derangements provide a subset of permutations with specific properties, allowing for focused study of how statistics like descents and major index behave when no element is in its original position. This can reveal interesting patterns and distributions.
49. How do derangements relate to the concept of "menage numbers" in combinatorics?
Menage numbers, which count certain seating arrangements, are a generalization of derangements. Both involve arranging elements with certain restrictions, but menage problems add extra constraints beyond those in simple derangements.
50. What is the role of derangements in the study of dynamical systems?
In dynamical systems, derangements can model certain types of chaotic behavior where no point remains fixed under iteration. Understanding derangements can help in analyzing the long-term behavior of such systems.

Articles

Back to top