For a uniform random permutation of objects, let count its fixed points. Write . Each indicator random variable has expected value , so linearity of expectation gives for every . This average does not require independence: for , fixing two specified objects has probability , greater than the product of their individual probabilities.
For four objects, exact enumeration gives counts for fixed points among the equally likely permutations. Their weighted arithmetic mean is . Exactly three fixed points are impossible: the last object must then also be fixed.
Figure 1.
The fixed point count of a uniform random permutation averaged over all permutations of four objects
. Each card lists . Green entries equal their positions and therefore mark fixed points. The probability mass function on the right counts those cards; its expected value is one. Details.
Choose the fixed objects and derange the remaining . Their count is among equally likely permutations. The inclusion-exclusion principle for proves the displayed law, valid for and zero otherwise. With , it includes the all-fixed case and the impossibility of exactly fixed objects. For fixed , the law tends to , the Poisson distribution of mean one.
Indicator random variable Created 2026-09-24 Updated 2026-10-14
An indicator random variable is the indicator function of an event in a probability space: is one when occurs and zero otherwise. It has a Bernoulli distribution with parameter , so and . Even an event described without numbers becomes a numerical random variable in this way.
For a finite collection of events, their indicator random variables add up to the number that occur. Linearity of expectation therefore turns an average count into a sum of probabilities, without requiring independence. The fixed point count of a uniform random permutation provides an example where the indicators are dependent random variables.
Linearity of expectation Created 2026-09-24 Updated 2026-10-14
For integrable random variables on the same probability space and fixed real numbers , linearity of expectation states
The random variables can be dependent random variables. The formula follows by the linearity of integration; a finite linear combination of integrable random variables remains integrable. For example, if takes with probabilities , then and are dependent random variables, yet .
An especially useful application counts how many events occur. Put , an indicator random variable, and . Since , we get . There is no need to compute the whole probability distribution of , or to assume independence. For a uniform random permutation of objects, each object stays fixed with probability , so the fixed point count of a uniform random permutation has expected value one for every . [ref].
Linearity of expectation concerns addition and multiplication by fixed scalars. Products instead satisfy under the hypotheses of expectation of a product of independent random variables. For the example above, , whereas . Applying a nonlinear function before averaging can therefore change the answer substantially; use the law of the unconscious statistician to compute that average.
The inclusion-exclusion principle gives
For the coat problem, all permutations are equally likely. If a specified set of people gets its own coats, the other coats can be assigned in ways, so that intersection has probability . Taking the complement of the union of correct-coat events gives the derangement probability
To have exactly fixed coats, choose their recipients and derange all remaining coats. Thus the fixed point count of a uniform random permutation has
and zero probability outside this range. The empty permutation has , so the formula includes ; it also gives zero for , since a lone remaining coat cannot be misplaced.
For fixed , , and the exponential series gives
These are the probabilities of a Poisson distribution of mean one. The limit is for fixed , not for increasing with .