Random variable

By Jude Wallis · Published

A random variable assigns a numerical value to each outcome of a chance process, so its value is determined by the result of a random event.

A random variable is a rule that attaches a number to every outcome of a chance process. The rule itself is not random. The randomness sits in which outcome occurs, and once the outcome is known the variable has one definite value. Notation carries that distinction: a capital letter, usually XX, names the rule, and a lowercase xx names one value the rule can produce. That is why probabilities are written P(X=x)P(X = x), read as the probability that XX takes the particular value xx.

Flip a fair coin twice. The sample space is HH, HT, TH, TT, each outcome with probability 0.25. Let XX count the heads. Then HH maps to 2, HT and TH both map to 1, and TT maps to 0. Four outcomes collapse into three values, and the probabilities follow the map: P(X=1)=0.50P(X = 1) = 0.50, while P(X=0)P(X = 0) and P(X=2)P(X = 2) are each 0.25.

"Blood type is a random variable" is the error worth naming. The output has to be a number, because everything done with a random variable afterwards is arithmetic. Blood type is a categorical outcome, so it does not qualify. Build a number out of it and you are fine: the count of type O donors among 20 arrivals is a random variable, and counts can be averaged. The related slip is writing P(x=2)P(x = 2) in lowercase, which asks about a value instead of about the variable.

Random variables split into two kinds according to the values they can take. Discrete ones have values you can list, and continuous ones take any value in an interval and get their probabilities from area under a density curve. That split decides everything downstream, including whether you add probabilities or integrate areas to answer a question.

Random variables are introduced at topic 2.8 of Unit 2, and their summaries, the mean μX\mu_X (mu-X) and the standard deviation σX\sigma_X (sigma-X), at topic 2.9, Parameters of Random Variables.

Where this comes up

26 pages on the site use this term.

More random variables and distributions terms, or browse the full statistics glossary.