Random Variables, and Distributions
Last modified — 23 May 2026
By the end of this lecture, students are anticipated to be able to:
Random variable: a function from the sample space to a subset of the real numbers.
Therefore, a the random variable called \(X\) is any function
\[X \, : \, \Omega \ \rightarrow {\mathbb{R}}.\]
That is, for each \(\omega \in \Omega\),
\[X( \omega ) \in {\mathbb{R}}.\]
Suppose we toss a coin 3 times.
Let \(X( \omega )=\) number of heads in \(\omega\).
If \(\omega = (HHH), X(\omega)\) = .
If \(\omega = (HHT), (HTH),\) or \((THH), X(\omega) =\).
… and so on
We can summarize this as:
Suppose it can either be raining, snowy, or sunny.
Let \(X = 3\) if its raining, \(X\) = 6 if it snows, and \(X\) = -2.7 if it’s sunny.
Is \(X\) a random variable?
Let \(\Omega = \{1,2,3,4,5,6\}\). Let \(X(\omega) = \omega\) and \(Y(\omega) = \omega^3 + 2\).
Compute \(Z(\omega)\) for all \(\omega \in \Omega\) where \(Z = XY\).
\[\Bigl\{ X > 3 \Bigr\} \, = \, \Bigl\{ \omega \in \Omega \, : \, X \left( \omega \right) > 3 \Bigr\},\]
and
\[\Bigl\{ Y \le 2 \Bigr\} \, = \, \Bigl\{ \omega \in \Omega \, : \, Y \left( \omega \right) \le 2 \Bigr\}.\]
In other words, \(\Bigl\{ X > 3 \Bigr\}\) and \(\Bigl\{ Y \le 2 \Bigr\}\) are events.
The indicator function is a useful mathematical shorthand.
It is also a random variable: it is a function from \(\Omega \to {\mathbb{R}}\).
The indicator of the event \(A\) is the random variable given by \[ I_A(\omega) = \begin{cases} 1 & \omega \in A\\ 0 & \text{else}.\end{cases} \]
Let \[ A = (1,2,3,4,5,6) \] \(I_A(5)\) = 1 because 5 is in the set A.
\(I_A(9)\) = 0 because 9 is not in the set A.
Consider a 6-sided fair die, where \(\Omega = \{1,2,3,4,5,6\}\)
What is \(Y = X + I_{\{6\}}\).?
Let \(A\) and \(B\) be events, and let \(X = I_A \times I_B\). Is \(X\) an indicator function? If so, of what event?
A probability associates each \(\omega \in \Omega\) with a number between 0 and 1 and satisfies the Probability axioms.
Random variables also operate on \(\Omega\). Taking these together induces a probability on \({\mathbb{R}}\).
Suppose we flip a fair coin with \(\Omega = \{H, T\}\), and we know that \(\mathbb{P}(H) = \mathbb{P}(T) = 0.5\).
Then, considering the RV \(I_H\), we see \(\mathbb{P}(I_H =1) = \mathbb{P}(\{\omega : I_H(\omega) = 1\}) = \mathbb{P}(H)\)
Distribution: If \(X\) is a random variable, then the distribution of \(X\) is the collection of probabilities \(\mathbb{P}(X \in B)\) for all subsets \(B\) of \({\mathbb{R}}\).
Consider \(\Omega = \{H, T\}\), and \(\mathbb{P}(H) = \mathbb{P}(T) = 0.5\)
This defines \(\mathbb{P}\) on all subsets \(2^\Omega = \{\varnothing, \{T\}, \{H\}, \Omega\}\).
But considering a random variable \(X\), it isn’t really enough to know it’s probability only on it’s range.
We need to know more than that: we need to know, for every \(B \subset {\mathbb{R}}\), what is \(\mathbb{P}(X \in B) = \mathbb{P}(\{s\in\Omega : X(s) \in B\})\).
To fully specify the distribution, we need to do this for every (nice) subset \(B\). The collection of these subsets is denoted \(\mathcal{B}\).
The mathematical details are at least at the level of Math 420.
Consider shuffling a deck of 50 Pokemon cards where 20 are grass-type (\(G\)), 13 are fighting-type (\(F\)), 7 are water-type (\(W\)), and 10 are electric-type (\(E\)). Professor Grace really likes the grass and water types.
Consider the random variable \(Z\), which indicates if Grace will really like the card chosen. Compute \(\mathbb{P}(Z = z)\) for any \(z\).
Stat 302 - Winter 2025/26