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.
For a uniform random permutation , define as the rank of among , with rank one assigned to the smallest value. Each sequence corresponds to exactly one permutation: insert index in position of the current increasing-value list, then assign the final list the values . The equally likely permutations therefore correspond to the equally likely rank sequences. Consequently the are independent random variables, each with the displayed uniform distribution.
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.
For each , let be the relative rank of among , with the smallest value assigned rank one. Then . The independent relative ranks of a uniform random permutation can be proved directly: for any choices , insert the index at position in the list of previous indices ordered by their values. After all insertions, assign the values along that list. This is a unique permutation with those relative ranks, and conversely every permutation yields one such insertion sequence.
There are possible insertion sequences, all equally likely because the uniform random permutation is uniform. Thus
The ranks are independent and each is uniform on its possible values. It follows that the independent record indicators have
The first indicator is the constant one, which is also independent of the others. For , additivity of expectation and variance additivity for independent random variables give
Here is the harmonic number.
Let be the year index of the second record. For , independence gives
The empty product for is one. There is no second record in the first years with probability
This exposes a finite-horizon qualification in the final request: a permutation of length alone does not specify when a record outside those years will occur. Under the usual continuation by an infinite sequence of independent, identically distributed observations with a continuous distribution, the same relative-rank argument holds for every finite prefix. Then for every , and . These probabilities sum to one, so the second record occurs almost surely, but
The expected number of additional years after year one, , is also infinite. This is the first-sample case of the waiting time for a new record after a fixed sample.
If instead one asks for the mean year conditional on the second record occurring within the stated years, then, for ,
The mean additional wait under that conditioning is this value minus one. These are distinct questions: assigning whenever no second record occurs in the finite horizon also gives an infinite unconditional mean, whereas a censored observation has finite expectation by the tail-sum formula for expectation.