Modelling a numerical result
Random variables and their distribution
So far the outcomes were objects: a die face, a card, a pair of tokens. A random variable attaches a number to each outcome — a gain, a duration, a count — so that it can be averaged, compared, measured.
The definition
A random variable is a function assigning a real number to each outcome of the sample space.
When two dice are rolled, assigns their sum: the sample space consists of the thirty-six pairs of faces, and sends them to the eleven integers from to .
It is written with a capital letter (, ), and the values it takes with lower-case ones (, ). The event « takes the value » is written .
| Experiment | A possible random variable |
|---|---|
| rolling two dice | = the sum of the two faces |
| playing a gambling game | = the net gain (negative if a loss) |
| surveying 100 people | = the number of « yes » answers |
| measuring parts | = the number of defective parts |
The distribution of X
Giving the distribution of means stating, for each possible value, the probability of obtaining it. It is presented as a table.
Rolling a fair die, = the result:
The total is indeed .
Rolling two dice, = the sum:
The most likely value is , with : it is the sum that can be reached in the greatest number of ways — six pairs of faces produce it, against a single one for and a single one for .
The systematic check: the probabilities in the row must add up to exactly . If they do not, the distribution is wrong, and everything that follows will be too.
The graphical display
This bar chart shows at a glance where the probability concentrates — here around , with perfect symmetry.
An example with gains
A game costs €2 per round. A die is rolled: you win €9 on a 6, nothing otherwise. Let be the net gain, that is, winnings minus stake:
| Die result | ||
|---|---|---|
| Winnings | €9 | €0 |
| Net gain | € | € |
Hence the distribution of :
The total is .
Modelling the gain net of the stake — hence negative on a loss — is what will let us say, in the next lesson, whether the game is fair.
Summary
- A random variable assigns a number to each outcome.
- Notation: capital for the variable, lower-case for its values; is an event.
- Giving the distribution of means giving for each value.
- The probabilities in a distribution always add to — a check never to skip.
- The bar chart displays the spread.
- For a game, model the net gain, stake deducted.

