4.7 · SLPaper 1Paper 2

Discrete random variables and expected value

In a minute

A is a number decided by chance, such as the goals a team scores. Its lists each value it can take with its probability, and those probabilities always add up to 11. The E(X)\mathrm{E}(X) is its long-run average, and it 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 such as kk.
  • Find probabilities such as P(X>2)\mathrm{P}(X > 2) from a distribution.
  • Find the E(X)\mathrm{E}(X) and say what it means.
  • Use E(X)\mathrm{E}(X) in problems: decide whether a game is a , and set a fee or a prize that makes it fair.
Before you start3 quick questions on what this builds on
Check yourself
The probability that a bus is late is 0.180.18. Find the probability that it is not late.
Check yourself
Two fair coins are tossed. Find the probability of exactly one head.
Check yourself
Events AA and BB are independent, with P(A)=0.3\mathrm{P}(A) = 0.3 and P(B)=0.6\mathrm{P}(B) = 0.6. Find P(A∩B)\mathrm{P}(A \cap B).

Revise first: 4.5 Probability foundations and expected value and 4.6 Probability diagrams, rules and independence

Random variables and their distributions

Five cards are numbered 11 to 55. You pick two at random and look at the smaller number. You can't know it in advance. But you can list every value it could be, 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, so learn it. It is how you find an unknown in a distribution.

Worked exampleFive cards are numbered 11 to 55. Two cards are picked at random at the same time. Let XX be the smaller of the two numbers. (a) Find the probability distribution of XX. (b) Find P(X≥3)\mathrm{P}(X \ge 3).

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

  1. List the as pairs, smaller number first: (1,2),(1,3),(1,4),(1,5),(2,3),(2,4),(2,5),(3,4),(3,5),(4,5)(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5). That is 1010 pairs.
Worked exampleThe number of goals, XX, that a hockey team scores in a match has this distribution: x01234P(X=x)0.050.32kk0.2\begin{array}{c|ccccc} x & 0 & 1 & 2 & 3 & 4 \\ \hline \mathrm{P}(X = x) & 0.05 & 0.3 & 2k & k & 0.2 \end{array} (a) Find the value of kk. (b) Find P(X≥2)\mathrm{P}(X \ge 2).

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

  1. (a) The probabilities add up to 11: 0.05+0.3+2k+k+0.2=10.05 + 0.3 + 2k + k + 0.2 = 1.
Worked exampleA discrete random variable XX has this distribution, where kk is a constant: x1234P(X=x)0.34k2k0.2\begin{array}{c|cccc} x & 1 & 2 & 3 & 4 \\ \hline \mathrm{P}(X = x) & 0.3 & 4k^{2} & k & 0.2 \end{array} Find the value of kk.

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

  1. The probabilities add up to 11: 0.3+4k2+k+0.2=10.3 + 4k^{2} + k + 0.2 = 1.
Check yourself
A random variable has this distribution: x2357P(X=x)0.1k3k0.26\begin{array}{c|cccc} x & 2 & 3 & 5 & 7 \\ \hline \mathrm{P}(X = x) & 0.1 & k & 3k & 0.26 \end{array} Find kk.
Check yourself
Use the hockey team's distribution, with k=0.15k = 0.15. Find P(X>2)\mathrm{P}(X > 2).

Distributions given by a formula

Look again at the smaller-card table. Each probability is 55 minus the value, over 1010. So the whole table fits in one line: P(X=x)=5−x10\mathrm{P}(X = x) = \frac{5 - x}{10} for x∈{1,2,3,4}x \in \{1, 2, 3, 4\}.

A formula like this is just a short way to write a table. The set after "for" lists the values XX can take. To work with it, substitute each value of xx and write the table out.

Worked exampleThe of XX is P(X=x)=kx\mathrm{P}(X = x) = \frac{k}{x} for x∈{1,2,3,6}x \in \{1, 2, 3, 6\}. Find the value of kk.

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

  1. Substitute each value of xx: x1236P(X=x)kk2k3k6\begin{array}{c|cccc} x & 1 & 2 & 3 & 6 \\ \hline \mathrm{P}(X = x) & k & \frac{k}{2} & \frac{k}{3} & \frac{k}{6} \end{array}
