Skip to content

Random Variable

Definition

Let SS be a sample space. A random variable is a function X ⁣:S→RX\colon S\to\mathbb{R} that assigns a real number to each outcome in SS, subject to the measurability condition that {ω∈S ⁣:X(ω)≤x}\{\omega\in S\colon X(\omega)\le x\} is an event for every x∈Rx\in\mathbb{R}.


Interpretation

A random variable attaches a number to every outcome of an experiment. Once outcomes are numbers, probability questions can be asked about values and ranges of values, and answered with functions and distributions.

The four outcomes of two coin tosses, with arrows to the number of heads, 0, 1 or 2, on a number line.

The diagram counts heads in two independent fair coin tosses: X(HH)=2X(HH)=2, X(HT)=X(TH)=1X(HT)=X(TH)=1 and X(TT)=0X(TT)=0. Two outcomes are sent to the same value 11, which is allowed for a function. Each outcome has probability 14\tfrac{1}{4}, so P(X=1)=P({HT,TH})=12\mathbb{P}(X=1)=\mathbb{P}(\{HT,TH\})=\tfrac{1}{2} and P(X=0)=P(X=2)=14\mathbb{P}(X=0)=\mathbb{P}(X=2)=\tfrac{1}{4}.

The usual notation hides the outcome: {X≤x}\{X\le x\} is shorthand for the event {ω∈S ⁣:X(ω)≤x}\{\omega\in S\colon X(\omega)\le x\}. The condition in the Definition asks exactly that these sets are events, so that they have probabilities. On a finite sample space in which every subset is an event, the condition holds automatically and every function S→RS\to\mathbb{R} is a random variable.

Several random variables can live on the same sample space; in the coin example, the number of tails 2−X2-X is another one. Indicators, sums and functions of a random variable build new random variables from old ones, and the CDF FX(x)=P(X≤x)F_X(x)=\mathbb{P}(X\le x) collects the probabilities of the events in the Definition.

Despite its name, a random variable is neither random nor an unknown: it is a fixed function. The randomness lies in which outcome ω\omega occurs, and X(ω)X(\omega) is a number once ω\omega is known.


Key Results

  • A random variable is a function from outcomes to real numbers.
  • Random variables generate events such as threshold events.
  • The distribution of a random variable describes probabilities of its numerical values or ranges.

Examples

  • For a die roll, the displayed face is a random variable.
  • For a customer order, the order value is a random variable.
  • For a machine, the time until failure is a random variable.

Prerequisites

Sources

Aliases: stochastic variable, r.v., RV Keywords: random variate, real-valued random variable, random quantity Symbols: element of, omega, real numbers

Last updated: 20 October 2026 03:02