Randomly rearranging a batch preserves every record exactly once, but it can leave some records in their original positions. The number left in place is random. Its expected value can equal one even though many rearrangements leave none and others leave several.

Use six distinct invented record identities, labeled one through six, originally stored at their matching positions. Choose uniformly from all 6! permutations. This is a finite model of reordering, not a recommendation for shuffling operational commands or a claim that any particular software produces a uniform permutation.

Define a fixed point by identity and position

Let pi(i) be the identity stored at position i after rearrangement. Position i is fixed when pi(i) = i. Let X count fixed positions. A permutation with X = 0 is called a derangement.

For example, the list [2,1,4,3,6,5] leaves no record in its initial position. So does [2,3,4,5,6,1]. These arrangements use different cycles but have the same fixed-point count zero.

Random Services' authored matching treatment distinguishes uniformly random permutations from independent draws with replacement and develops indicator moments. MathWorld's authored derangement entry defines fixed-point-free permutations and their counting formula. The six-record count distribution below is derived independently rather than copied from a source's listed small examples.

One position has a simple probability

There are 720 equally likely permutations. Fixing one specified position leaves the other five identities free to occupy the remaining positions in 5! ways. Thus P(pi(i)=i) = 5!/6! = 1/6.

Let I_i be one when position i is fixed and zero otherwise. Then X = I_1 + ... + I_6. Linearity of expectation gives E[X] = six times 1/6 = 1. This argument does not require independence between the indicators.

For two specified positions both to be fixed, only four identities remain to permute. Their joint probability is 4!/6! = 1/30, larger than (1/6)^2 = 1/36. Knowing one position is fixed makes another specified position fixed with conditional probability 1/5, rather than 1/6.

The positions are consequently dependent, even though every individual record is equally likely to occupy every position.

Count arrangements with no fixed positions

Start with all 720 permutations. For each specified fixed-position event there are 5! arrangements, so subtract six times 120. This subtracts arrangements having two fixed positions more than once; add back choose(6,2) times 4!.

Continue alternating over larger sets of forced fixed positions. Inclusion-exclusion gives D_6 = 6! - choose(6,1)5! + choose(6,2)4! - choose(6,3)3! + choose(6,4)2! - choose(6,5)1! + choose(6,6)0!.

Numerically, this is 720 - 720 + 360 - 120 + 30 - 6 + 1 = 265. Therefore P(X=0) = 265/720 = 53/144, approximately 0.368055556.

The mean count of one plainly does not mean that every rearrangement has one fixed position. More than one third of this finite permutation space has none at all.

Build the complete count distribution

To obtain exactly k fixed positions, first choose those positions in choose(6,k) ways. The remaining 6-k identities must form a derangement relative to their remaining original positions. Otherwise additional fixed points would increase the count beyond k.

The number with exactly k fixed points is therefore choose(6,k) D_(6-k), where D_0 = 1 counts the empty remaining assignment. For k from zero through six, the counts are 265, 264, 135, 40, 15, 0, and 1. They sum to 720.

The probability of exactly one fixed point is 264/720 = 11/30, approximately 0.366666667. It is close to, but different from, the probability of zero fixed points. The expectation aggregates all possible counts, rather than selecting either of those events.

Exactly five fixed positions are impossible. Once five distinct identities occupy their original positions, the sole remaining identity must occupy its own remaining position too. This structural zero distinguishes permutation matching from six independent Bernoulli trials.

Verify the mean and variance from the counts

Weighting the count table by k gives total 720 across all 720 permutations, recovering E[X] = 1. Weighting by k squared gives 1440, so E[X squared] = 2. The variance is consequently 2 - 1 squared = 1.

Indicators give an independent variance check. Each has variance (1/6)(5/6) = 5/36. Each distinct ordered pair has covariance 1/30 - 1/36 = 1/180. Summing six individual variances and thirty ordered-pair covariance terms gives 5/6 + 1/6 = 1.

Ignoring the dependence would instead give variance 5/6. Equal marginal probabilities and a correct mean would not reveal that missing covariance contribution.

Do not replace permutation sampling by independent draws

If six positions independently drew identities uniformly with replacement, repeats and missing identities would become possible. The chance of no positional match would then be (5/6)^6, approximately 0.334897977, different from the derangement probability.

That independent experiment may have zero matches while storing the same identity several times. A genuine permutation never duplicates or loses an identity. Having no fixed positions and having complete identity coverage are separate properties.

For n distinct identities, inclusion-exclusion gives derangement probability equal to the finite sum from j = 0 through n of (-1)^j/j!. As n grows it approaches exp(-1), while the expected fixed-point count remains one. The finite six-record table retains its exact constraints, including the impossible five-fixed-point event.

Keep record identity separate from identical payload values. If two distinct records carry the same numeric content, swapping them may leave a displayed value array unchanged while moving both identities. A permutation audit therefore needs a definition of the entity being tracked, the original position convention, and the assumed distribution over reorderings.

Sources checked October 24, 2026:

Random Services: The Matching Problem: https://www.randomservices.org/random/urn/Matching.html

Wolfram MathWorld: Derangement: https://mathworld.wolfram.com/Derangement.html

Concept illustration: A small desktop robot beside a laptop showing a generic workflow provides robotics context for this analytical model. The image does not depict the article's numerical example, a verified experiment, a product specification, or deployment evidence.