Worked exampleA XX has P(X=x)=k(x2+1)\mathrm{P}(X = x) = k(x^{2} + 1) for x∈{−1,0,1,2}x \in \{-1, 0, 1, 2\}. (a) Find kk. (b) Find P(X>0)\mathrm{P}(X > 0).

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

  1. Substitute each value. x=−1x = -1 gives k((−1)2+1)=2kk\big((-1)^{2} + 1\big) = 2k. Then x=0x = 0 gives kk, x=1x = 1 gives 2k2k, and x=2x = 2 gives 5k5k.

Notice that XX can take a negative value here. A value of XX can be any number. Only the probabilities have to lie between 00 and 11.

Check yourself
P(X=x)=k(x+3)\mathrm{P}(X = x) = k(x + 3) for x∈{1,2,3,4}x \in \{1, 2, 3, 4\}. Find kk.
Check yourself
Use P(X=x)=kx\mathrm{P}(X = x) = \frac{k}{x} for x∈{1,2,3,6}x \in \{1, 2, 3, 6\}, where you found k=12k = \frac{1}{2}. Find P(X≤3)\mathrm{P}(X \le 3). Give your answer to 3 s.f.

Expected value

Suppose the hockey team plays 100100 matches. You'd expect about 55 with no goals, 3030 with one goal, 3030 with two, 1515 with three and 2020 with four.

That is about 0×5+1×30+2×30+3×15+4×20=2150 \times 5 + 1 \times 30 + 2 \times 30 + 3 \times 15 + 4 \times 20 = 215 goals, or 2.152.15 per match. Dividing by 100100 turns each count back into its probability.

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

You don't need to memorise this; it's in the formula booklet. Multiply each value by its probability, then add the results. 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 goals, balanced on a pivot at the expected value 2.15. 00.10.20.3 01234 number of goals, x pivot at E(X) = 2.15 P(X = x)
If each bar were a weight, the chart would balance on a pivot at E(X)=2.15\mathrm{E}(X) = 2.15.

No match ends with 2.152.15 goals. That is fine: E(X)\mathrm{E}(X) is an average, so it need not be a value XX can take.

Worked exampleUse the hockey team's distribution with k=0.15k = 0.15: x01234P(X=x)0.050.30.30.150.2\begin{array}{c|ccccc} x & 0 & 1 & 2 & 3 & 4 \\ \hline \mathrm{P}(X = x) & 0.05 & 0.3 & 0.3 & 0.15 & 0.2 \end{array} Find E(X)\mathrm{E}(X).

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

  1. Write every term as value times probability: E(X)=0(0.05)+1(0.3)+2(0.3)+3(0.15)+4(0.2)\mathrm{E}(X) = 0(0.05) + 1(0.3) + 2(0.3) + 3(0.15) + 4(0.2).
Worked exampleA random variable XX has this distribution: x2468P(X=x)0.1p0.40.5−p\begin{array}{c|cccc} x & 2 & 4 & 6 & 8 \\ \hline \mathrm{P}(X = x) & 0.1 & p & 0.4 & 0.5 - p \end{array} Given that E(X)=5.8\mathrm{E}(X) = 5.8, find pp.

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

  1. Write E(X)\mathrm{E}(X) with every term in: 2(0.1)+4p+6(0.4)+8(0.5−p)=5.82(0.1) + 4p + 6(0.4) + 8(0.5 - p) = 5.8.
Worked exampleA printer jams XX times in a day, where P(X=x)=k(0.8)x\mathrm{P}(X = x) = k(0.8)^{x} for x∈{0,1,2,3,4,5}x \in \{0, 1, 2, 3, 4, 5\}. (a) Use your calculator to find kk. (b) Find E(X)\mathrm{E}(X). Give your answers to 3 s.f.

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

  1. (a) The probabilities add up to 11: k∑x=05(0.8)x=1k\sum_{x=0}^{5} (0.8)^{x} = 1. Write this sum down, then work it out on the GDC: ∑x=05(0.8)x=3.68928\sum_{x=0}^{5} (0.8)^{x} = 3.68928.
Check yourself
P(X=x)=12x\mathrm{P}(X = x) = \frac{1}{2x} for x∈{1,2,3,6}x \in \{1, 2, 3, 6\}. Find E(X)\mathrm{E}(X).
Check yourself
Use the distribution P(X=x)=x2+110\mathrm{P}(X = x) = \frac{x^{2} + 1}{10} for x∈{−1,0,1,2}x \in \{-1, 0, 1, 2\}. Find E(X)\mathrm{E}(X).

