From Outcomes to Numbers
A probability model begins with possible outcomes. A statistical question often asks us to summarize an outcome with a number: the number of heads, the sum shown on two dice, or a measured time. A random variable formalizes that step. It is a function that assigns a real number to every outcome in the model.
Three objects must be kept distinct. The outcome is an element of the sample space. The random variable is the function defined on the sample space. The realized value is the particular number the function assigns to a particular outcome. For an outcome \(\omega\), that number is written \(X(\omega)\).
Definition and Measurability
To define a random variable precisely, start with a probability space \((\Omega,\mathcal{F},P)\). Here \(\Omega\) is the sample space, \(\mathcal{F}\) is a sigma-algebra of events, and \(P\) assigns probabilities to events in \(\mathcal{F}\). The Borel sigma-algebra on the real line, written \(\mathcal{B}(\mathbb{R})\), is the collection of sets generated by open subsets of \(\mathbb{R}\).
Measurability matters because probabilities are assigned to events, not directly to arbitrary collections of outcomes. The condition ensures that statements such as “the value of \(X\) lies in \(B\)” describe events to which the model assigns probabilities. In particular, \(X^{-1}(B)\) is the event that \(X\) takes a value in \(B\).
Worked Example: A Coin-Toss Indicator
A coin is tossed once. Let \(\Omega=\{H,T\}\), let \(\mathcal{F}\) contain every subset of \(\Omega\), and assign probability \(1/2\) to each outcome. Define \(X\) by \(X(H)=1\) and \(X(T)=0\).
The random variable is the whole function \(X\), not either of its numerical outputs. If the observed outcome is \(H\), then the realized value is \(X(H)=1\). If the outcome is \(T\), the realized value is \(X(T)=0\).
For example, take \(B=(1/2,2)\). The only value of \(X\) in \(B\) is 1, so $$ X^{-1}(B)=\{\omega:X(\omega)\in(1/2,2)\}=\{H\}. $$ This is an event because every subset of \(\Omega\) belongs to \(\mathcal{F}\). The example illustrates the roles of the objects: \(H\) is an outcome, \(X\) is a function, and 1 is its realized value at \(H\).
Worked Example: A Sum from Two Dice
Roll two six-sided dice and record the ordered pair. Let \(\Omega=\{1,\ldots,6\}\times\{1,\ldots,6\}\), with every subset measurable. Define \(X(i,j)=i+j\).
If the observed outcome is \(\omega=(2,5)\), then \(X(\omega)=X(2,5)=7\). The outcome is the pair \((2,5)\), while 7 is the value assigned to that pair; the random variable is the sum function on the entire sample space.
Different outcomes can produce the same realized value. In this model, $$ X^{-1}(\{7\})=\{(1,6),(2,5),(3,4),(4,3),(5,2),(6,1)\}. $$ Thus, learning that \(X\) equals 7 does not identify a unique outcome. It identifies the event consisting of all six listed outcomes.
Measurability in Common Models
In a finite or countable model with \(\mathcal{F}=2^\Omega\), every real-valued function on \(\Omega\) is a random variable. For any function \(X:\Omega\to\mathbb{R}\) and any Borel set \(B\), its inverse image \(X^{-1}(B)\) is some subset of \(\Omega\). Since every subset belongs to \(2^\Omega\), the inverse image is measurable. No additional restriction on the function is needed.
The qualification about \(\mathcal{F}\) is important. A sample space alone does not specify which sets are events. If the sigma-algebra is smaller than \(2^\Omega\), an inverse image might fail to be an event, so an arbitrary real-valued function need not be a random variable.
Worked Example: A Function on a Continuous Sample Space
Let \(\Omega=[0,1]\), let \(\mathcal{F}\) be the Borel sets of \([0,1]\), and let \(P\) be the uniform probability measure on this interval. Define \(X(\omega)=\omega^2\).
This function is measurable. To check the condition, first take an open set \(U\subseteq\mathbb{R}\). The function \(\omega\mapsto\omega^2\) is continuous, so \(X^{-1}(U)\) is open relative to \([0,1]\), and therefore belongs to \(\mathcal{F}\). The collection of sets \(B\) for which \(X^{-1}(B)\in\mathcal{F}\) is a sigma-algebra: inverse images preserve complements and countable unions. Since it contains every open set, it contains every Borel set. Thus \(X\) is measurable.
For the particular outcome \(\omega=0.6\), the realized value is \(X(0.6)=0.36\). For \(B=(0.09,0.49]\), solving \(0.09<\omega^2\leq0.49\) with \(0\leq\omega\leq1\) gives $$ X^{-1}(B)=(0.3,0.7]. $$ The interval is an event in \(\mathcal{F}\). Notice again that an outcome such as \(0.6\), the function \(X\), and the number \(0.36\) are different things.
Two Basic Results
Proof. Let \(B\) be any Borel subset of \(\mathbb{R}\). The inverse image \(X^{-1}(B)\) is a subset of \(\Omega\), regardless of how \(X\) is defined. Because \(\mathcal{F}=2^\Omega\), every subset of \(\Omega\) belongs to \(\mathcal{F}\). Hence \(X^{-1}(B)\in\mathcal{F}\) for every Borel \(B\), which is exactly the measurability condition. \(\square\)
Measurability also behaves well when a random variable is transformed by a measurable real-valued function. This lets us define new numerical summaries of an existing random variable without losing the event structure required by probability.
Proof. Let \(B\) be any Borel subset of \(\mathbb{R}\). By the definition of \(Y\), $$ Y^{-1}(B)=\{\omega:g(X(\omega))\in B\} =X^{-1}\bigl(g^{-1}(B)\bigr). $$ Because \(g\) is Borel measurable, \(g^{-1}(B)\) is a Borel set in \(\mathbb{R}\). Because \(X\) is a random variable, the inverse image under \(X\) of every Borel set belongs to \(\mathcal{F}\). Therefore \(X^{-1}(g^{-1}(B))\in\mathcal{F}\), so \(Y^{-1}(B)\in\mathcal{F}\). This holds for every Borel \(B\), proving that \(Y\) is measurable. \(\square\)
Worked Example: Transforming a Coin-Toss Variable
Return to the coin model and its variable \(X(H)=1\), \(X(T)=0\). Define \(g(x)=2x+3\), a continuous and therefore Borel measurable function, and set \(Y=g(X)\).
The values are \(Y(H)=2(1)+3=5\) and \(Y(T)=2(0)+3=3\). For example, if \(B=(4,6)\), then \(g^{-1}(B)=(1/2,3/2)\), and $$ Y^{-1}(B)=X^{-1}\bigl((1/2,3/2)\bigr)=\{H\}. $$ The new function is measurable, as the result guarantees. The outcome \(H\), the original function \(X\), its value \(X(H)=1\), the transformed function \(Y\), and the transformed value \(Y(H)=5\) remain distinct objects.
Common Mistake and Why the Definition Matters
A common mistake is to say, “The random variable is 7,” after two dice show a sum of 7. That confuses a realized value with the function. The correction is to say: the random variable is the sum function \(X(i,j)=i+j\); for the observed outcome \((2,5)\), its realized value is \(X(2,5)=7\). Other outcomes can give that same value.
Another mistake is to assume that any numerical rule automatically qualifies as a random variable. A rule must be defined on the sample space and satisfy the measurability condition relative to the chosen sigma-algebras. In the common finite model where every subset is an event, measurability follows automatically. In more general spaces, it is a genuine condition.
This distinction is foundational: probability statements about a numerical quantity are made through the events formed by inverse images. Keeping the function, outcome, and value separate prevents ambiguity about what has been observed and what event is being considered.
Check Your Understanding
Answer each question by identifying the relevant function, outcome, value, or event.
- In the two-dice model, what is the outcome when the first die shows 4 and the second shows 2? What is the realized value of the sum variable?
- For the coin indicator \(X(H)=1\), \(X(T)=0\), write \(X^{-1}(\{0\})\). What does this set represent?
- Why is every real-valued function measurable when the sigma-algebra on a finite sample space is its power set?
- If \(X\) is a random variable and \(g\) is Borel measurable, what identity connects \((g(X))^{-1}(B)\) to an inverse image under \(X\)?
- Explain why saying “the random variable is 0.36” is not precise in the example \(X(\omega)=\omega^2\).