Key idea of this section
A random variable is a measurable map X : (Ω, 𝓕) → (ℝ, 𝓑(ℝ)); its law is μX = P ∘ X⁻¹, and its distribution function F(x) = P(X ≤ x) determines μX completely.
Measurable maps
Definition 3.1. A function X : Ω → ℝ is a random variable if {X ≤ x} = X⁻¹((−∞, x]) ∈ 𝓕 for every real x.
Because the preimage map commutes with unions and complements, the sets B with X⁻¹(B) ∈ 𝓕 form a σ-algebra; it contains the half-lines and therefore all Borel sets. So the definition is equivalent to X⁻¹(B) ∈ 𝓕 for every Borel B. Sums, products, limits, lim sup and lim inf of sequences of random variables are random variables, as is g(X) for any Borel function g. The σ-algebra σ(X) = {X⁻¹(B) : B ∈ 𝓑(ℝ)} is the information carried by X. A useful fact (the Doob–Dynkin lemma) is that a random variable Y is σ(X)-measurable if and only if Y = g(X) for some Borel function g.
The law of X is the probability measure μX(B) = P(X ∈ B) on (ℝ, 𝓑(ℝ)), and its distribution function is F(x) = μX((−∞, x]). By Corollary 1.7, F determines μX.
Theorem 3.2. A function F : ℝ → [0, 1] is the distribution function of some random variable if and only if F is non-decreasing, right-continuous, F(x) → 0 as x → −∞ and F(x) → 1 as x → +∞.
Proof. Necessity follows from monotonicity and continuity of measure: for instance (−∞, x + 1/n] ↓ (−∞, x] gives right-continuity. For sufficiency, take Ω = (0, 1) with Lebesgue measure and define the generalised inverse X(u) = F⁻(u) = inf {x : F(x) ≥ u}. Right-continuity and monotonicity give the key equivalence F⁻(u) ≤ x ⇔ u ≤ F(x). Hence P(X ≤ x) = Leb{u : u ≤ F(x)} = F(x). ∎
This quantile construction is also the inverse transform method for simulation: if U is uniform on (0, 1), then F⁻(U) has distribution function F. Conversely, if F is continuous then F(X) is uniform on (0, 1), the probability integral transform.
Three kinds of distribution
The jumps of F occur at the atoms x with P(X = x) = F(x) − F(x−) > 0; since the jumps sum to at most 1 there are at most countably many. A law is discrete if it is carried by its atoms, and absolutely continuous if there is a density f ≥ 0 with F(x) = ∫−∞x f(t) dt; then P(X ∈ B) = ∫B f for every Borel B. There is a third, less familiar possibility. The Cantor distribution is the law of X = ∑ₖ 2εₖ/3ᵏ, where the εₖ are i.i.d. fair bits. Its distribution function is the Cantor function: continuous, so there are no atoms, yet the law lives on the Cantor set, which has Lebesgue measure zero, so there is no density. Such a law is called singular continuous.
Theorem 3.3 (Lebesgue decomposition). Every distribution function can be written uniquely as F = a Fd + b Fac + c Fsc with a, b, c ≥ 0, a + b + c = 1, where Fd is discrete, Fac is absolutely continuous and Fsc is singular continuous.
The Radon–Nikodym theorem underlies this result: μ has a density with respect to Lebesgue measure if and only if μ(B) = 0 for every Lebesgue-null set B.
A catalogue of laws
The following distributions occur constantly; mean and variance are listed for reference and are derived in the exercises and Lesson 5.
Bernoulli(p) P(X = 1) = p, P(X = 0) = 1 − p mean p variance p(1 − p) Binomial(n, p) P(X = k) = C(n,k) pᵏ (1 − p)ⁿ⁻ᵏ mean np variance np(1 − p) Geometric(p) P(X = k) = (1 − p)ᵏ⁻¹ p, k ≥ 1 mean 1/p variance (1 − p)/p² Poisson(λ) P(X = k) = e−λ λᵏ / k!, k ≥ 0 mean λ variance λ Uniform(a, b) f(x) = 1/(b − a) on (a, b) mean (a+b)/2 variance (b − a)²/12 Exponential(λ) f(x) = λ e−λx, x > 0 mean 1/λ variance 1/λ² Gamma(α, λ) f(x) = λα xα−1 e−λx / Γ(α), x > 0 mean α/λ variance α/λ² Normal(μ, σ²) f(x) = (2πσ²)−1/2 exp(−(x − μ)²/(2σ²)) mean μ variance σ² Cauchy f(x) = 1/(π(1 + x²)) no mean no variance
Joint laws and transformations
A random vector X = (X₁, …, Xₙ) is a measurable map into ℝⁿ; its law is a measure on 𝓑(ℝⁿ), determined by the joint distribution function. The coordinates are independent exactly when the joint law is the product of the marginal laws, and, in the absolutely continuous case, exactly when the joint density factorises as f(x₁, …, xₙ) = f₁(x₁) ⋯ fₙ(xₙ) almost everywhere.
Theorem 3.4 (change of variables). Let X have density fX on an open set U ⊆ ℝⁿ and let g : U → V be a C¹ bijection with C¹ inverse. Then Y = g(X) has density
fY(y) = fX(g⁻¹(y)) · |det D(g⁻¹)(y)|, y ∈ V
In one dimension with g strictly increasing, this reads fY(y) = fX(g⁻¹(y)) / g′(g⁻¹(y)). When g is not injective, sum over the branches. For example, if Z is standard normal then Y = Z² has two branches ±√y, and
fY(y) = 2 · (2π)−1/2 e−y/2 · 1/(2√y) = (2πy)−1/2 e−y/2, y > 0
which is the Gamma(1/2, 1/2) law, also called the chi-squared law with one degree of freedom. A classical two-dimensional application is the Box–Muller transform: if U₁, U₂ are independent uniforms, then √(−2 log U₁) cos(2πU₂) and √(−2 log U₁) sin(2πU₂) are independent standard normals. The proof runs Theorem 3.4 backwards through polar coordinates, where the Gaussian density e−(x² + y²)/2/(2π) separates into an exponential radial part and a uniform angle.
Order statistics give another standard computation. If X₁, …, Xₙ are i.i.d. with distribution function F, then M = max Xᵢ satisfies P(M ≤ x) = F(x)ⁿ by independence, and the minimum satisfies P(min Xᵢ > x) = (1 − F(x))ⁿ.
Exercise
- (a)Show that if U is uniform on (0, 1) and λ > 0, then −(log U)/λ is Exponential(λ).
- (b)Let M be the maximum of n independent Uniform(0, 1) variables. Find its density and its mean.
- (c)Let C be the Cantor function. Find C(1/4).
Show solution
Answers: (a) P(−(log U)/λ > x) = P(U < e−λx) = e−λx for x > 0, the exponential tail. (b) P(M ≤ y) = yⁿ, so the density is n yⁿ⁻¹ on (0, 1) and E M = ∫₀¹ n yⁿ dy = n/(n + 1). (c) In base 3, 1/4 = 0.020202…, which has digits 0 and 2 only; replacing each 2 by 1 and reading in base 2 gives 0.010101… = 1/3, so C(1/4) = 1/3.