01 / 22

Order
Statistics

Learn how sorting random samples unlocks powerful tools: from the minimum and maximum to the median and beyond, with their exact probability distributions.

Statistics

What Are Order Statistics?

Given a random sample \( X_1, X_2, \ldots, X_n \), we sort all values from smallest to largest. The sorted values are called order statistics and are denoted:

Even though the original \( X_i \) may be i.i.d., the order statistics \( X_{(k)} \) are neither independent nor identically distributed: sorting introduces both dependence and distinct marginal distributions.

Sorting a Random Sample

Unsorted Sample 4.7 1.2 6.3 3.1 5.5 2.8
\(X_1\)
\(X_2\)
\(X_3\)
\(X_4\)
\(X_5\)
\(X_6\)
sort Order Statistics 1.2 2.8 3.1 4.7 5.5 6.3
\(X_{(1)}\)
\(X_{(2)}\)
\(X_{(3)}\)
\(X_{(4)}\)
\(X_{(5)}\)
\(X_{(6)}\)
min max
Median = \(\frac{X_{(3)}+X_{(4)}}{2} = 3.9\)

Why Do They Matter?

Robust Estimation
The sample median \( X_{(m)} \) resists outliers far better than the sample mean.
Confidence Intervals
Distribution-free confidence intervals for quantiles use order statistics as endpoints.
Goodness-of-Fit
Tests like Kolmogorov-Smirnov and Q-Q plots compare order statistics to theoretical quantiles.

CDF of \( X_{(k)} \)

Let \( X_1, \ldots, X_n \) be i.i.d. with CDF \( F(x) \). The event \( \{X_{(k)} \leq x\} \) happens when at least \( k \) of the \( n \) observations fall at or below \( x \). Each observation does so independently with probability \( F(x) \).

This is simply the tail of a \( \text{Binomial}(n, F(x)) \) distribution. Think of it as: flip \( n \) coins, each with success probability \( F(x) \), and ask for \( \geq k \) successes.

PDF of \( X_{(k)} \)

Differentiating the CDF (or using a counting argument for the infinitesimal event) gives the marginal density of the \( k \)-th order statistic:

1
\( [F(x)]^{k-1} \): probability that exactly \( k-1 \) values fall below \( x \).
2
\( [1-F(x)]^{n-k} \): probability that exactly \( n-k \) values fall above \( x \).
3
\( f(x) \): the density of the one observation at \( x \).
4
Multinomial coefficient \( \frac{n!}{(k-1)!\,1!\,(n-k)!} \): the number of ways to assign the roles.

Minimum vs Maximum

Minimum \( X_{(1)} \)
Set \( k=1 \):
\( f_{X_{(1)}}(x) = n\,[1-F(x)]^{n-1}\,f(x) \)

CDF: \( F_{X_{(1)}}(x) = 1-[1-F(x)]^n \)
Maximum \( X_{(n)} \)
Set \( k=n \):
\( f_{X_{(n)}}(x) = n\,[F(x)]^{n-1}\,f(x) \)

CDF: \( F_{X_{(n)}}(x) = [F(x)]^n \)

Uniform Case: the Beta Connection

When \( X_i \sim \text{Uniform}(0,1) \), we have \( F(x)=x \) and \( f(x)=1 \). The PDF simplifies beautifully:

This means \( U_{(k)} \sim \text{Beta}(k, n-k+1) \), giving us:

Mean
\( E[U_{(k)}] = \dfrac{k}{n+1} \)
Variance
\( \text{Var}(U_{(k)}) = \dfrac{k(n-k+1)}{(n+1)^2(n+2)} \)

Beta Densities for \( n=5 \)

0 0.25 0.50 0.75 1 0 1 2 3 4 5 u f(u)
---
\( U_{(1)} \sim \text{Beta}(1,5) \)
---
\( U_{(3)} \sim \text{Beta}(3,3) \)
---
\( U_{(5)} \sim \text{Beta}(5,1) \)

Joint Density of \( X_{(i)} \) and \( X_{(j)} \)

For \( 1 \leq i < j \leq n \), the joint PDF of two order statistics is:

The logic extends the marginal case: the \( n \) observations are partitioned into five regions on the real line: below \( x \), at \( x \), between \( x \) and \( y \), at \( y \), and above \( y \).

Range and Midrange

Sample Range
\( R = X_{(n)} - X_{(1)} \)