Games and fairness

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.

Then E(X)\mathrm{E}(X) is the player's average gain per game in the long run. If it is positive, players come out ahead. If it is negative, the organiser does.

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). This is the same idea as the expected number of occurrences in 4.5.

Worked exampleIt costs $2 to spin a spinner. The player wins $5 with probability 0.20.2, wins $1 with probability 0.30.3, and wins nothing otherwise. Let XX be the player's gain in dollars. (a) Find E(X)\mathrm{E}(X). (b) Find the expected total gain over 200200 games.

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

  1. Take the $2 off each prize to get the gains: 5−2=35 - 2 = 3, 1−2=−11 - 2 = -1 and 0−2=−20 - 2 = -2.
Worked exampleA fair spinner has five equal sectors, and one of them is red. A player pays $3 and spins it twice. If exactly one spin lands on red, the player receives $5. If both spins land on red, the player receives kk dollars. Otherwise the player receives nothing. Find the value of kk that makes the game fair.

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

  1. One spin lands on red with probability 15\frac{1}{5}. The two spins are independent, so multiply (4.6).
Check yourself
A game costs 11 token. You roll a fair six-sided die. A 66 pays 44 tokens, a 55 pays 22 tokens, and anything else pays nothing. Which statement is true?
Check yourself
Ten cards are numbered 11 to 1010, and one is picked at random. If its number is a multiple of 33, you win that many dollars. Otherwise you win nothing. Find the entry fee, in dollars, that makes the game fair.
Check yourself
A bag holds 1010 discs: 11 gold, 33 silver and 66 white. A player pays $4 and picks one disc at random. Gold wins $20, silver wins $5 and white wins nothing. Find the player's expected total gain, in dollars, over 6060 games.

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 values of xx, or the terms without kk, equal to 11. It is the probabilities that add up to 11.
  • Leaving out an xx in an equation for E(X)\mathrm{E}(X), for example writing qq where the term should be 3q3q. Write every term as x×P(X=x)x \times \mathrm{P}(X = x) first.
  • Treating X>2X > 2 as X≥2X \ge 2. For whole-number values, "greater than 22" starts at 33.
  • Keeping a value of kk that makes a probability negative or bigger than 11. Substitute each root back into the table and reject any that fails.
  • Rounding E(X)\mathrm{E}(X) before multiplying by the number of games. Multiply the exact value, then round the final answer.

Exam tips

  • Show that kk has a given value: start from ∑P(X=x)=1\sum \mathrm{P}(X = x) = 1 and solve. Substituting the given kk to check the total assumes the answer, so it doesn't show it.
  • Find E(X)\mathrm{E}(X): write the sum with every term in, such as 0(0.05)+1(0.3)+…0(0.05) + 1(0.3) + \ldots, before the value. That line earns the method mark.
  • Hence find E(X)\mathrm{E}(X): use the kk you just found. If that kk was wrong but you use it correctly, you can still earn follow-through marks.
  • Determine whether a game is fair: define XX as the gain, find E(X)\mathrm{E}(X), and state clearly whether it equals 00.

Key takeaways

Learn this∑P(X=x)=1\sum \mathrm{P}(X = x) = 1
In bookletE(X)=∑x P(X=x)\mathrm{E}(X) = \sum x\,\mathrm{P}(X = x)
Learn thisfair 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}
Learn thisA discrete random variable XX has a list of values xx. Its probability distribution gives P(X=x)\mathrm{P}(X = x) for each, 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
Learn thisTo find kk, set the sum of the probabilities equal to 11. Reject any root that gives a probability below 00 or above 11.
Learn thisE(X)\mathrm{E}(X) is the long-run average. It need not be a value XX can take. Over nn trials, expect a total of n×E(X)n \times \mathrm{E}(X).
Learn thisIf XX is a player's gain (prize minus cost), the game is fair when E(X)=0\mathrm{E}(X) = 0.

Practise this

12 past-paper questions on 4.7 in the AA HL bank, each with a mark scheme and a worked explanation.

Practise 4.7 →