# Random variable

A random variable is a function that assigns a number (or, more generally, an element of a measurable state space) to each outcome of a random experiment, defined formally as a measurable function on a probability space. Despite the name, it is neither a variable in the algebraic sense nor random in itself: it is a fixed function \( X \), and the randomness enters through the outcome \( \omega \) drawn from the sample space \( \Omega \).<sup>[1](https://youyuanwu.github.io/misc-docs/math/11-probability/02-random-variables.html)</sup> Random variables are the central objects through which probability theory connects abstract experiments to numerical quantities such as counts, measurements, and payoffs.<sup>[2](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L01_randomvariables.html)</sup>

| Key fact | Detail |
|---|---|
| Formal definition | A function \( X : \Omega \to \mathbb{R} \) on a probability space \( (\Omega, \mathcal{F}, P) \) such that \( X^{-1}(B) \in \mathcal{F} \) for every Borel set \( B \)<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> |
| Checking measurability | It suffices that \( X^{-1}((-\infty, b]) \in \mathcal{F} \) for all \( b \), since the Borel σ-algebra is generated by such intervals<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> |
| Law (distribution) | The pushforward measure \( \mu(A) = P(X \in A) \), which carries all probabilistic information about \( X \)<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> |
| Distribution function | \( F(x) = P(X \le x) = \mu((-\infty, x]) \), defined for every real-valued random variable<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> |
| Discrete case | Countable range, completely specified by the probability mass function \( p_X(x) = P(X = x) \)<sup>[4](https://cni.iisc.ac.in/courses/random/Probability%20Foundations/lecture-04.html)</sup> |
| Continuous case | A density \( f_X \ge 0 \) with \( P_X(B) = \int_B f_X(x)\,dx \) for Borel sets \( B \)<sup>[5](https://encyclopediaofmath.org/wiki/Random_variable)</sup> |
| Measure-theoretic origin | Kolmogorov's 1933 *Grundbegriffe der Wahrscheinlichkeitsrechnung* gave the first full measure-theoretic exposition, making clear that a random variable is a measurable function on a probability space<sup>[5](https://encyclopediaofmath.org/wiki/Random_variable)</sup> |

## Definition

The setting is a probability space \( (\Omega, \mathcal{F}, P) \), where \( \Omega \) is the sample space of outcomes, \( \mathcal{F} \) is a σ-algebra of events on which probabilities are defined, and \( P \) is the probability measure. A function \( X : \Omega \to \mathbb{R} \) is a random variable if it is measurable with respect to the Borel σ-algebra \( \mathcal{B} \) on the real line, meaning \( X^{-1}(B) \in \mathcal{F} \) for every \( B \in \mathcal{B} \).<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> More generally, any measurable mapping \( X : \Omega \to S \) into a state space \( S \) equipped with a σ-algebra qualifies, which covers random variables taking vector, complex, or function values.<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup>

Measurability is what makes probabilities of statements about \( X \) well defined: for every [Borel set](https://www.edgepedia.org/borel-set) \( B \), the event \( \{\omega \in \Omega : X(\omega) \in B\} \) is measurable, so \( P(X \in B) \) exists.<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> Because the Borel σ-algebra is generated by intervals, it is enough to check sets of the form \( X^{-1}((-\infty, b]) \), or equivalently \( X^{-1}((a,b)) \), or \( X^{-1}([a,b]) \), for all \( a < b \).<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> Introductory texts often state the condition exactly this way: \( \{X < a\} \in \mathcal{F} \) for every real \( a \), from which measurability of \( \{X = a\} \), \( \{X > a\} \), and interval events follows.<sup>[6](https://www.math.cmu.edu/~gautam/c/2026-425/notes/probability-spaces.html)</sup>

When a particular outcome \( \omega \) is observed, the number \( X(\omega) \) is called a realization of the random variable.<sup>[6](https://www.math.cmu.edu/~gautam/c/2026-425/notes/probability-spaces.html)</sup> Some advanced treatments go one step further and define a random variable as an equivalence class of measurable functions, where two functions are equivalent if they agree with probability one; sums, products, and limits are then well defined on these classes, independent of the chosen representative.<sup>[7](https://www.tamuz.caltech.edu/teaching/ma144a/lectures.pdf)</sup>

## Distribution and law

The probability distribution, or law, of a random variable \( X : \Omega \to S \) is the measure \( \mu \) on \( (S, \mathcal{A}) \) defined by \( \mu(A) = P(\{\omega : X(\omega) \in A\}) \); it is the pushforward of \( P \) under \( X \) and is itself a probability measure.<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> The law captures everything about \( X \) that probability theory uses: all statistical properties of \( X \) can be determined from the distribution without any knowledge of the underlying sample space.<sup>[6](https://www.math.cmu.edu/~gautam/c/2026-425/notes/probability-spaces.html)</sup> This is why the sample space \( \Omega \) usually plays a minor role in applications.<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup>

For real-valued \( X \), the law is described by the cumulative distribution function \( F(x) = P(X \le x) = \mu((-\infty, x]) \), which exists for every real-valued random variable.<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> Every distribution function is monotonically non-decreasing, right-continuous, and satisfies \( \lim_{x \to \infty} F_X(x) = 1 \) and \( \lim_{x \to -\infty} F_X(x) = 0 \).<sup>[4](https://cni.iisc.ac.in/courses/random/Probability%20Foundations/lecture-04.html)</sup>

## Discrete and continuous random variables

A random variable whose range is countable is called discrete. It is completely specified by its probability mass function \( p_X(x) = P(X = x) \), and any discrete random variable can be written as a linear combination of indicator functions over a partition of the sample space.<sup>[4](https://cni.iisc.ac.in/courses/random/Probability%20Foundations/lecture-04.html)</sup> A discrete random variable with finite range is called simple.<sup>[4](https://cni.iisc.ac.in/courses/random/Probability%20Foundations/lecture-04.html)</sup>

A random variable is called continuous when its law admits a density \( f_X : \mathbb{R} \to [0, \infty) \) such that \( P_X(B) = \int_B f_X(x)\,dx \) for every Borel set \( B \).<sup>[4](https://cni.iisc.ac.in/courses/random/Probability%20Foundations/lecture-04.html)</sup><sup> • </sup><sup>[5](https://encyclopediaofmath.org/wiki/Random_variable)</sup> The Gaussian (normal) random variable is the standard example, with the bell-shaped density \( f(t;\mu,\sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left\{ \frac{-(t-\mu)^2}{2\sigma^2} \right\} \).<sup>[2](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L01_randomvariables.html)</sup>

Standard examples illustrate both kinds. On the space of \( n \) coin tosses with the uniform measure, the indicator of the first toss is a Bernoulli-type variable with law \( \frac{1}{2}\delta_0 + \frac{1}{2}\delta_1 \), and the number of tails \( X(\omega) = \omega_1 + \cdots + \omega_n \) follows the binomial distribution \( B(n, 1/2) \) with \( P(X = k) = \binom{n}{k} 2^{-n} \).<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup> On \( \Omega = [0,1] \) with [Lebesgue measure](https://www.edgepedia.org/lebesgue-measure), the identity map \( U(\omega) = \omega \) is uniformly distributed, with \( P(U \le a) = a \).<sup>[3](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)</sup>

## Operations and structure

Measurable real-valued functions form a vector space: scalar multiples \( \lambda f \) and sums \( f_1 + f_2 \) of measurable functions are measurable, and composing a measurable \( f \) with a measurable \( g : \mathbb{R} \to \mathbb{R} \) again gives a measurable function, so \( g \circ f \) is a random variable whenever \( f \) is.<sup>[7](https://www.tamuz.caltech.edu/teaching/ma144a/lectures.pdf)</sup> Limits behave well too: for a sequence of measurable functions bounded between 0 and 1, the pointwise infimum, the limit inferior, and even the set of outcomes where the limit exists are all measurable.<sup>[7](https://www.tamuz.caltech.edu/teaching/ma144a/lectures.pdf)</sup> These closure properties are what allow expectation, defined as the Lebesgue integral of \( X \) with respect to \( P \), and the whole apparatus of sums, variances, and covariances to be applied to random variables.<sup>[8](https://doi.org/10.3390/math13050867)</sup>

One structural point matters in practice: two random variables defined on different probability spaces have no joint distribution, and an expression like \( X + Y \) is then meaningless. Placing them on a common space, a construction called coupling, makes joint statements possible; a coupling of \( X \) and \( Y \) is a pair \( (X', Y') \) on one space with the same marginal laws.<sup>[9](https://tsoo-math.github.io/ucl/coupling-rev.html)</sup>

## History

The role of random variables and their expectations was clearly established by Pafnuty Chebyshev, who in 1867 published *On mean values*, using Bienaymé's inequality to give a generalized law of large numbers; Kolmogorov later wrote that Chebyshev was the first to estimate clearly and make use of such notions as "random quantity" and its "expectation (mean) value".<sup>[10](https://mathshistory.st-andrews.ac.uk//Biographies/Chebyshev/)</sup> The recognition that a random variable is a special case of a measurable function came much later. A full exposition of probability in a measure-theoretic setting, free of superfluous restrictions, was first given by [Andrey Kolmogorov](https://www.edgepedia.org/andrey-kolmogorov) in his 1933 monograph *Grundbegriffe der Wahrscheinlichkeitsrechnung* (*Foundations of the Theory of Probability*), which made explicit that a random variable is nothing but a measurable function on a probability space; W. Feller later adopted this point of view in the academic literature.<sup>[5](https://encyclopediaofmath.org/wiki/Random_variable)</sup> Kolmogorov's triple \( (E, \mathcal{F}, P) \) is the framework every modern textbook opens with, and his preface noted that after Lebesgue's work the analogy between the integral of a function and the mathematical expectation of a random variable had become clear.<sup>[11](https://jovanaeducation.com/library/kolmogorov-1933)</sup>

## Applications

Modeling a quantity of interest as a random variable is standard far beyond mathematics. In metrology, NIST characterizes the uncertainty surrounding an estimate of a property, such as the mass fraction of tellurium in a reference solution, by assigning the property a probability distribution as an attribute; this does not mean the property varies unpredictably, only that the distribution describes how well its true value is known. For one NIST reference material, the assigned distribution is a rescaled and shifted Student's \( t \) distribution with 12.7 degrees of freedom, mean 10.011 mg/g, and standard deviation 0.01755 mg/g.<sup>[12](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.260-202.pdf)</sup> Software tools such as the NIST Uncertainty Machine evaluate measurement uncertainty for output quantities \( y = f(x_0, \ldots, x_n) \) by modeling the input and output quantities as random variables whose probability distributions characterize the uncertainty.<sup>[13](https://uncertainty.nist.gov/?example=Voltage)</sup> In engineering reliability, functions of random variables underlie the analysis of wave loads in a random sea and the probability of combinations of events in system reliability.<sup>[14](https://ocw.mit.edu/courses/1-010-uncertainty-in-engineering-fall-2008/pages/application-examples/)</sup>

## References

1. [Random Variables and Distributions, youyuanwu.github.io](https://youyuanwu.github.io/misc-docs/math/11-probability/02-random-variables.html)
2. [STAT340 Lecture 01: Random Variables, UW–Madison](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L01_randomvariables.html)
3. [Advanced Probability lecture notes, University of Vienna](https://www.mat.univie.ac.at/~mathias/Advanced_Probability.pdf)
4. [Random Variable – Probability and Random Processes, IISc](https://cni.iisc.ac.in/courses/random/Probability%20Foundations/lecture-04.html)
5. [Random variable, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Random_variable)
6. [Probability spaces and Random Variables, Carnegie Mellon University](https://www.math.cmu.edu/~gautam/c/2026-425/notes/probability-spaces.html)
7. [Lecture Notes on Probability, Caltech MA144A](https://www.tamuz.caltech.edu/teaching/ma144a/lectures.pdf)
8. [The Heroic Age of Probability: Kolmogorov, Doob, Lévy, Khinchin and Feller, Mathematics (MDPI)](https://doi.org/10.3390/math13050867)
9. [You always knew and did coupling, UCL](https://tsoo-math.github.io/ucl/coupling-rev.html)
10. [Pafnuty Chebyshev (1821–1894), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk//Biographies/Chebyshev/)
11. [Kolmogorov: Foundations of the Theory of Probability (1933), JOVANA Education](https://jovanaeducation.com/library/kolmogorov-1933)
12. [Evaluating, Expressing, and Propagating Measurement Uncertainty for NIST Reference Materials, NIST SP 260-202](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.260-202.pdf)
13. [NIST Uncertainty Machine](https://uncertainty.nist.gov/?example=Voltage)
14. [Application Examples, Uncertainty in Engineering, MIT OpenCourseWare](https://ocw.mit.edu/courses/1-010-uncertainty-in-engineering-fall-2008/pages/application-examples/)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Statistics and probability › Probability theory › Random variables › Algebra and transformations of random variables › Algebra of random variables (overview)*

*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
