Skip to main content
TirageAuSort.io
Probability

Random variable

A numerical quantity whose value depends on the outcome of a random experiment.

A random variable is a numerical quantity whose value is not fixed in advance but depends on the outcome of an experiment governed by chance. Formally, it assigns a number to every possible outcome of the experiment: each result of the draw corresponds to a well-defined numerical value.

The simplest mental image is that of a numerical label stuck onto each outcome. Before the draw, we do not know which label will come up; afterward, we read a precise number. The random variable is therefore the bridge between an uncertain phenomenon and the world of numbers, on which all subsequent calculations rest.

To describe a random variable, we list its possible values and assign each one a probability: this is its distribution. Take the number of heads in three tosses of a fair coin. The possible values are 0, 1, 2 and 3. Out of the eight equally likely outcomes, exactly one gives 0 heads and one gives 3 heads, while three outcomes give 1 head and three give 2 heads. The probabilities are therefore 1/8, 3/8, 3/8 and 1/8.

Once this distribution is known, the variable can be summarized by two key numbers: the expectation, which is the average of its values weighted by their probabilities, and the variance, which measures their spread around that average.

The random variable should not be confused with a particular value it takes. The variable is the complete rule, the abstract object that covers every case; a given draw provides only one realization of it, a single observed number.

On the site, every tool produces a random variable: the result of a virtual die, the sum of two dice, the rank of the name drawn from a list, the number shown by the integer generator. Naming them this way lets us predict their average behavior and regularity even before launching the draw.

Example

"The sum of two dice" is a random variable that can take the values from 2 to 12.

Related terms