Definition
A random variable is a function that maps each outcome of a random experiment to a real number. If you roll two dice, the function 'sum of the faces' is a random variable taking values in {2, 3, ..., 12}. If you measure a customer's wait time, the value itself is the random variable.
Random variables let you compute with probability. Rather than reason about abstract outcomes, you reason about numerical quantities — sums, averages, ratios — that have means, variances, and distributions.
Why it matters
How it works
To define a random variable, you start with a probability space (sample space, events, probability measure) and choose a function from outcomes to numbers. The probability of the random variable taking a particular value (or falling in an interval) is inherited from the underlying probability measure on the sample space.
For example, on a single fair die roll, the random variable X = the face shown takes values 1 through 6 with probability 1/6 each. The random variable Y = (X mod 2) takes values 0 and 1, each with probability 1/2. Both are valid random variables built on the same probability space.