encyclopegia.org

Derangement

) is the number of -permutations; is the number of derangements – -permutations where all of the elements change their initial places.[src] In combinatorial mathematics, a derangement is a permutation of the elements of a set in which no element appears in its original position.[src] In other words, a derangement is a permutation that has no fixed points.[src] The number of derangements of a set of size is known as the derangement number or the subfactorial of or de Montmort number (after Pierre Remond de Montmort).[src] Notations for subfactorials in common use include , , , or .[src] For , the subfactorial equals the nearest integer to , where denotes the factorial of and is Euler's number.[src] The problem of counting derangements was first considered by Pierre Raymond de Montmort in his Essay d'analyse sur les jeux de hazard in 1708; he solved it in 1713, as did Nicholas Bernoulli at about the same time.[src]

) is the number of -permutations; is the number of derangements – -permutations where all of the elements change their initial places.[src] In combinatorial mathematics, a derangement is a permutation of the elements of a set in which no element appears in its original position.[src] In other words, a derangement is a permutation that has no fixed points.[src] The number of derangements of a set of size is known as the derangement number or the subfactorial of or de Montmort number (after Pierre Remond de Montmort).[src] Notations for subfactorials in common use include , , , or  .[src] For , the subfactorial equals the nearest integer to , where denotes the factorial of and is Euler's number.[src] The problem of counting derangements was first considered by Pierre Raymond de Montmort in his Essay d'analyse sur les jeux de hazard in 1708; he solved it in 1713, as did Nicholas Bernoulli at about the same time.[src] ==Counting derangements== Counting derangements of a set amounts to the hat-check problem, in which one considers the number of ways in which hats (call them through ) can be returned to people ( through ) such that no hat makes it back to its owner.[src] Each person may receive any of the hats that is not their own.[src] Call the hat which the person receives and consider s owner: receives either s hat, , or some other.[src] Accordingly, the problem splits into two possible cases: receives a hat other than .[src] This case is equivalent to solving the problem with people and hats because for each of the people besides there is exactly one hat from among the remaining hats that they may not receive (for any besides , the unreceivable hat is , while for it is ).[src] Another way to see this is to rename to , where the derangement is more explicit: for any from 2 to , cannot receive .[src] receives .[src] In this case the problem reduces to people and hats, because received s hat and received s hat, effectively putting both out of further consideration.[src] For each of the hats that may receive, the number of ways that may all receive hats is the sum of the counts for the two cases.[src] This gives us the solution to the hat-check problem: Stated algebraically, the number of derangements of an -element set is D_n = \left(n-1\right) \bigl(D_{n-1} + D_{n-2}\bigr) \quad \text{for}\ n \geq 2, where and .[src] The number of derangements of small lengths is given in the table below.[src] There are various other expressions for , equivalent to the formula given above.[src] These include D_n = n![src] \sum_{i=0}^n \frac{(-1)^i}{i!} \quad \text{for}\ n \geq 0 and D_n = \left[ \frac{n!}{e} \right] = \left\lfloor\frac{n!}{e}+\frac{1}{2}\right\rfloor \quad \text{for}\ n \geq 1, where is the nearest integer function and is the floor function.[src] Other related formulas include \begin{align} D_n &= \left\lfloor \frac{n!+1}{e} \right\rfloor\quad &\text{for}\ n &\ge 1, \\[10px] D_n &= \left\lfloor \left(e + e^{-1}\right)n!\right\rfloor - \lfloor en!\rfloor\quad &\text{for}\ n &\geq 2, \\[10px] D_n &= n![src] - \sum_{i=1}^n \binom{n}{i} \cdot D_{n - i}\quad &\text{for}\ n &\ge 1.[src] \end{align} The following recurrence also holds: D_n = \begin{cases} 1 & \text{if } n = 0, \\ n \cdot D_{n-1} + (-1)^n & \text{if }n > 0.[src] \end{cases} One may derive a non-recursive formula for the number of derangements of an -set, as well.[src] For we define to be the set of permutations of objects that fix the object.[src] Any intersection of a collection of of these sets fixes a particular set of objects and therefore contains permutations.[src] There are \binom{n}{i} such collections, so the inclusion–exclusion principle yields \begin{align} \left|S_1 \cup \dotsm \cup S_n\right| &= \sum_i \left|S_i\right| - \sum_{i and since a derangement is a permutation that leaves none of the objects fixed, this implies D_n = n![src] - \left|S_1 \cup \dotsm \cup S_n\right| = n![src] \sum_{i=0}^n \frac{(-1)^i}{i!} .[src] On the other hand, n!=\sum_{i=0}^{n} \binom{n}{i}D_i since we can choose elements to be in their own place and derange the other elements in just ways, by definition.[src] ==Growth rate== From D_n = n![src] \sum_{i=0}^n \frac{(-1)^i}{i!} and e^x = \sum_{i=0}^\infty {x^i \over i!} by substituting one immediately obtains that \lim_{n\to\infty} \frac{D_n}{n!} = \lim_{n\to\infty} \sum_{i=0}^n \frac{(-1)^i}{i!} = e^{-1} \approx 0.367879\ldots.[src] This is the limit of the probability that a randomly selected permutation of a large number of objects is a derangement.[src] The probability converges to this limit extremely quickly as increases, which is why is the nearest integer to .[src] The above semi-log graph shows that the derangement graph lags the permutation graph by an almost constant value.[src] More information about this calculation and the above limit may be found in the article on the statistics of random permutations.[src] D_n = \frac{n!}{e} + \sum_{k=1}^m \left(-1\right)^{n+k-1}\frac{B_k}{n^k} + O\left(\frac{1}{n^{m+1}}\right), where is any fixed positive integer, and denotes the Bell number.[src] Moreover, the constant implied by the big -term does not exceed .[src] \int_0^\infty P_{n_1}(x) P_{n_2}(x) \cdots P_{n_r}(x) e^{-x} \,dx, for a certain sequence of polynomials , where has degree .[src] But the above answer for the case gives an orthogonality relation, whence the are the Laguerre polynomials (up to a sign that is easily decided).[src] In particular, for the classical derangements, one has that D_n = \frac{ \Gamma(n+1,-1) }{ e } = \int_0^\infty(x - 1)^n e^{-x} \, dx where is the upper incomplete gamma function.[src] ==Computational complexity== It is NP-complete to determine whether a given permutation group (described by a given set of permutations that generate it) contains any derangements.[src]

50 sentences · 50 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Derangement." encyclopegia.org, 2026, https://encyclopegia.org/wiki/derangement. Accessed 01 December 2026.

Chicago

"Derangement." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/derangement.

APA

encyclopegia.org. (2026). Derangement. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/derangement

Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Grand Dérangement (band)

enwiki · references available

Trump derangement syndrome

enwiki · references available

Derangement syndrome

enwiki · references available

The Great Derangement (Taibbi book)

enwiki · references available

The Great Derangement

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371072654 · 0.5 · snapshot enwiki-001371072654

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.