Discrete random variables
A random variable assigns a numerical value to each outcome of a random experiment. It is discrete when its possible values can be listed, even if the list is infinite.
For example, if is the number of sixes in four rolls of a die, then
The value of is not known until the experiment happens, but each possible value has a probability. Those values and probabilities form the probability distribution of .
This lesson explains how to construct and use discrete distributions, including their mean, variance and standard deviation.
Prerequisites
Section titled “Prerequisites”You should be able to:
- calculate probabilities using probability rules;
- recognise mutually exclusive outcomes;
- use sigma notation such as ;
- calculate a mean and variance from a frequency table.
From outcomes to a random variable
Section titled “From outcomes to a random variable”An outcome describes what happens. A random variable records a numerical feature of what happens.
Suppose two fair coins are tossed. The equally likely outcomes are
Define to be the number of heads. Then
The outcomes and are different, but they give the same value of . Combining outcomes with equal values gives
This is a probability distribution.
Discrete and continuous variables
Section titled “Discrete and continuous variables”A discrete variable takes separate, countable values. A continuous variable can take any value in an interval.
| Variable | Type | Reason |
|---|---|---|
| Number of emails received | Discrete | Takes values |
| Mass of an apple | Continuous | Can take any value in a measurement interval |
| Score on a ten question test | Discrete | Takes integer values from to |
| Time until a bus arrives | Continuous | Can take any non-negative real value |
A rounded measurement is still modelled as continuous if the underlying quantity is continuous.
Self-check 1
Section titled “Self-check 1”A spinner is spun three times. Let be the number of red results. Is discrete or continuous, and what values can it take?
Answer
is discrete because it is a count. Its possible values are
Valid probability distributions
Section titled “Valid probability distributions”For a discrete random variable , write
Every probability distribution must satisfy two conditions:
and
The second condition holds because the possible values of are mutually exclusive and exhaustive: exactly one of them must occur.
Worked example 1: finding an unknown probability
Section titled “Worked example 1: finding an unknown probability”The distribution of is shown below.
Find .
The probabilities sum to :
Therefore
and
Check that every resulting probability lies between and .
Worked example 2: a distribution given by a formula
Section titled “Worked example 2: a distribution given by a formula”A random variable has probability function
Find and .
First use the total probability:
Hence . Now
Self-check 2
Section titled “Self-check 2”For , suppose
Find and .
Answer
Since the probabilities sum to ,
so . Therefore
Calculating probabilities from a distribution
Section titled “Calculating probabilities from a distribution”Translate the wording into an inequality before adding probabilities.
| Words | Probability statement |
|---|---|
| exactly | |
| at most | |
| fewer than | |
| at least | |
| more than | |
| from to inclusive |
For integer-valued ,
but and are not the same.
Worked example 3: interval and complement probabilities
Section titled “Worked example 3: interval and complement probabilities”The probability distribution of is
Find:
- ;
- .
For the first probability, include but not :
For the second, a complement is shorter:
Cumulative distribution functions
Section titled “Cumulative distribution functions”The cumulative distribution function of is
It accumulates probability from the smallest possible value up to . For a discrete random variable, is a step function.
Using the previous distribution,
Differences of cumulative probabilities give interval probabilities. For integer-valued ,
For example,
Expectation: the long-run mean
Section titled “Expectation: the long-run mean”The expected value or mean of a discrete random variable is
Each value is weighted by its probability. If the experiment is repeated many times, the mean of the observed values tends towards .
The expected value need not be a possible outcome. A fair die has expected score , although no single roll can produce .
Worked example 4: expected value from a table
Section titled “Worked example 4: expected value from a table”A game pays pounds, with distribution
Then
Over many plays, the average payout approaches £1.85 per play.
If the game costs £2 to play, the player’s net gain is , so
The player loses an average of 15 pence per play in the long run. This does not mean every play loses 15 pence.
Worked example 5: finding a parameter from the mean
Section titled “Worked example 5: finding a parameter from the mean”The distribution of is
Given that , find .
Use the values as weights:
Therefore
so
The probabilities are then , which are valid and sum to .
Self-check 3
Section titled “Self-check 3”A fair spinner has labels on four equal sectors. Let be the label obtained. Find .
Answer
The distribution is
Hence
Variance and standard deviation
Section titled “Variance and standard deviation”Expectation gives the centre of a distribution. Variance measures its spread about that centre.
If , then
The efficient formula is
where
The standard deviation is
Variance has squared units, while standard deviation has the same units as .
Worked example 6: mean, variance and standard deviation
Section titled “Worked example 6: mean, variance and standard deviation”Let have distribution
First calculate the mean:
Next calculate the second moment:
Therefore
and
A useful calculation table
Section titled “A useful calculation table”For longer distributions, organise the work in columns:
| possible value | probability | contribution to | contribution to |
Then add the third and fourth columns. This reduces omitted terms and calculator input errors.
Self-check 4
Section titled “Self-check 4”For the random variable below, find .
Answer
and
Therefore
Linear transformations
Section titled “Linear transformations”Suppose a new variable is defined by
where and are constants. Then
and
Adding shifts every value equally, so it changes the mean but not the spread. Multiplying by multiplies distances from the mean by , so it multiplies variance by .
Consequently,
Worked example 7: transforming a random variable
Section titled “Worked example 7: transforming a random variable”A delivery charge in pounds is modelled by
where and . Find the mean and standard deviation of .
For the mean,
For the variance,
Therefore
The added £3 affects the mean charge but not its standard deviation.
Common misconceptions
Section titled “Common misconceptions”- The possible values must have equal probabilities. They do not. Probabilities come from the underlying random experiment.
- Expectation is the most likely value. Not necessarily. It is a probability-weighted mean and may not be possible at all.
- . Usually these differ. Their difference is the variance.
- Adding a constant increases variance. It shifts the distribution without changing its spread.
- . Variance scales by .
- At most and fewer than mean the same thing. At most includes the boundary; fewer than excludes it.
Mixed self-check
Section titled “Mixed self-check”A random variable has probability function
- Find .
- Find .
- Find .
- Find .
Answers
The probability weights are . Hence
Then
The mean is
Also,
Therefore
Summary
Section titled “Summary”For a discrete random variable :
Always define the random variable, check that probabilities are valid, and translate boundary language before calculating.
Next steps
Section titled “Next steps”- Study the most important named discrete model, the binomial distribution.
- Learn how context determines the right model in choosing a distribution.
- Apply probability models within hypothesis testing.