Pulsars
0 %
Log inSign up

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 XX is a function assigning a real number to each outcome of the sample space.

X:ΩRX : \Omega \longrightarrow \mathbb{R}

(1;1)2(1;2)3(6;6)12(1;1) \longmapsto 2 \qquad (1;2) \longmapsto 3 \qquad \dots \qquad (6;6) \longmapsto 12

When two dice are rolled, XX assigns their sum: the sample space Ω\Omega consists of the thirty-six pairs of faces, and XX sends them to the eleven integers from 22 to 1212.

It is written with a capital letter (XX, YY), and the values it takes with lower-case ones (xx, kk). The event « XX takes the value kk » is written (X=k)(X = k).

Experiment A possible random variable
rolling two dice XX = the sum of the two faces
playing a gambling game XX = the net gain (negative if a loss)
surveying 100 people XX = the number of « yes » answers
measuring parts XX = the number of defective parts

The distribution of X

Giving the distribution of XX means stating, for each possible value, the probability of obtaining it. It is presented as a table.

Rolling a fair die, XX = the result:

kk 11 22 33 44 55 66
P(X=k)P(X = k) 16\dfrac{1}{6} 16\dfrac{1}{6} 16\dfrac{1}{6} 16\dfrac{1}{6} 16\dfrac{1}{6} 16\dfrac{1}{6}

The total is indeed 6×16=16 \times \tfrac{1}{6} = 1.

Rolling two dice, XX = the sum:

kk 22 33 44 55 66 77 88 99 1010 1111 1212
P(X=k)P(X = k) 136\dfrac{1}{36} 236\dfrac{2}{36} 336\dfrac{3}{36} 436\dfrac{4}{36} 536\dfrac{5}{36} 636\dfrac{6}{36} 536\dfrac{5}{36} 436\dfrac{4}{36} 336\dfrac{3}{36} 236\dfrac{2}{36} 136\dfrac{1}{36}

The most likely value is k=7k = 7, with P(X=7)=636=16P(X = 7) = \tfrac{6}{36} = \tfrac{1}{6}: 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 22 and a single one for 1212.

The systematic check: the probabilities in the row must add up to exactly 11. If they do not, the distribution is wrong, and everything that follows will be too.

The graphical display

23456789101112P(X = k)k

This bar chart shows at a glance where the probability concentrates — here around 77, 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 XX be the net gain, that is, winnings minus stake:

Die result 66 1,2,3,4,51, 2, 3, 4, 5
Winnings €9 €0
Net gain 92=79 - 2 = 7 02=20 - 2 = -2

Hence the distribution of XX:

kk 2-2 77
P(X=k)P(X = k) 56\dfrac{5}{6} 16\dfrac{1}{6}

The total is 56+16=1\tfrac{5}{6} + \tfrac{1}{6} = 1.

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; (X=k)(X = k) is an event.
  • Giving the distribution of XX means giving P(X=k)P(X = k) for each value.
  • The probabilities in a distribution always add to 11 — a check never to skip.
  • The bar chart displays the spread.
  • For a game, model the net gain, stake deducted.