|q⟩ Bad Qubits

beginner · Physics · Math Foundations: Calculus, Probability & Statistics

Random Variables

From outcomes to numbers

A sample space Ω\Omega is the set of all possible outcomes of an experiment. For a single coin flip, Ω={heads,tails}\Omega = \{\text{heads}, \text{tails}\}. For a six-sided die, Ω={1,2,3,4,5,6}\Omega = \{1, 2, 3, 4, 5, 6\}. Outcomes can be abstract labels — winning a game, finding a particle in a detector, measuring a spin component. What matters is that the elements of Ω\Omega are mutually exclusive and exhaustive.

A random variable XX is a function that assigns a real number to each outcome in the sample space:

X:ΩR.X : \Omega \to \mathbb{R}.

It converts qualitative or labeled outcomes into quantities we can do arithmetic with. Labeling the coin so that X(heads)=1X(\text{heads}) = 1 and X(tails)=0X(\text{tails}) = 0 turns an abstract flip into a number we can average, square, or subtract.

Discrete and continuous random variables

When Ω\Omega is finite or countably infinite the random variable is discrete: it takes values in a list {x1,x2,}\{x_1, x_2, \ldots\}. Each value xkx_k carries a probability

P(X=xk)=pk,pk0,kpk=1.P(X = x_k) = p_k, \qquad p_k \geq 0, \qquad \sum_k p_k = 1.

The collection of all (xk,pk)(x_k, p_k) pairs is the probability distribution of XX.

When XX can take any value in an interval — as happens for continuous quantities like position or momentum — it is a continuous random variable. Its distribution is described by a probability density function f(x)0f(x) \geq 0 such that

P(aXb)=abf(x)dx,P(a \leq X \leq b) = \int_a^b f(x)\, dx,

and the total area under ff integrates to 11. Probabilities are not point values but areas under the curve.

Why random variables appear in quantum mechanics

In quantum mechanics, a measurement outcome is not determined ahead of time — the theory assigns only probabilities to each possible result. When you measure an observable (energy, position, momentum, spin) on a quantum system, the outcome is a real number drawn from a probability distribution set by the state of the system. That outcome is precisely a value of a random variable.

For a spin-12\frac{1}{2} particle in a normalized state ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle (with α2+β2=1|\alpha|^2 + |\beta|^2 = 1), measuring the spin along zz gives:

The measurement outcome is a random variable taking two values, with distribution determined by the amplitudes α\alpha and β\beta. Understanding how to characterize and compute with such distributions — through expectation values, variances, and more — is the central mathematical thread of quantum probability.

Sign in on the full site to ask questions and join the discussion.