4.7 · SLPaper 1Paper 2

Discrete random variables and expected value

In a minute

A is a number decided by chance, such as the number of cars a household owns. Its gives each value with its probability, and the probabilities add up to 11. The E(X)\mathrm{E}(X) is the long-run average: it predicts totals, sets fair prices and tells you whether a game is fair.

You'll be able to

  • Work with a and its , given as a table or as a formula.
  • Use the fact that the probabilities add up to 11 to find an unknown, and find probabilities such as P(X≥2)\mathrm{P}(X \ge 2).
  • Find the E(X)\mathrm{E}(X) by hand or with a GDC, and interpret it in context.
  • Use E(X)\mathrm{E}(X) in problems: decide whether a game is a , find a prize or fee that makes it fair, and predict a total over many trials.
Before you start3 quick questions on what this builds on
Check yourself
A trial has four possible outcomes. Three of them have probabilities 0.150.15, 0.40.4 and 0.30.3. Find the probability of the fourth outcome.
Check yourself
A class records how many pets each student has: pets123frequency4106\begin{array}{c|ccc} \text{pets} & 1 & 2 & 3 \\ \hline \text{frequency} & 4 & 10 & 6 \end{array} Find the number of pets.
Check yourself
The probability that a train is cancelled on a given day is 0.020.02. Find the expected number of cancellations in 250250 days.

Revise first: 4.3 Central tendency and dispersion and 4.5 Probability foundations and expected value

Random variables and their distributions

A town survey picks a household at random and counts its cars. Before the survey you can't know the count. But you can list every value it could take, and how likely each one is.

Learn this
∑P(X=x)=1\sum \mathrm{P}(X = x) = 1

The symbol ∑\sum means "add up over every value of xx". This rule is not in the formula booklet. It is how you find a missing probability or an unknown such as kk.

Worked exampleThe number of cars, XX, owned by a household in a town is modelled by this distribution: x01234P(X=x)0.120.41k0.090.03\begin{array}{c|ccccc} x & 0 & 1 & 2 & 3 & 4 \\ \hline \mathrm{P}(X = x) & 0.12 & 0.41 & k & 0.09 & 0.03 \end{array} (a) Find kk. (b) Find P(X≥2)\mathrm{P}(X \ge 2) and interpret it for the town's 24002400 households.

Try it first, then reveal one step at a time.

  1. (a) The probabilities add up to 11: 0.12+0.41+k+0.09+0.03=10.12 + 0.41 + k + 0.09 + 0.03 = 1.
Worked exampleA driving school models XX, the number of attempts a learner needs to pass the practical test: x1234P(X=x)0.460.3ab\begin{array}{c|cccc} x & 1 & 2 & 3 & 4 \\ \hline \mathrm{P}(X = x) & 0.46 & 0.3 & a & b \end{array} The probability of needing three attempts is three times the probability of needing four. (a) Find aa and bb. (b) State one limitation of this model.

Try it first, then reveal one step at a time.

  1. (a) Write the two facts as equations. The probabilities add up to 11: 0.46+0.3+a+b=10.46 + 0.3 + a + b = 1, so a+b=0.24a + b = 0.24.
Check yourself
The number of calls, XX, that a help desk receives in one minute has this distribution: x012345P(X=x)0.080.220.31k0.110.04\begin{array}{c|cccccc} x & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline \mathrm{P}(X = x) & 0.08 & 0.22 & 0.31 & k & 0.11 & 0.04 \end{array} Find kk.
Check yourself
Use the help desk distribution with k=0.24k = 0.24. Find the probability that the desk receives more than 33 calls in a minute.
Check yourself
In the driving school's model, P(X=1)=0.46\mathrm{P}(X = 1) = 0.46. What does this mean?

Distributions given by a formula

A distribution can also be given by a formula, such as P(X=x)=x10\mathrm{P}(X = x) = \frac{x}{10} for x∈{1,2,3,4}x \in \{1, 2, 3, 4\}. The set after "for" lists the values XX can take. The formula gives the probability of each one.

A formula is a short way to write a table. Substitute each value of xx, write the table out, and then work exactly as before.

Worked exampleThe number of days, XX, that a student cycles to school in a five-day week is modelled by P(X=x)=k(6−x)\mathrm{P}(X = x) = k(6 - x) for x∈{1,2,3,4,5}x \in \{1, 2, 3, 4, 5\}. (a) Find kk. (b) Find P(X≥4)\mathrm{P}(X \ge 4). (c) Find the expected number of weeks, out of a 3838-week school year, in which the student cycles on at least 44 days.

Try it first, then reveal one step at a time.

  1. Substitute each value: x12345P(X=x)5k4k3k2kk\begin{array}{c|ccccc} x & 1 & 2 & 3 & 4 & 5 \\ \hline \mathrm{P}(X = x) & 5k & 4k & 3k & 2k & k \end{array}
Worked exampleA hotel models the number of complaints, XX, it receives in a day by P(X=x)=kx+1\mathrm{P}(X = x) = \frac{k}{x + 1} for x∈{0,1,2,3}x \in \{0, 1, 2, 3\}. (a) Find kk. (b) Find the probability that the hotel receives at most one complaint in a day, and interpret it.