Measures spread of the data. Derived from the joint density of \( (X_{(1)}, X_{(n)}) \).
Midrange
\( M = \dfrac{X_{(1)} + X_{(n)}}{2} \)

Estimates the center. For symmetric distributions, it is unbiased for the mean.

How to Find the PDF: Step by Step

1
Identify \( k \), \( n \), and the parent distribution with CDF \( F(x) \) and PDF \( f(x) \).
2
Write the general formula: \( f_{X_{(k)}}(x) = \frac{n!}{(k-1)!(n-k)!} [F(x)]^{k-1}[1-F(x)]^{n-k} f(x) \).
3
Substitute the specific \( F(x) \) and \( f(x) \) from the parent distribution.
4
Simplify. Look for known distributions (Beta, exponential, etc.).
5
Find moments by integrating, or by recognizing the named distribution's known mean and variance.

Example: Exponential Minimum

Let \( X_1, \ldots, X_n \stackrel{\text{iid}}{\sim} \text{Exp}(\lambda) \). Find the distribution of \( X_{(1)} = \min(X_1, \ldots, X_n) \).

Example: Uniform Maximum

Let \( X_1, \ldots, X_4 \stackrel{\text{iid}}{\sim} \text{Uniform}(0,\theta) \). Find the PDF and mean of \( X_{(4)} \).

Since \( E[X_{(4)}] = \frac{4\theta}{5} \), the unbiased estimator of \( \theta \) based on the max is \( \hat{\theta} = \frac{5}{4}X_{(4)} \). This is the foundation of the famous German tank problem estimator.

Example: Median of 3 Uniforms

Let \( U_1, U_2, U_3 \stackrel{\text{iid}}{\sim} \text{Uniform}(0,1) \). Find the PDF and variance of the median \( U_{(2)} \).

Mean
\( E[U_{(2)}] = \frac{2}{4} = \frac{1}{2} \)
Variance
\( \text{Var}(U_{(2)}) = \frac{2 \cdot 2}{4^2 \cdot 5} = \frac{1}{20} \)
Mode
\( \frac{2-1}{2+2-2} = \frac{1}{2} \) (symmetric)

Common Mistakes

✕ Confusing \( X_k \) with \( X_{(k)} \)
\( X_k \) is the \( k \)-th sampled observation (random label), while \( X_{(k)} \) is the \( k \)-th smallest value. They are different random variables.
✕ Assuming Independence
Order statistics from the same sample are dependent. For instance, \( X_{(1)} \leq X_{(2)} \) always, so they cannot be independent.
✕ Wrong Factorial Split
The multinomial coefficient is \( \frac{n!}{(k-1)!\,1!\,(n-k)!} \), not \( \frac{n!}{k!\,(n-k)!} \). Off-by-one in the exponents changes the entire PDF.

Summary Table

General i.i.d. \( F, f \) \( \text{Uniform}(0,1) \)
PDF of \( X_{(k)} \) \( \frac{n!}{(k\!-\!1)!(n\!-\!k)!} F^{k-1}(1\!-\!F)^{n-k}f \) \( \text{Beta}(k, n-k+1) \)
CDF of \( X_{(k)} \) \( \sum_{j=k}^{n}\binom{n}{j}F^j(1\!-\!F)^{n-j} \) Regularized incomplete beta
\( E[X_{(k)}] \) Depends on \( F \) \( \frac{k}{n+1} \)
Min \( X_{(1)} \) \( n(1-F)^{n-1}f \) \( \text{Beta}(1, n) \)
Max \( X_{(n)} \) \( nF^{n-1}f \) \( \text{Beta}(n, 1) \)

Question 1 of 5

Let \( X_1, \ldots, X_5 \stackrel{\text{iid}}{\sim} \text{Uniform}(0,1) \). What is the distribution of \( X_{(3)} \)?

Question 2 of 5

If \( X_1, \ldots, X_n \stackrel{\text{iid}}{\sim} \text{Exp}(\lambda) \), what is the distribution of \( X_{(1)} \)?

Question 3 of 5

For \( U_{(k)} \) from a \( \text{Uniform}(0,1) \) sample of size \( n \), what is \( E[U_{(k)}] \)?

Question 4 of 5

In the general PDF formula for \( X_{(k)} \), the exponent on \( F(x) \) is:

Question 5 of 5

Are the order statistics \( X_{(1)} \) and \( X_{(n)} \) from an i.i.d. sample independent?