Motivating Example: When Does the Meeting Start?¶
Five colleagues agree to meet during a one hour window. Each arrives at a time chosen independently and uniformly at random within the window. The room is unlocked as soon as the first person arrives, and the meeting starts only when the last person arrives.
Two natural questions follow. On average, how long does the room sit unlocked before the meeting starts? More precisely:
What is the expected arrival time of the first person?
What is the expected arrival time of the last person?
Both questions ask for the expected value of a ranked member of a random sample: the smallest arrival time and the largest. Quantities of this kind are called order statistics, and they can be computed exactly. This appendix develops the tools needed to do so, in particular for values drawn uniformly at random from an interval, which is the setting used in the Auction Games chapter.
Theory¶
Definition: Probability Density and Cumulative Distribution Functions¶
A continuous random variable has a probability density function (pdf) if for all :
The cumulative distribution function (cdf) of is:
The two functions carry the same information: the cdf is the integral of the pdf, and wherever is differentiable, . The expected value of is:
Definition: The Uniform Distribution¶
A random variable is uniform on if its pdf is for and 0 otherwise. Its cdf is:
Every value in is equally likely, and the expected value is:
Theorem: Expectation via the Survival Function¶
If takes values in with cdf then:
This follows from integration by parts:
since makes the boundary term vanish. The function is called the survival function, and this form of the expectation is often the quickest route to expected minima, as the next results show.
Definition: Order Statistics¶
Let be independent random variables, each with cdf . The order statistics are the same values sorted into increasing order: is the -th smallest of the sample. In particular:
Theorem: CDF of the Maximum and the Minimum¶
Let be independent, each with cdf . Then:
The first statement holds because the maximum is at most precisely when every is at most , and by independence these events have probability jointly. Similarly the minimum exceeds precisely when every exceeds , so , and the cdf of the minimum is the complement.
Example: Two Uniform Values¶
Let and be independent and uniform on . This is the setting of a two bidder auction with uniform valuations. We compute the expected values of and .
The maximum. With and the cdf of the maximum is , so its pdf is and:
The minimum. The survival function of the minimum is , so by expectation via the survival function:
As a check, , so the two expectations must sum to , and indeed . A further consequence, by linearity of expectation, is the expected gap between the two values:
Theorem: Expected Order Statistics of the Uniform Distribution¶
Let be independent and uniform on . The -th order statistic has pdf:
and expected value:
The form of the pdf can be read off directly: for to sit at , one of the values must land at (a factor of ), and of the remaining values, some must fall below (each with probability ) and the other above (each with probability ), with ways to choose which. The expectation then follows from the Beta integral:
applied with and :
The result has a pleasing interpretation: uniform points split into gaps, and by symmetry each gap has expected length . The expected order statistics are therefore evenly spaced: . Setting and recovers the expected minimum and maximum:
This answers the questions of Motivating Example: When Does the Meeting Start?: with colleagues, the room is unlocked at of the window on average (10 minutes in), and the meeting starts at (50 minutes in), so the room sits unlocked for an expected 40 minutes before the meeting begins.
Exercises¶
Programming¶
The expectations in this appendix are integrals that Sympy can evaluate symbolically. Here is the expected maximum and minimum of two uniform values, using the pdf of the maximum and the survival function of the minimum:
import sympy as sym
x = sym.Symbol("x", positive=True)
expected_max = sym.integrate(x * 2 * x, (x, 0, 1))
expected_min = sym.integrate((1 - x) ** 2, (x, 0, 1))
expected_max, expected_min(2/3, 1/3)The general formula for the -th order statistic of uniform values can be checked in the same way:
N, k = sym.symbols("N k", positive=True, integer=True)
pdf_k = N * sym.binomial(N - 1, k - 1) * x ** (k - 1) * (1 - x) ** (N - k)
expected_k = sym.simplify(sym.integrate(x * pdf_k, (x, 0, 1)))
expected_kNumerical simulation gives an independent confirmation. Numpy’s sort sorts
each sample, so column of the sorted array holds the -th order
statistic:
import numpy as np
rng = np.random.default_rng(seed=0)
number_of_samples = 100_000
sample_size = 5
samples = rng.uniform(size=(number_of_samples, sample_size))
sorted_samples = np.sort(samples, axis=1)
for k in range(1, sample_size + 1):
estimate = sorted_samples[:, k - 1].mean()
exact = k / (sample_size + 1)
print(f"k = {k}: simulated {estimate:.4f}, exact {exact:.4f}")k = 1: simulated 0.1663, exact 0.1667
k = 2: simulated 0.3334, exact 0.3333
k = 3: simulated 0.5002, exact 0.5000
k = 4: simulated 0.6672, exact 0.6667
k = 5: simulated 0.8335, exact 0.8333
Notable Research¶
The systematic study of order statistics grew out of early twentieth century work on extremes. Fisher and Tippett Fisher & Tippett, 1928 characterised the possible limiting distributions of the maximum of a large sample, a result completed by Gnedenko Gnedenko, 1943; together these form the foundation of extreme value theory, which underpins modern models of floods, heatwaves, and financial risk.
Rényi Rényi, 1953 gave an elegant representation of the order statistics of an exponential sample as a sum of independent scaled exponentials. This representation remains a standard tool for deriving the joint behaviour of order statistics.
The standard modern references are the monograph of David and Nagaraja David & Nagaraja, 2003, which surveys the field, and the more introductory treatment of Arnold, Balakrishnan and Nagaraja Arnold et al., 2008.
In game theory, expected order statistics of uniform samples are exactly what is needed to compute expected revenue in auctions: the winner’s payment in a second-price auction is the second highest valuation. This connection goes back to Vickrey Vickrey, 1961, whose analysis of sealed bid auctions is discussed in the Auction Games chapter.
Conclusion¶
For independent values with a common cdf , the maximum has cdf and the minimum has survival function ; expectations then follow by integrating the pdf, or the survival function directly. Table A6.1 collects the key facts for the uniform distribution on .
Table A6.1:Order statistics of independent uniform values on .
| Quantity | Value |
|---|---|
| cdf of | |
| cdf of | |
| $\mathbb{E}\left | X_1 - X_2\right |
Solutions¶
- Fisher, R. A., & Tippett, L. H. C. (1928). Limiting forms of the frequency distribution of the largest or smallest member of a sample. Mathematical Proceedings of the Cambridge Philosophical Society, 24(2), 180–190.
- Gnedenko, B. (1943). Sur la distribution limite du terme maximum d’une série aléatoire. Annals of Mathematics, 44(3), 423–453.
- Rényi, A. (1953). On the theory of order statistics. Acta Mathematica Academiae Scientiarum Hungaricae, 4(3–4), 191–231.
- David, H. A., & Nagaraja, H. N. (2003). Order Statistics (3rd ed.). John Wiley & Sons.
- Arnold, B. C., Balakrishnan, N., & Nagaraja, H. N. (2008). A First Course in Order Statistics. SIAM.
- Vickrey, W. (1961). Counterspeculation, auctions, and competitive sealed tenders. The Journal of Finance, 16(1), 8–37.