Back to the path
E

Random variables and expected value

Level 7 · Ages 17–18

Quick recall· Let's wake up what you already know before we start.

Recap: a fair coin is tossed twice, X counts the heads. What is P(X = 1), as a decimal?

The whole lesson

Read it again any time, including while you work through the exercises.

At a funfair, a stall runs a wheel: some sectors win you 5 euros, others 1 euro, others nothing. Chance picks the sector, but what you care about is the NUMBER you win. A random variable is exactly that: a machine that attaches a number to each outcome of a random experiment. We usually write it X.

To describe X completely, we build the table of its probability distribution: on the first row, all the possible values of X; on the second, the probability of each. Mandatory check: the probabilities must add up to exactly 1. If they do not, a value was forgotten or a calculation is wrong.

Then comes the thousand-euro question: how much do you win ON AVERAGE? That is the expected value of X, written E(X). Formula: multiply each value by its probability, then add everything up. E(X) = x1 × p1 + x2 × p2 and so on. It is a weighted mean: very likely values weigh a lot, rare values weigh little.

Mind the interpretation, this is where everyone stumbles: the expected value does NOT predict the result of one game. It tells you what the average gain per game becomes when you play a very large number of times. An expected value of 1.5 euros guarantees nothing about the next game, but over a thousand games, your average gain will get close to it.

The expected value lets you judge a game: if X stands for the net gain (winnings minus stake), then E(X) > 0 means the game favours the player, E(X) < 0 means it does not, and E(X) = 0 means a fair game. Guess which category real lotteries fall into... Your job to check it by calculation!

The worked example, step by step

A lottery wheel gives a gain X in euros with the following distribution: X = 5 with probability 0.2; X = 1 with probability 0.5; X = 0 with probability 0.3. Compute E(X).

  1. 0,2 + 0,5 + 0,3 = 1

    First I check the distribution: the probabilities do add up to 1. All good.

  2. 5 × 0,2 = 1 ; 1 × 0,5 = 0,5 ; 0 × 0,3 = 0

    I multiply each value by its probability: each product is that value's contribution to the average.

  3. E(X) = 1 + 0,5 + 0 = 1,5

    I add the contributions: the expected value is 1.5 euros. Over many games, the average gain tends towards 1.50 euros per game.

Result: E(X) = 1.5 euros.

A ticket costs 2 euros and wins 10 euros with probability 0.1 (otherwise nothing). X is the player's NET gain. Build X's distribution and compute E(X).

  1. gagnant : X = 10 - 2 = 8 (p = 0,1)

    If the ticket wins, the player receives 10 euros but spent 2: net gain 8 euros, with probability 0.1.

  2. perdant : X = -2 (p = 0,9)

    Otherwise, the player loses the stake: net gain -2 euros, with probability 0.9. The probabilities do add to 1.

  3. E(X) = 8 × 0,1 + (-2) × 0,9 = 0,8 - 1,8 = -1

    The expected value is negative: on average, the player loses 1 euro per ticket. The game does not favour the player.

Result: E(X) = -1 euro: the game does not favour the player.