Skip to main content

Discrete random variables, expected value and variance (QCE Mathematical Methods Unit 3)

Syllabus dot point

“Define a discrete random variable and its probability distribution, calculate the expected value E(X)E(X) and the variance Var(X)\mathrm{Var}(X) and standard deviation, and recognise the Bernoulli distribution as the single-trial case”

8 min read

Quick answer

A discrete random variable has a probability distribution satisfying pi≥0p_i \geq 0 and ∑pi=1\sum p_i = 1, with mean E(X)=∑xipiE(X) = \sum x_i p_i and variance Var(X)=E(X2)−[E(X)]2\mathrm{Var}(X) = E(X^2) - [E(X)]^2, and the Bernoulli distribution Bern(p)\mathrm{Bern}(p) is the single-trial case with E=pE = p and Var=p(1−p)\mathrm{Var} = p (1 - p).

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Exam-style questions

What this dot point is asking

QCAA wants you to define a discrete random variable, identify and work with its probability distribution, compute the expected value and variance, and recognise the Bernoulli distribution as the simplest case (a single yes or no trial). This dot point underpins the rest of Topic 5 and feeds directly into the binomial distribution.

The answer

Random variables

A random variable XX assigns a numerical value to each outcome of a probability experiment. A random variable is discrete if its possible values form a countable set (typically a list of integers).

The probability distribution of XX is the list of possible values together with their probabilities, often shown as a table.

xx x1x_1 x2x_2 …\ldots xnx_n
P(X=x)P(X = x) p1p_1 p2p_2 …\ldots pnp_n

For this to be a valid distribution, the probabilities must satisfy two conditions.

  1. Non-negativity. pi≥0p_i \geq 0 for every ii.
  2. Normalisation. ∑ipi=1\sum_i p_i = 1.

QCAA Paper 1 questions frequently give a partial distribution with an unknown kk and ask you to use the normalisation condition to solve for kk.

Expected value

The expected value (or mean) of XX is the probability-weighted average of its values:

E(X)=μ=∑ixi P(X=xi).E(X) = \mu = \sum_i x_i \, P(X = x_i).

Interpretation: the long-run average of XX over many independent repetitions.

For any constants aa and bb:

E(aX+b)=aE(X)+b.E(a X + b) = a E(X) + b.

Variance and standard deviation

The variance measures spread around the mean.

Var(X)=σ2=E((X−μ)2)=∑i(xi−μ)2 P(X=xi).\mathrm{Var}(X) = \sigma^2 = E\bigl( (X - \mu)^2 \bigr) = \sum_i (x_i - \mu)^2 \, P(X = x_i).

The computational shortcut (the version you should use on Paper 1 and Paper 2) is

Var(X)=E(X2)−[E(X)]2,\mathrm{Var}(X) = E(X^2) - [E(X)]^2,

where E(X2)=∑ixi2 P(X=xi)E(X^2) = \sum_i x_i^2 \, P(X = x_i).

The standard deviation is σ=Var(X)\sigma = \sqrt{\mathrm{Var}(X)}.

For any constants aa and bb:

Var(aX+b)=a2 Var(X).\mathrm{Var}(a X + b) = a^2 \, \mathrm{Var}(X).

The bb disappears (a shift does not change spread) and the aa squares (a scale multiplies variance by a2a^2).

The Bernoulli distribution

A Bernoulli trial has exactly two outcomes, labelled success (X=1X = 1) and failure (X=0X = 0), with probability pp of success.

P(X=1)=p,P(X=0)=1−pP(X = 1) = p, \qquad P(X = 0) = 1 - p

Write X∼Bern(p)X \sim \mathrm{Bern}(p). Then

E(X)=p,Var(X)=p(1−p).E(X) = p, \qquad \mathrm{Var}(X) = p (1 - p).

The Bernoulli distribution is the building block of the binomial: a binomial Bin(n,p)\mathrm{Bin}(n, p) is the sum of nn independent Bernoulli trials with the same pp.

