A variable whose value is a numerical outcome of a random process and which can take only separate (countable) values, such as 0,1,2,…. It is written with a capital letter, such as X.
A probability distribution in which each of the n possible values of a discrete random variable has the same probability n1
Notes on 4.7 Discrete random variables
26 min readLast reviewed
Questions on 4.7
35 exam-style questions on this subtopic, written in the style of the IB papers. The first has its markscheme open. Counted on
Question 1 · AA-0042315 marks
A spinner is divided into sectors labelled 0, 1, 2 and 3. Let X be the score obtained when the spinner is spun once. The probability distribution of X is given below. Both p and q are constants.
x
Try a quick-fire question
One of 35 short multiple-choice questions on 4.7. Pick an answer to see why it's right or wrong.
A player pays $4 to play a game and wins a prize of $15. What is the player's gain?
From the formula booklet
The entries of the mathematics: analysis and approaches formula booklet that 4.7 uses. Each opens in the explained booklet.
A list, table, graph or formula giving every possible value x of a discrete random variable X with its probability P(X=x). The probabilities are all between 0 and 1 and add up to 1.
and
P(X=4∣X≥3)
from a distribution.
Calculate the expected value E(X)=∑xP(X=x) and interpret it as a long-run mean.
Determine whether a game is fair, and find the stake or prize that makes it fair.
Apply expected value to raffles, insurance and other decisions.
Many random processes produce a number: the score on a die, the number of heads in three coin tosses, the amount of money won in a game, the number of insurance claims made in a year. A random variable gives that number a name, so that probabilities can be written and calculated with algebra instead of words. Its probability distribution lists every possible value with its probability, and its expected value describes the mean result over many repetitions.
Expected value is the basis of how casinos, lotteries and insurance companies set their prices. A company that sells thousands of insurance policies cannot predict which customers will make a claim, but it can predict its average cost per policy very accurately, and it sets its premiums from that average.
Random variables
Outcomes that are numbers
A random process (an experiment or trial) has outcomes that are not known in advance. When each outcome is described by a number, that number is a random variable. Random variables are written with capital letters such as X, Y and W. The lower-case letter x stands for one particular value that X can take.
The word "discrete" means that the possible values can be listed, with gaps between them. A discrete random variable usually comes from counting (the number of heads, the number of defective items, the number of goals) or from a score or payout that takes a fixed set of values. Measured quantities such as time, mass and length can take any value in an interval; these are continuous random variables, which are treated with integration in 4.14 (HL).
Random variable
Possible values
Type
The score when a fair die is rolled
1,2,3,4,5,6
Discrete
The number of heads in three coin tosses
0,1,2,3
Discrete
The number of emails received in an hour
0,1,2,3,…
Discrete
The prize, in dollars, won in a raffle
0,50,250,1000
Discrete
The time, in minutes, spent waiting for a bus
any value in 0≤t≤15
Continuous
The mass of a newborn baby
any value in an interval
Continuous
The notation P(X = x)
The probability that X takes the value x is written P(X=x). For example, if X is the score on a fair die, then P(X=6)=61 and P(X≤2)=62=31. The statement inside the brackets is an event, so every rule of probability from 4.5 and 4.6 applies to it: complements, combined events and conditional probability.
Probability distributions
What a probability distribution is
A random variable is only useful once the probability of each of its values is known. Together, the values and their probabilities form the distribution of the random variable.
The most common form is a table with the values in the first row and their probabilities in the second. The distribution of the score X on a fair die is
x
1
2
3
4
5
6
P(X=x)
61
61
Every value here has the same probability. This simple pattern has its own name.
Building a distribution from a sample space
To find a distribution from first principles, list the equally likely outcomes in the sample space, work out the value of X for each outcome, and count how many outcomes give each value. Dividing each count by the total number of outcomes gives the probabilities.
A sample space diagram (a grid of outcomes) does the same job when two dice are rolled. It is often the quickest way to see a pattern that leads to a formula for P(X=x).
The distribution of the larger score rises steadily: high values are more likely, because there are more ways for at least one die to reach them. A bar chart, with the possible values on the horizontal axis and the probabilities as the heights of separate bars, shows the shape at a glance.
The bars rise by 2/36 each step, and their heights add up to 36/36 = 1. The bars are separate because X takes only whole-number values.
The conditions for a valid distribution
Since the values of X cover every possible outcome, and no outcome gives two different values, the events X=x are mutually exclusive and together make up the whole sample space. Their probabilities must therefore add up to 1. Each probability must also lie between 0 and 1, like any other probability.
The condition ∑P(X=x)=1 gives an equation, so it can be used to find an unknown probability or constant in a distribution.
Distributions given by a formula
A distribution can also be given by a rule for P(X=x) together with the list of values x for which the rule applies. To use it, substitute each value of x into the rule, which turns the formula into a table.
Sometimes the unknown appears in a quadratic, and the equation ∑P(X=x)=1 has two solutions. Each solution must then be tested against the other condition, 0≤P(X=x)≤1, and any solution that gives a negative probability (or one greater than 1) is rejected.
Probabilities of events involving X
Once the distribution is known, the probability of any event about X is the sum of the probabilities of the values that make up the event. Inequalities need care with the end points, because X takes only the listed values.
Words
Inequality
Values of X included (for X = larger score on two dice)
at most 3
X≤3
1,2,3
fewer than 3
X<3
1,2
at least 3
X≥3
3,4,5,6
more than 3
X>3
4,5,6
between 2 and 5 inclusive
2≤X≤5
2,3,4,5
Conditional probabilities follow the rule P(A∣B)=P(B)P(A∩B) from 4.6, with events written in terms of X.
Expected value
The long-run mean of a random variable
Suppose a fair die is rolled 600 times. Each score is expected about 600×61=100 times, the expected number of occurrences from 4.5. The mean score of the 600 rolls would then be close to
The number of rolls cancels: each value is multiplied by its probability, and the products are added. The same reasoning works for any discrete random variable. If the process is repeated N times, each value x occurs about N×P(X=x) times, and the mean of the results is about
N∑x×NP(X=x)=∑xP(X=x)
The expected value is a weighted mean of the possible values, with the probabilities as the weights. It is the same calculation as the mean of a frequency table, xˉ=∑f∑fx, with relative frequencies replaced by probabilities. E(X) is therefore a model of the long-run behaviour of a process: the relative frequencies of real data settle towards the probabilities, so the mean of real data settles towards E(X).
Interpreting the expected value
The expected value need not be one of the possible values of X. No single roll of a die scores 3.5, and no set of three tosses gives 1.5 heads. E(X) describes the average over many repetitions, not the result of one. For the same reason, E(X) is not the most likely value: that is the value with the greatest probability (the mode), which for the larger score on two dice is 6, not 4.47.
Symmetric distributions
When a distribution is symmetric, its expected value is the value at the centre of symmetry. The distribution of the number of heads in three tosses has probabilities 81,83,83,81, symmetric about 1.5, so E(X)=1.5 with no calculation. The sum of the scores on two fair dice is symmetric about 7, so its expected value is 7.
Using E(X) to find unknown probabilities
When a distribution has two unknown probabilities, the two facts ∑P(X=x)=1 and a given value of E(X) give a pair of simultaneous linear equations.
Expected value in games and decisions
Gain and fair games
In a game of chance a player usually pays a stake to play and may receive a prize. The amount the player actually ends up with is the gain:
gain=prize received−stake paid
A negative gain is a loss. If the stake is the same every time, then E(gain)=E(prize)−stake, because subtracting a fixed amount from every value of the prize subtracts it from their weighted mean as well.
A game with E(gain)<0 favours the organiser, and one with E(gain)>0 favours the player. Casino games and lotteries are designed so that the expected gain of a player is negative, which guarantees the organiser a profit over a large number of plays even though individual players sometimes win.
Finding the stake or prize that makes a game fair
Setting E(gain)=0 gives an equation for an unknown stake or prize. Problems of this type are a direct application of expected value to the design of a game.
Raffles and lotteries
In a raffle, a fixed number of tickets is sold and a fixed set of prizes is given away. If every ticket is equally likely to win, the expected prize per ticket is the total prize money divided by the number of tickets.
Insurance
An insurance company charges a fixed premium and pays out if a claim is made. From the company's point of view, the payout is a random variable, and the expected payout per policy is its average cost. The premium must be greater than the expected payout for the company to make a profit, and the company also has to cover its running costs.
Every customer's expected gain from such a policy is negative, yet buying insurance can still be a sensible choice. Expected value describes the average over many repetitions, while one customer experiences a single year. A loss of $800 may matter far more to one person than a certain cost of $90. The expected value is a guide to the long run, and other considerations, such as the size of a possible loss, also matter in a real decision.
Exam-style questions on discrete random variables
Questions on this content combine three skills: building or completing a distribution, using it to find probabilities, and finding and interpreting an expected value. Many are set without a calculator, so fractions and exact working are common.
Self-check
To do:
I can explain what a discrete random variable is and list its possible values in a context.
To do:
I can build a probability distribution from a sample space, a sample space diagram or a tree diagram.
To do:
I can use ∑P(X=x)=1 to find an unknown constant, and reject values that give impossible probabilities.
To do:
I can find probabilities such as P(X>3) and P(X=4∣X≥3) from a distribution.
To do:
I can calculate E(X)=∑xP(X=x) and explain why it need not be a possible value of X.
To do:
I can use ∑P(X=x)=1 and a given E(X) to find two unknown probabilities.
To do:
I can find the expected gain in a game and the stake or prize that makes it fair.
To do:
I can use expected value to analyse a raffle or an insurance policy.
0
1
2
3
P(X=x)
p
0.3
q
0.2
It is given that E(X)=1.4.
(a)
Find the value of p and the value of q.
[4]4 marks
Markscheme (a)
p+0.3+q+0.2=1(M1)
0×p+1×0.3+2q+3×0.2=1.4(M1)
q=0.25A1
p=0.25A1
(b)
Find P(X≥2∣X≥1).
[3]3 marks
Markscheme (b)
P(X≥1)=0.75
(c)
Show that P(T=3)=0.25.
[3]3 marks
Markscheme (c)
recognition of the four outcomes (0,3),(3,0),(1,2),(2,1)
(d)
Given that T=3, find the probability that one of the spins scored 0.
[2]2 marks
Markscheme (d)
0.252×0.25×0.2(M1)
=0.4
(e)
Let F be the event "the first spin scores 1" and let E be the event "T=3". Determine whether the events F and E are independent. Justify your answer.
[3]3 marks
Question 2 · AA-00457HL only · 15 marks
A game uses a spinner and three bags, A, B and C.
Bag A contains 2 red balls and 2 white balls.
Bag B contains 3 red balls and 1 white ball.
Bag C contains 4 red balls.
The spinner shows A with probability 21, B with probability 31 and C with probability 61. A player spins the spinner once and then takes two balls at random, without replacement, from the bag shown.