From Outcomes to Values
A random variable turns outcomes in a sample space into real numbers. Once that mapping is specified, questions about its possible values become probability questions about the original outcomes. For instance, asking whether a random variable falls between 1 and 2 means asking which outcomes produce values in that range.
The key operation is the inverse image: collect every outcome whose random-variable value belongs to the set of interest. Its probability is the probability that the random variable takes a value in that set. This construction defines the distribution of the random variable, whether the sample space is finite, countable, or continuous.
A Borel set is any set in the sigma-algebra generated by the open intervals of the real line; intervals such as \([a,b]\), \((a,b]\), and \((-\infty,a]\) are Borel sets. The measurability condition ensures that the inverse image of each such set is a legitimate event in the original probability model.
There are two different spaces in this definition. The set \(B\) is a set of possible values of \(X\), while \(X^{-1}(B)\) is a set of outcomes in \(\Omega\). The notation \(P(X\in B)\) is shorthand for the probability of that outcome event; it does not mean that \(B\) itself is a subset of the sample space.
Why the Induced Assignment Is a Probability Law
The definition does more than name probabilities of particular ranges. It gives a valid probability measure on the real line. The proof follows from how inverse images behave under set operations.
Proof. First, \(X^{-1}(\mathbb R)=\Omega\), since every value \(X(\omega)\) is real. Therefore $$ P_X(\mathbb R)=P(\Omega)=1. $$ For any Borel set \(B\), \(P_X(B)\geq 0\) because it is the probability of the event \(X^{-1}(B)\).
Now let \(B_1,B_2,\ldots\) be pairwise disjoint Borel sets. An outcome belongs to \(X^{-1}(\bigcup_{j=1}^{\infty}B_j)\) exactly when its value under \(X\) belongs to at least one of the sets \(B_j\). Thus $$ X^{-1}\left(\bigcup_{j=1}^{\infty}B_j\right) = \bigcup_{j=1}^{\infty}X^{-1}(B_j). $$ These inverse images are pairwise disjoint: if an outcome belonged to both \(X^{-1}(B_i)\) and \(X^{-1}(B_j)\), its value would belong to both \(B_i\) and \(B_j\), contrary to disjointness when \(i\ne j\). Countable additivity of \(P\) now gives $$ P_X\left(\bigcup_{j=1}^{\infty}B_j\right) =P\left(\bigcup_{j=1}^{\infty}X^{-1}(B_j)\right) =\sum_{j=1}^{\infty}P(X^{-1}(B_j)) =\sum_{j=1}^{\infty}P_X(B_j). $$ The assignment is therefore a probability measure. \(\square\)
Range Events and Their Inverse Images
For an interval of values, the calculation has a direct interpretation: find all outcomes whose \(X\)-values lie in that interval, then add or otherwise calculate their probabilities under the original model. The endpoints must be carried through exactly. For example, \(X\in[a,b]\) and \(X\in(a,b]\) are different events if \(X\) can equal \(a\).
A useful general identity follows when a random variable is itself defined by transforming another one. If \(Y:\Omega\to\mathbb R\) is a random variable and \(g:\mathbb R\to\mathbb R\) is a Borel-measurable function, set \(X=g(Y)\). For every Borel set \(B\), $$ \{X\in B\}=\{g(Y)\in B\}=\{Y\in g^{-1}(B)\}. $$ The equality holds outcome by outcome: \(\omega\) belongs to the first event exactly when \(g(Y(\omega))\in B\), which is exactly when \(Y(\omega)\in g^{-1}(B)\). Consequently, $$ P(X\in B)=P(Y\in g^{-1}(B)). $$ In range calculations, this means that one can transform the set of values back through \(g\), then evaluate the probability for \(Y\).
Worked Example: A Function of a Fair Die
Let \(D\) be the result of a fair six-sided die, so \(P(D=d)=1/6\) for \(d=1,\ldots,6\). Define \(X=|D-3.5|\). Find the probabilities that \(X\in[1,2]\) and that \(X>2\).
The values of \(X\), listed by die outcome, are $$ \begin{array}{c|cccccc} D&1&2&3&4&5&6\\ \hline X&2.5&1.5&0.5&0.5&1.5&2.5 \end{array} $$ For \(X\in[1,2]\), the qualifying values are 1.5, produced by outcomes \(D=2\) and \(D=5\). The endpoints 1 and 2 do not happen to be values of \(X\), but the event includes every value between them. Thus $$ \{X\in[1,2]\}=\{D=2,D=5\}, \qquad P(X\in[1,2])=\frac16+\frac16=\frac13. $$ For \(X>2\), the qualifying outcomes are \(D=1\) and \(D=6\), each producing 2.5. Therefore $$ P(X>2)=P(D=1)+P(D=6)=\frac16+\frac16=\frac13. $$ Each distinct value of \(X\) can arise from more than one die outcome. Its probability is found by adding the probabilities of all outcomes in its inverse image.
Worked Example: Counting Heads in Two Tosses
Two fair coins are tossed. The sample space is \(\Omega=\{HH,HT,TH,TT\}\), with probability \(1/4\) for each outcome. Let \(X\) be the number of heads. Calculate \(P(X\in[1,2])\) and \(P(X=1)\).
The map from outcomes to values is \(X(HH)=2\), \(X(HT)=1\), \(X(TH)=1\), and \(X(TT)=0\). Hence the inverse image of \([1,2]\) is \(\{HH,HT,TH\}\), so $$ P(X\in[1,2])=P(HH)+P(HT)+P(TH)=\frac14+\frac14+\frac14=\frac34. $$ The inverse image of the single value set \(\{1\}\) is \(\{HT,TH\}\). Therefore $$ P(X=1)=P(X\in\{1\})=\frac14+\frac14=\frac12. $$ The value 1 has probability \(1/2\), not \(1/4\), because two distinct outcomes produce it.
Worked Example: Squaring a Uniform Random Variable
Let \(U\) be uniformly distributed on \((0,1)\), meaning that the probability of an interval within \((0,1)\) is its length. Define \(X=U^2\). Find \(P(X\in[1/4,9/16])\).
Since \(U\) is positive, squaring preserves order on its possible values. Solving the range condition gives $$ \frac14\leq U^2\leq\frac{9}{16} \quad\Longleftrightarrow\quad \frac12\leq U\leq\frac34. $$ Thus the inverse image is \([1/2,3/4]\), and its length is \(3/4-1/2=1/4\). It follows that $$ P(X\in[1/4,9/16])=P(U\in[1/2,3/4])=\frac14. $$ Both endpoints are retained when finding the inverse image. In this continuous uniform model, including or excluding either single endpoint does not change the probability, because a single point has probability zero; that fact does not make the corresponding events identical.
What the Distribution Records
The distribution of \(X\) is a probability assignment on value sets, not a list of outcomes in \(\Omega\). Different random variables, possibly defined on different probability spaces, can have the same distribution if they assign the same probability to every Borel set. Conversely, knowing only the set of possible values of a random variable does not determine its distribution: probabilities matter as well.
For a variable with finitely many possible values \(x_1,\ldots,x_k\), its probabilities at individual values are obtained by taking inverse images: $$ P(X=x_i)=P(\{\omega:X(\omega)=x_i\}). $$ For any set \(B\) of those values, the event \(X\in B\) is the union of the events \(X=x_i\) for values \(x_i\in B\). Those events are disjoint, so their probabilities add. This is why a range probability in a finite model can be calculated by listing the values in the range and summing their probabilities.
The same definition applies when the value set is not finite. In each case, the guiding question is unchanged: which outcomes map into the requested set of values? For a complicated range or transformation, finding that inverse image is often the main work.
Common Mistake: Counting Values Instead of Outcomes
A tempting but incorrect approach is to count how many different values lie in the requested range and divide by the number of possible values. That works only under special assumptions about the probabilities of those values. It is not a general rule. A value that can result from several equally likely outcomes may have more probability than a value produced by only one.
For the two-coin example, \(X\) can take the three values 0, 1, and 2. Counting values would incorrectly suggest that \(P(X=1)=1/3\). In fact, \(X=1\) occurs for both \(HT\) and \(TH\), giving probability \(2/4=1/2\). The correction is to identify the inverse image of the value set and calculate the probability of that event in the original model.
Check Your Understanding
For each question, begin by identifying the relevant inverse image.
- A fair die has outcomes \(1,\ldots,6\), and \(X\) is 1 when the result is even and 0 otherwise. What is \(P(X\in[0.5,1])\)?
- In the two-coin model, what is the inverse image of \((0,2]\) under the number-of-heads variable, and what is its probability?
- Suppose \(Y\) is uniformly distributed on \((0,1)\) and \(X=3Y\). Find the inverse image of \([1,2]\) and calculate \(P(X\in[1,2])\).
- Why can two different outcomes contributing the same value of \(X\) not be counted as just one equally likely value without checking their probabilities?
- In the definition of \(P_X(B)\), what is the difference between the set \(B\) and the event \(X^{-1}(B)\)?