Worked example

Four tasks building from a validity check through to Bernoulli, using the distribution P(X=1)=0.4P(X = 1) = 0.4, P(X=2)=0.4P(X = 2) = 0.4, P(X=5)=0.2P(X = 5) = 0.2.

Step 1: Check whether a claimed distribution is valid

A student proposes P(X=1)=0.2P(X = 1) = 0.2, P(X=2)=0.5P(X = 2) = 0.5, P(X=3)=0.4P(X = 3) = 0.4. The normalisation condition requires all probabilities to sum to exactly 11.

0.2+0.5+0.4=1.1≠10.2 + 0.5 + 0.4 = 1.1 \neq 1

This is not a valid distribution. The probabilities exceed 11 in total, violating the normalisation condition.

Step 2: Compute the expected value and variance from a table

For the distribution P(X=1)=0.4P(X = 1) = 0.4, P(X=2)=0.4P(X = 2) = 0.4, P(X=5)=0.2P(X = 5) = 0.2, the expected value is the probability-weighted sum of values.

E(X)=1×0.4+2×0.4+5×0.2=0.4+0.8+1.0=2.2E(X) = 1 \times 0.4 + 2 \times 0.4 + 5 \times 0.2 = 0.4 + 0.8 + 1.0 = 2.2

To find the variance, we first compute E(X2)E(X^2) by weighting each squared value.

E(X2)=12×0.4+22×0.4+52×0.2=0.4+1.6+5.0=7.0E(X^2) = 1^2 \times 0.4 + 2^2 \times 0.4 + 5^2 \times 0.2 = 0.4 + 1.6 + 5.0 = 7.0

The variance shortcut avoids computing (xi−μ)2(x_i - \mu)^2 for each term.

Var(X)=E(X2)−[E(X)]2=7.0−(2.2)2=7.0−4.84=2.16\mathrm{Var}(X) = E(X^2) - [E(X)]^2 = 7.0 - (2.2)^2 = 7.0 - 4.84 = 2.16

Final answer: E(X)=2.2E(X) = 2.2, Var(X)=2.16\mathrm{Var}(X) = 2.16, and σ=2.16≈1.47\sigma = \sqrt{2.16} \approx 1.47.

Step 3: Apply a linear transformation

Using the results from Step 2, find E(3X+1)E(3X + 1) and Var(3X+1)\mathrm{Var}(3X + 1). The linearity rule E(aX+b)=aE(X)+bE(aX + b) = aE(X) + b applies, and for variance, the additive constant bb disappears while the scale factor is squared.

E(3X+1)=3×2.2+1=7.6E(3X + 1) = 3 \times 2.2 + 1 = 7.6

Var(3X+1)=32×2.16=9×2.16=19.44\mathrm{Var}(3X + 1) = 3^2 \times 2.16 = 9 \times 2.16 = 19.44

Step 4: Identify and use the Bernoulli distribution

A Bernoulli trial has a single success (with probability pp) or failure. For X∼Bern(0.4)X \sim \mathrm{Bern}(0.4), the standard formulas E(X)=pE(X) = p and Var(X)=p(1−p)\mathrm{Var}(X) = p(1 - p) apply directly.

E(X)=0.4,Var(X)=0.4×0.6=0.24E(X) = 0.4, \qquad \mathrm{Var}(X) = 0.4 \times 0.6 = 0.24

Common traps
Forgetting the normalisation check
A discrete distribution must have probabilities that sum to exactly 1. Forgetting to set this up costs the first mark when QCAA gives an unknown kk.
Confusing E(X2)E(X^2) and [E(X)]2[E(X)]^2
The variance shortcut is E(X2)−[E(X)]2E(X^2) - [E(X)]^2, where the first term squares each xx before weighting and the second squares after weighting. They are not equal.
Dropping the square on the scale factor
Var(aX+b)=a2 Var(X)\mathrm{Var}(a X + b) = a^2 \, \mathrm{Var}(X), not a Var(X)a \, \mathrm{Var}(X).
Computing standard deviation but stopping at variance
If QCAA asks for standard deviation, take the square root.
Naming Bernoulli when you mean binomial
A Bernoulli is a single trial. A binomial is nn trials. Mixing the two is a frequent IA2 short response error.
Using negative probabilities
A probability cannot be negative. If your algebra produces a negative pp, you have set up the problem wrongly.