Try it first, then reveal one step at a time.

  1. Substitute each value: x=0x = 0 gives k1\frac{k}{1}, x=1x = 1 gives k2\frac{k}{2}, x=2x = 2 gives k3\frac{k}{3} and x=3x = 3 gives k4\frac{k}{4}.

The values of XX don't have to be positive or whole. Only the probabilities are restricted: each one lies between 00 and 11, and they add up to 11.

Check yourself
A random variable has P(X=x)=2x+1k\mathrm{P}(X = x) = \frac{2x + 1}{k} for x∈{0,1,2,3}x \in \{0, 1, 2, 3\}. Find kk.
Check yourself
Use P(X=x)=2x+116\mathrm{P}(X = x) = \frac{2x + 1}{16} for x∈{0,1,2,3}x \in \{0, 1, 2, 3\}. Find P(X≥2)\mathrm{P}(X \ge 2).

Expected value

Go back to the car survey. In 100100 households you'd expect about 1212 with no car, 4141 with one, 3535 with two, 99 with three and 33 with four. That is 0(12)+1(41)+2(35)+3(9)+4(3)=1500(12) + 1(41) + 2(35) + 3(9) + 4(3) = 150 cars, or 1.51.5 cars per household.

Dividing by 100100 turns each count back into its probability. So the average is ∑x P(X=x)\sum x\,\mathrm{P}(X = x): each value times its probability, added up.

In the formula booklet
E(X)=∑x P(X=x)\mathrm{E}(X) = \sum x\,\mathrm{P}(X = x)

This formula is in the formula booklet. It is the mean of a frequency table from 4.3, with probabilities in place of frequencies.

Bar chart of the probability distribution of the number of cars a household owns, with a dashed line at the expected value 1.5. 00.10.20.30.4 01234 number of cars, x E(X) = 1.5 P(X = x)
The expected value E(X)=1.5\mathrm{E}(X) = 1.5 sits where the distribution would balance. No household owns 1.51.5 cars.

No household owns 1.51.5 cars. That is fine: E(X)\mathrm{E}(X) is an average, so it need not be a value XX can take. It must lie between the smallest and largest values of XX.

On a GDC, use one-variable statistics with the values as data and the probabilities as frequencies. The mean xˉ\bar{x} is E(X)\mathrm{E}(X), and the total frequency nn should be 11, which checks the table. If your model refuses decimal frequencies and every probability has at most two decimal places, multiply every probability by 100100 first: the mean doesn't change, and nn should then be 100100.

Worked exampleUse the car distribution: x01234P(X=x)0.120.410.350.090.03\begin{array}{c|ccccc} x & 0 & 1 & 2 & 3 & 4 \\ \hline \mathrm{P}(X = x) & 0.12 & 0.41 & 0.35 & 0.09 & 0.03 \end{array} (a) Find E(X)\mathrm{E}(X). (b) The town has 24002400 households. Estimate the total number of cars in the town, and state an assumption you have made.

Try it first, then reveal one step at a time.

  1. (a) Write the sum with every term in: E(X)=0(0.12)+1(0.41)+2(0.35)+3(0.09)+4(0.03)\mathrm{E}(X) = 0(0.12) + 1(0.41) + 2(0.35) + 3(0.09) + 4(0.03).
Worked exampleAn airline models XX, the number of checked bags per passenger: x0123P(X=x)0.25pq0.05\begin{array}{c|cccc} x & 0 & 1 & 2 & 3 \\ \hline \mathrm{P}(X = x) & 0.25 & p & q & 0.05 \end{array} Given that E(X)=1.1\mathrm{E}(X) = 1.1, find pp and qq. Then find the expected number of checked bags on a flight with 180180 passengers.

Try it first, then reveal one step at a time.

  1. The probabilities add up to 11: 0.25+p+q+0.05=10.25 + p + q + 0.05 = 1, so p+q=0.7p + q = 0.7.
Check yourself
Use the help desk distribution: x012345P(X=x)0.080.220.310.240.110.04\begin{array}{c|cccccc} x & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline \mathrm{P}(X = x) & 0.08 & 0.22 & 0.31 & 0.24 & 0.11 & 0.04 \end{array} Find E(X)\mathrm{E}(X).
Check yourself
For the help desk, E(X)=2.2\mathrm{E}(X) = 2.2. Which statement interprets this correctly?
Check yourself
Use P(X=x)=2x+116\mathrm{P}(X = x) = \frac{2x + 1}{16} for x∈{0,1,2,3}x \in \{0, 1, 2, 3\}. Find E(X)\mathrm{E}(X). Give the exact value as a decimal.

Games, fairness and other applications

Many games cost money to play and sometimes pay a prize. Let XX be a player's gain in one game: prize minus cost. A loss is a negative gain.

E(X)\mathrm{E}(X) is then the player's average gain per game in the long run. If it is positive, players come out ahead on average. If it is negative, the organiser does, which is how stalls, lotteries and casinos make money.

