Skip to content
AI360Xpert
Beta

Random Variables as Measurable Functions

Random variables are functions from outcomes to numbers whose level sets are events, so every threshold has a probability.

A random variable pulls numbers back to events: preimages of intervals must land inside the event algebra
A random variable pulls numbers back to events: preimages of intervals must land inside the event algebra

Why Does This Exist?

Notation like P(X>3)P(X > 3) hides a question: what set has probability here? The answer is a preimage {ω:X(ω)>3}\{\omega : X(\omega) > 3\}, and it must be an event before PP can touch it. Without measurability, thresholds have no probabilities.

Defining XX as a measurable map X:Ω→RX: \Omega \to \mathbb{R} makes every Borel threshold an event. Distributions, expectations and limits then inherit measure theory for free.

This page gives the definition and the distribution it induces. Event structure is in measure spaces and working distributions in probability distributions.

The one idea you need first

For X:Ω→RX: \Omega \to \mathbb{R} and B⊂RB \subset \mathbb{R}, the preimage is X−1(B)={ω:X(ω)∈B}X^{-1}(B) = \{\omega : X(\omega) \in B\}. Measurability demands X−1(B)∈FX^{-1}(B) \in \mathcal{F} for every Borel BB.

Think of It Like This

A thermometer with labelled zones

Outcomes are weather states. The thermometer XX assigns each state a number. Asking for P(X>30)P(X > 30) collects all states whose readings land in the hot zone and measures that collection.

The zone must be a recognized event; otherwise the question is malformed. Where the analogy stops: thermometers are continuous by physics, while random variables need only measurability, so jumps and thresholds are allowed.

How It Actually Works

XX is a random variable when X−1(B)∈FX^{-1}(B) \in \mathcal{F} for all Borel BB. Its distribution is PX(B)=P(X−1(B))P_X(B) = P(X^{-1}(B)). Its CDF is F(x)=P(X≤x)F(x) = P(X \le x). Expectation is E[X]=∫X dP\mathbb{E}[X] = \int X \, dP when ∫∣X∣ dP<∞\int |X| \, dP < \infty.

Discrete XX takes countable values with ∑P(X=xk)=1\sum P(X = x_k) = 1. Continuous XX has a density pp with P(X∈B)=∫Bp(x) dxP(X \in B) = \int_B p(x) \, dx.

Worked example

Two fair coin flips: Ω={HH,HT,TH,TT}\Omega = \{HH, HT, TH, TT\}, XX counts heads. Values: 2,1,1,02, 1, 1, 0. Then P(X=1)=2/4=0.5P(X = 1) = 2/4 = 0.5, P(X≥1)=3/4=0.75P(X \ge 1) = 3/4 = 0.75. Preimage {X≥1}={HH,HT,TH}\{X \ge 1\} = \{HH, HT, TH\} is an event. Expectation E[X]=2×0.25+1×0.5+0×0.25=1.0\mathbb{E}[X] = 2 \times 0.25 + 1 \times 0.5 + 0 \times 0.25 = 1.0.

Watch Out For

Treating every function of outcomes as a random variable

Symptom: defining XX via choice on non-measurable sets, then P(X>0)P(X > 0) has no value and simulations disagree with theory. Fix: build XX from continuous pieces, limits and arithmetic on measurable maps, which preserve measurability.

Confusing the variable with its distribution

Symptom: "two variables are equal" claimed from equal histograms, while couplings and joint behaviour differ. Fix: equality in distribution is PX=PYP_X = P_Y; almost-sure equality is P(X=Y)=1P(X = Y) = 1 and is strictly stronger.

The Quick Version

  • A random variable is a measurable function whose threshold preimages are events.
  • Its distribution pushes PP forward onto numbers via PX(B)=P(X−1(B))P_X(B) = P(X^{-1}(B)).
  • Discrete sums and continuous densities are two readings of the same definition.
  • Two flips counting heads gives P(X=1)=0.5P(X = 1) = 0.5 and mean 1.01.0.
  • Equality in law is weaker than almost-sure equality.