Exam-style questions

Questions in the style of QCAA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

Practice5 marks
A discrete random variable XX has the probability distribution shown below, where kk is a constant. (a) Find the value of kk. (b) Find E(X)E(X). (c) Find Var(X)\mathrm{Var}(X). | xx | 0 | 1 | 2 | 3 | |-----|---|---|---|---| | P(X=x)P(X = x) | 0.10.1 | 0.30.3 | kk | 0.20.2 |
Show worked answer →

A 5-mark answer needs the normalisation, the expected value, and the variance.

(a) Probabilities sum to 1: 0.1+0.3+k+0.2=1  ⟹  k=0.40.1 + 0.3 + k + 0.2 = 1 \implies k = 0.4.

(b) E(X)=∑x P(X=x)=0⋅0.1+1⋅0.3+2⋅0.4+3⋅0.2=0+0.3+0.8+0.6=1.7E(X) = \sum x \, P(X = x) = 0 \cdot 0.1 + 1 \cdot 0.3 + 2 \cdot 0.4 + 3 \cdot 0.2 = 0 + 0.3 + 0.8 + 0.6 = 1.7.

(c) E(X2)=02⋅0.1+12⋅0.3+22⋅0.4+32⋅0.2=0+0.3+1.6+1.8=3.7E(X^2) = 0^2 \cdot 0.1 + 1^2 \cdot 0.3 + 2^2 \cdot 0.4 + 3^2 \cdot 0.2 = 0 + 0.3 + 1.6 + 1.8 = 3.7.

Var(X)=E(X2)−[E(X)]2=3.7−(1.7)2=3.7−2.89=0.81\mathrm{Var}(X) = E(X^2) - [E(X)]^2 = 3.7 - (1.7)^2 = 3.7 - 2.89 = 0.81.

Markers reward the normalisation step, the correct E(X)E(X) calculation, use of the shortcut Var(X)=E(X2)−[E(X)]2\mathrm{Var}(X) = E(X^2) - [E(X)]^2 (rather than the longer first-principles formula), and a numerical answer to a reasonable number of decimal places.

Practice3 marks
A biased coin lands heads with probability 0.70.7. Let X=1X = 1 if the coin lands heads, X=0X = 0 if it lands tails. State the distribution of XX and find E(X)E(X) and Var(X)\mathrm{Var}(X).
Show worked answer →

XX is a Bernoulli random variable with parameter p=0.7p = 0.7, written X∼Bern(0.7)X \sim \mathrm{Bern}(0.7).

E(X)=p=0.7E(X) = p = 0.7 and Var(X)=p(1−p)=0.7⋅0.3=0.21\mathrm{Var}(X) = p (1 - p) = 0.7 \cdot 0.3 = 0.21.

To verify: E(X)=0⋅0.3+1⋅0.7=0.7E(X) = 0 \cdot 0.3 + 1 \cdot 0.7 = 0.7 and E(X2)=0⋅0.3+1⋅0.7=0.7E(X^2) = 0 \cdot 0.3 + 1 \cdot 0.7 = 0.7, so Var(X)=0.7−0.49=0.21\mathrm{Var}(X) = 0.7 - 0.49 = 0.21.

Markers reward naming the distribution explicitly (Bernoulli with p=0.7p = 0.7), the standard formulas E=pE = p and Var=p(1−p)\mathrm{Var} = p (1 - p), and a check by direct calculation. Stating X∼Bern(p)X \sim \mathrm{Bern}(p) in shorthand notation also earns recognition.

Practise this

Sources & how we know this

ExamExplained