Learn this
fair game: E(X)=0,where X is the player’s gain\text{fair game: } \mathrm{E}(X) = 0, \quad \text{where } X \text{ is the player's gain}

Over nn games, the expected total gain is n×E(X)n \times \mathrm{E}(X). The same idea predicts totals anywhere: cars in a town, bags on a flight, an insurer's payouts.

Worked exampleAt a funfair, one go on a hook-a-duck stall costs $2. There are 5050 ducks, and the player hooks one at random. 22 ducks win $15, 88 ducks win $4 and the rest win nothing. Let XX be the player's gain in dollars. (a) Find E(X)\mathrm{E}(X) and interpret it. (b) The stall expects 300300 goes in a day. Find the stall's expected profit.

Try it first, then reveal one step at a time.

  1. Take the $2 off each prize to get the gains: 15−2=1315 - 2 = 13, 4−2=24 - 2 = 2 and 0−2=−20 - 2 = -2.
Worked exampleA golf club runs a putting challenge. Each go costs $4. A player holes the putt with probability 0.20.2 and receives $ww. The ball stops within 11 m of the hole with probability 0.30.3, and the player receives $3. Otherwise the player receives nothing. Find the value of ww that makes the game fair.

Try it first, then reveal one step at a time.

  1. Let XX be the gain. Take the $4 off each prize: xw−4−1−4P(X=x)0.20.30.5\begin{array}{c|ccc} x & w - 4 & -1 & -4 \\ \hline \mathrm{P}(X = x) & 0.2 & 0.3 & 0.5 \end{array} The last probability is 1−0.2−0.3=0.51 - 0.2 - 0.3 = 0.5.
Check yourself
A prize wheel has 88 equal sectors. One go costs 33 tokens. One sector pays 1010 tokens, two sectors pay 55 tokens each, and the rest pay nothing. Which statement is true?
Check yourself
At a darts stall, a player hits the bullseye with probability 0.050.05 and wins $40, or hits the inner ring with probability 0.20.2 and wins $5. Otherwise the player wins nothing. Find the entry fee, in dollars, that makes the game fair.
Check yourself
A bike insurer charges $60 a year for a policy. In a year, it pays out $800 with probability 0.040.04, pays out $200 with probability 0.060.06, and pays nothing otherwise. Find the insurer's expected profit per policy, in dollars.
Check yourself
A farmer can plant crop A, with a sure profit of $12 000, or crop B. Crop B makes $30 000 if the season is good, with probability 0.60.6, and loses $5000 otherwise. Which statement is correct?

Common mistakes

  • Averaging the values of XX to find E(X)\mathrm{E}(X), as if they were equally likely. Weight each value by its probability: ∑x P(X=x)\sum x\,\mathrm{P}(X = x).
  • Setting the sum of the xx-values equal to 11, or dropping kk from some terms. It is the probabilities that add up to 11.
  • Treating X>2X > 2 as X≥2X \ge 2. For whole-number values, "greater than 22" starts at 33.
  • Using the prizes instead of the gains when deciding whether a game is fair. Take the cost off every prize, including the prize of 00.
  • Concluding "fair" or "not fair" without writing the value of E(X)\mathrm{E}(X). The value and its comparison with 00 must both be seen.
  • Rounding E(X)\mathrm{E}(X) before multiplying by the number of trials. Multiply the full value, then round the final answer.

Exam tips

  • Find kk: write ∑P(X=x)=1\sum \mathrm{P}(X = x) = 1 with every term in, then solve. Check each probability lies between 00 and 11.
  • Find E(X)\mathrm{E}(X): write the sum with its numbers in before the value, even when the GDC does the arithmetic. That line earns the method mark.
  • Determine whether a game is fair: define XX as the gain, find E(X)\mathrm{E}(X), write its value, and state whether it equals 00.
  • Interpret E(X)\mathrm{E}(X): say it is a long-run average per trial, in the context's units, such as "a player loses $0.76 per go on average".

Key takeaways

Learn thisA discrete random variable XX has a list of possible values xx. Its probability distribution gives P(X=x)\mathrm{P}(X = x) for each one, as a table or a formula.
Learn this∑P(X=x)=1,0≤P(X=x)≤1\sum \mathrm{P}(X = x) = 1, \quad 0 \le \mathrm{P}(X = x) \le 1
In bookletE(X)=∑x P(X=x)\mathrm{E}(X) = \sum x\,\mathrm{P}(X = x)
Learn thisE(X)\mathrm{E}(X) is the long-run mean of XX. It need not be a value XX can take. Over nn independent repeats of the trial, expect a total of n×E(X)n \times \mathrm{E}(X).
Learn thisGDC: one-variable statistics with the values as data and the probabilities as frequencies gives xˉ=E(X)\bar{x} = \mathrm{E}(X); with the probabilities entered as they are, the total frequency should be 11.
Learn thisfair game: E(X)=0,where X is the player’s gain (prize minus cost)\text{fair game: } \mathrm{E}(X) = 0, \quad \text{where } X \text{ is the player's gain (prize minus cost)}

Practise this

10 past-paper questions on Discrete probability distributions in the AI HL bank, each with a mark scheme and a worked explanation.

Practise Discrete probability distributions →