A permutation with no fixed points: count complete reassignments by inclusion-exclusion and distinguish the exact probability from the 1/e limit.
Derangement
A derangement is a permutation of distinct objects in which none remains in its original position. It counts complete one-to-one reassignments when every original match is forbidden. For a uniformly random shuffle, the count gives the probability that every label moves.
Write π(i) for the label occupying slot i. A fixed point occurs when π(i)=i; a derangement satisfies π(i)=i for every slot. This is a restriction on positions, not on whether labels remain adjacent or form pairs.
Four labels, nine complete moves
Start with labels 1, 2, 3 and 4 in their matching slots. The arrangement (2,1,4,3) is a derangement: two pairs swap. In contrast, (2,1,3,4) is not, because labels 3 and 4 stay put. A derangement need not be one long cycle.
Of the 4!=24 permutations, exactly nine have no fixed points. If all 24 are equally likely, the probability is
P(no fixed points)=249=83=37.5%.
Nine four-label derangements are listed. Among all 24 permutations, the counts with zero, one, two, three and four fixed points are 9, 8, 6, 0 and 1. The no-fixed-point probability is 37.5%; the average fixed-point count is 1.
Exact enumeration of four distinct labels. Read each listed arrangement from slot 1 to slot 4; every label differs from its slot number.
Count by removing fixed points
Let Dn, also written !n, be the number of derangements of n labels. For any specified k slots, fixing their matching labels leaves (n−k)! ways to arrange the rest. There are (kn) choices of these slots.
Simply subtracting permutations that fix each individual slot removes some permutations repeatedly. The inclusion-exclusion principle corrects these overlaps, alternately restoring and subtracting intersections:
Dn=k=0∑n(−1)k(kn)(n−k)!=n!k=0∑nk!(−1)k.
For four labels, this gives D4=24−24+12−4+1=9. For five, D5=44. The boundary counts are D0=1 (one empty arrangement) and D1=0. Dennis White's university notes derive the count using the same fixed-position events.
Counting and Combinatorics develops the factorial and binomial counting tools used here. Its public preview gives the outline; the full Library lesson requires membership.
What the probability does—and does not—say
Dividing by n! is valid under a uniform distribution over all permutations. Then
P(no fixed points)=k=0∑nk!(−1)k⟶e−1≈0.367879.
The limit is about 36.8%, not an exact finite-n probability. For four labels, use 37.5%. Berkeley's matching-problem chapter distinguishes the finite sum from this approximation.
Each slot has probability 1/n of being fixed. Summing these probabilities shows that the expected number of fixed points is one for every n≥1. That is an average over shuffles. The figure includes outcomes with zero, two and four fixed points. For n≥2, different slots’ fixed-point events are dependent, so multiplying their individual no-match probabilities does not give the derangement probability.
A biased shuffle, extra forbidden assignments or indistinguishable objects changes the counting or probability model. In quantitative research, forbidding original label matches can define a reassignment scheme, but it does not itself justify a statistical permutation test: the null model must still permit those rearrangements.