Skip to main content

Random variable

Author
Affiliation

Department of Economics, University of Houston

Published

November 30, 2026

Part of Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics.
Main Stam4Econ site | View this section in the book | Author: Fan Wang | DOI: 10.5281/zenodo.24696926
Date: 2026-11-30 | HTML | PDF | QMD

1 Random variable

1.1 A function assigning real values to experiment outcomes in the sample space

The probability measure maps events in the sigma-algebra \(\mathcal{F}\) to \([0,1]\). A random variable instead maps outcomes in the sample space to the real line and must be measurable: the inverse image of every Borel set must belong to \(\mathcal{F}\).

A random variable “is a real-valued outcome: a function from the sample space \(\Omega\) to the real line \(R\)”:

\[ X: (\Omega,\mathcal{F}) \rightarrow (\mathbb{R},\mathcal{B}(\mathbb{R})) \]

Suppose the sample space is \(\Omega=\{H,T\}\). Let \(\omega\in\Omega\) denote an outcome. For example, define the random variable \(X\) by:

\[ X(\omega=H) = 1 \text{ and } X(\omega =T) = 0 \]

where we assign experiment outcome \(H\) to the value \(1\), and experiment outcome \(T\) to the value \(0\). Note that what is in the sample place are like “indexes”, there are no “variables”/values associated with them yet, it’s just a collection of name tags. It is through the random variable that we assign values to these name tags.

We can also define another random variable \(Y\) as:

\[ Y(\omega = H) = 0 \text{ and } Y(\omega = T) = 100 \]

where now 0 represents 0 dollars, and 100 represents 100 dollars that you win if the coin lands on tails.

1.2 Probability function and random variable

But where is the “random” part? The random variable itself does not introduce any “randomness”/probability, it just gives real values to the elements in the sample space. The randomness comes from the probability function defined over the sigma algebra of the sample space.

Suppose we have a probability function \(P\) defined over the power set of the sample space, \(\mathcal{P}(S)\), such that:

\[ P({H}) = 0.5, P({T}) = 0.5 \]

Then we can say the probability that the random variable \(Y\) takes on the value 100 is:

\[ P\left(Y^{-1}\left(\{100\}\right)\right) = P\left(\left\{ T \right\}\right) = 0.50 \]

More generally, for any Borel set \(B\subseteq\mathbb{R}\), we can write

\[ P_X(B)=P\left(X^{-1}(B)\right) =P\left(\left\{\omega\in\Omega\mid X(\omega)\in B\right\}\right). \]

1.3 Discrete vs continuous random variable

A discrete random variable takes at most countably many values. An absolutely continuous random variable has a density and no point masses; height and weight are often modeled this way. An uncountable set of possible values alone does not guarantee absolute continuity, and distributions can also be neither discrete nor absolutely continuous.

The support of a distribution is the set of points for which every open neighborhood has positive probability. It need not be the set of points with positive density, and individual points in the support of an absolutely continuous distribution can have probability zero.