Maths WorkshopMaths problems with full solutions
Exercise 1253Combinatorics › Counting principlesM1Added 4 Nov 2026

The expected number of records

#expectation#symmetry#harmonic numbers#permutations

Statement

A random ordering of nn different numbers is presented one at a time. A record is a number larger than all the numbers before it (the first number is always a record). Prove that the expected number of records is the harmonic number Hn=1+12+⋯+1nH_n=1+\frac12+\dots+\frac1n.

Hint

Let IkI_k be the indicator that the kk-th number is a record. Compare the kk-th number with the first k−1k-1 ones: what is the probability that it is the largest of the first kk?

Show solutionHide solution

Solution

Indicators. Let Ik=1I_k=1 if the kk-th number is a record, and 00 otherwise. The number of records is R=I1+⋯+InR=I_1+\dots+I_n.

Probability of Ik=1I_k=1. The kk-th number is a record iff it is the largest among the first kk numbers. By symmetry, each of the first kk numbers is equally likely to be the largest, so
Pr⁡[Ik=1]=1k.\Pr[I_k=1]=\frac1k.

Linearity.
E[R]=∑k=1n1k=Hn.\mathbb{E}[R]=\sum_{k=1}^n\frac1k=H_n.

Check. For n=5n=5, enumerating all 120120 permutations gives mean 13760=H5\frac{137}{60}=H_5.

Remark. The indicators are even independent, so Var⁡R=∑1k(1−1k)\operatorname{Var}R=\sum\frac1k(1-\frac1k). Since Hn≈ln⁡n+0.577H_n\approx\ln n+0.577, records are rare: among 10001000 numbers one expects about 7.57.5 records. Basis of the secretary problem.

Lesson. Use symmetry to compute the probability of each indicator, then add.