Random Variables
A random variable is a measurable function that assigns a real number to each outcome of a random experiment. Key result in words: it transports probability from an abstract sample space onto the real line, where it is described by a distribution function, mass function, or density. Where it applies: all of probability theory, statistics, statistical physics, finance, information theory, and machine learning. Who/when: crystallized through Chebyshev and Kolmogorov (1933), building on Gauss, Laplace, and the measure theory of Borel and Lebesgue.
A random variable is the bridge between the messy, problem-specific world of outcomes and the clean, universal world of real numbers. Once you have , probability becomes the study of how mass is distributed along . Everything — expectation, variance, independence, convergence — is a statement about that distribution. The sample space becomes scaffolding you can discard.
Formal Statement
A probability space is a triple where:
- is the sample space (set of all outcomes ),
- is a -algebra of subsets of (the events), closed under complement and countable union,
- is a probability measure with and countable additivity.
The axioms of countable additivity read:
Derivation hint: this is Kolmogorov's third axiom; it is an assumption, not a theorem, chosen to make limits of probabilities behave.
A random variable is a function that is -measurable: for every ,
Derivation hint: we require the preimage of every half-line to be an event so that makes sense; preimages of all Borel sets then follow because generates the Borel -algebra. Symbols: = an outcome; = its numerical value; = preimage; = the events for which probability is defined.
The cumulative distribution function (CDF) of is
Derivation hint: apply to the measurable set guaranteed by equation [2]. is non-decreasing, right-continuous, with and . The law / distribution of is the pushforward measure on the Borel sets.
Discrete: takes values in a countable set; described by a probability mass function (PMF) with .
(Absolutely) continuous: there exists a probability density function (PDF) with
Derivation hint: this is the Radon–Nikodym derivative of with respect to Lebesgue measure, when it exists; wherever is differentiable.
For an integrable random variable, the expectation is
Derivation hint: the abstract Lebesgue integral over equals the Lebesgue–Stieltjes integral over by the change-of-variables (pushforward) theorem. reducing to (discrete) or (continuous). The variance is
Derivation hint: expand and use linearity of expectation with .
For a measurable function ,
Derivation hint: is itself a random variable; apply the pushforward of under , so no need to know the distribution of explicitly.
Why It Holds / Derivation
We justify equation [5]: that the integral over the abstract space equals an integral over using only the law . 1. Indicators. For with , . As a real-valued variable this takes value on and elsewhere, and . The identity holds. 2. Simple functions. Let with disjoint . By linearity of the integral, , which equals . 3. Non-negative . Choose simple functions pointwise. By the Monotone Convergence Theorem, , and correspondingly on , giving the identity for non-negative . 4. General . Write with . If at least one of is finite, subtract to obtain equation [5].
∎Kolmogorov's 1933 monograph Grundbegriffe der Wahrscheinlichkeitsrechnung placed probability on the rigorous footing of measure theory. His decisive move was to define a random variable as a measurable function on an abstract probability space, severing probability from any particular interpretation (frequency, betting, physical) and making it a branch of analysis. This let him prove the strong law of large numbers and the zero–one law with full rigor, and it remains the framework every undergraduate course silently assumes.
Building Intuition
Think of as a bag of tickets, one per outcome , each printed with a number . Drawing a ticket at random (weighted by ) and reading its number is the random variable. The measurability condition just says: for any threshold , the collection of tickets reading "" is one you're allowed to bet on (it lies in ). Now imagine collapsing all tickets with the same number into one pile. The piles, with their total weights, are the distribution. Two utterly different bags (rolling a die vs. spinning a 6-sector wheel) can produce the same piles — hence the same random variable in distribution. This is why we routinely "forget ": all probabilistic questions about alone are answered by the pile weights, i.e., by .
```svg
```
Worked Examples
Given: Roll a fair six-sided die. , each outcome probability . Define (the face value).
Steps: 1. PMF: for . 2. Expectation, eqn [5]: . 3. . 4. Variance, eqn [6]: .
Answer:
:::example[Uniform on [0,2] — Continuous] Given: uniform on , so for , else .
Steps: 1. Check normalization, eqn [4]: . ✓ 2. CDF, eqn [3]: for . 3. Expectation, eqn [5]: . 4. . 5. Variance, eqn [6]: .
Answer:
Common Misconceptions
"A random variable is a number" — false. It is a function . The number appears only after an outcome is drawn. Conflating the function with one of its values causes endless confusion when manipulating expressions like (a fixed number) versus (a function).
"Continuous means for some " — false. For a continuous random variable for every single point ; probability lives in intervals, not points. Density is not a probability — it can exceed .
"" — generally false (that is Jensen's inequality territory). Equality holds only for affine .
Let but take a coarse -algebra . Define . Then , which is not in . So fails the measurability condition [2] and is not a random variable with respect to this — even though it is a perfectly ordinary function. Measurability is relative to the chosen -algebra, not an intrinsic property of the formula.
Connections
Random variables sit at the hub of probability. The notion of independence is defined via factorization of joint distributions of several random variables, leading to Joint Distributions. Sequences of them and their limiting behavior produce the Law of Large Numbers and Central Limit Theorem. The expectation operator is a special case of the Lebesgue Integration machinery, and the existence of densities invokes the Radon–Nikodym Theorem. The CDF connects to Measure Theory through Lebesgue–Stieltjes measures, and transformations link to the Change of Variables formula. Conditioning generalizes to Conditional Expectation as a projection onto a sub--algebra.
Real-World Applications
Historical Development
Subtleties & Limits
Beyond the discrete/continuous dichotomy. Many distributions are neither purely discrete nor absolutely continuous. By the Lebesgue decomposition, every distribution splits into a discrete part, an absolutely continuous part, and a singular continuous part (e.g., the Cantor distribution), which has a continuous CDF but no density and assigns probability to a set of Lebesgue measure zero. Undergraduate courses usually ignore the singular part, yet it appears in dynamical systems and fractal models. Open practical questions: how to estimate and simulate from singular distributions efficiently, and how to define meaningful "densities" via Hausdorff measures. More foundationally, in infinite-dimensional settings (e.g., random functions, Gaussian processes) there is no Lebesgue measure, so the Radon–Nikodym viewpoint of equation [4] must be replaced by abstract measure theory — a frontier where measurability, the seemingly pedantic condition [2], becomes genuinely delicate.
See Also
Probability Distributions · Expectation · Variance and Standard Deviation · Cumulative Distribution Function · Law of Large Numbers · Central Limit Theorem · Measure Theory