← Year 12: Statistical Analysis

NSWMaths AdvancedSyllabus dot point

How do we describe a discrete random variable and summarise its distribution with mean and variance?

Define a discrete random variable by its probability distribution, and calculate the expected value, variance and standard deviation

A focused answer to the HSC Maths Advanced dot point on discrete random variables. Probability distributions, expected value, variance, standard deviation, and linear transformations of a discrete random variable, with worked examples.

Generated by Claude OpusReviewed by Better Tuition Academy9 min answer

Have a quick question? Jump to the Q&A page

What this dot point is asking

NESA wants you to recognise a discrete random variable, check that its probability distribution is valid, compute the expected value and variance from the distribution, and apply the linear transformation rules to aX+ba X + b.

The answer

Discrete random variables and their distributions

A discrete random variable XX takes a countable list of values x1,x2,…,xnx_1, x_2, \dots, x_n with probabilities pi=P(X=xi)p_i = P(X = x_i). The list of values with their probabilities is the probability distribution of XX. For it to be valid:

  • IMATH_11 for every ii,
  • IMATH_13 .

The probability that XX falls in some set is the sum of pip_i for the values in that set. For example, P(X≀2)=P(X=0)+P(X=1)+P(X=2)P(X \le 2) = P(X = 0) + P(X = 1) + P(X = 2) if XX takes integer values from 00.

Expected value

The expected value (or mean) of XX is the long-run average value if we repeated the experiment many times. It is the weighted sum

E(X)=ΞΌ=βˆ‘ixi pi.E(X) = \mu = \sum_i x_i \, p_i.

The expected value need not be one of the values XX can actually take.

Expected value of a function of IMATH_21

For any function gg,

E(g(X))=βˆ‘ig(xi) pi.E(g(X)) = \sum_i g(x_i) \, p_i.

The most common case is g(x)=x2g(x) = x^2, which gives

E(X2)=βˆ‘ixi2 pi.E(X^2) = \sum_i x_i^2 \, p_i.

Variance and standard deviation

The variance of XX measures spread around the mean. It is

Var(X)=Οƒ2=E((Xβˆ’ΞΌ)2)=βˆ‘i(xiβˆ’ΞΌ)2pi,\text{Var}(X) = \sigma^2 = E((X - \mu)^2) = \sum_i (x_i - \mu)^2 p_i,

which is algebraically equivalent (and usually easier to compute) as

Var(X)=E(X2)βˆ’[E(X)]2.\text{Var}(X) = E(X^2) - [E(X)]^2.

The standard deviation is Οƒ=Var(X)\sigma = \sqrt{\text{Var}(X)}, with the same units as XX.

Linear transformations

If Y=aX+bY = a X + b for constants aa and bb,

E(Y)=aE(X)+b,Var(Y)=a2Var(X),ΟƒY=∣aβˆ£ΟƒX.E(Y) = a E(X) + b, \qquad \text{Var}(Y) = a^2 \text{Var}(X), \qquad \sigma_Y = |a| \sigma_X.

Shifting XX by bb shifts the mean but not the spread. Scaling by aa multiplies the mean by aa and the standard deviation by ∣a∣|a|.

Worked examples

Checking a distribution and computing the mean

XX takes values 1,2,3,41, 2, 3, 4 with P(X=x)=cxP(X = x) = c x for some constant cc. Find cc, then E(X)E(X).

Sum of probabilities: c(1+2+3+4)=10c=1c(1 + 2 + 3 + 4) = 10 c = 1, so c=0.1c = 0.1.

E(X)=1(0.1)+2(0.2)+3(0.3)+4(0.4)=0.1+0.4+0.9+1.6=3E(X) = 1(0.1) + 2(0.2) + 3(0.3) + 4(0.4) = 0.1 + 0.4 + 0.9 + 1.6 = 3.

Variance via IMATH_44

With the same XX, E(X2)=1(0.1)+4(0.2)+9(0.3)+16(0.4)=0.1+0.8+2.7+6.4=10E(X^2) = 1(0.1) + 4(0.2) + 9(0.3) + 16(0.4) = 0.1 + 0.8 + 2.7 + 6.4 = 10.

Var(X)=10βˆ’32=1\text{Var}(X) = 10 - 3^2 = 1, so Οƒ=1\sigma = 1.

A fair die

XX is the number rolled on a fair six-sided die. E(X)=1+2+3+4+5+66=3.5E(X) = \frac{1 + 2 + 3 + 4 + 5 + 6}{6} = 3.5.

E(X2)=1+4+9+16+25+366=916E(X^2) = \frac{1 + 4 + 9 + 16 + 25 + 36}{6} = \frac{91}{6}.

Var(X)=916βˆ’3.52=916βˆ’494=182βˆ’14712=3512β‰ˆ2.92\text{Var}(X) = \frac{91}{6} - 3.5^2 = \frac{91}{6} - \frac{49}{4} = \frac{182 - 147}{12} = \frac{35}{12} \approx 2.92.

Linear transformation

If XX has ΞΌ=3.5\mu = 3.5 and Οƒ2=3512\sigma^2 = \frac{35}{12}, then Y=2X+1Y = 2 X + 1 has E(Y)=2(3.5)+1=8E(Y) = 2(3.5) + 1 = 8 and Var(Y)=4β‹…3512=353\text{Var}(Y) = 4 \cdot \frac{35}{12} = \frac{35}{3}.

Common traps

Forgetting to check that probabilities sum to 11. If a question gives a distribution in terms of a constant, solve βˆ‘pi=1\sum p_i = 1 first.

Using ΞΌ2\mu^2 instead of E(X2)E(X^2). The formula is Var(X)=E(X2)βˆ’[E(X)]2\text{Var}(X) = E(X^2) - [E(X)]^2, not E(X2)βˆ’E(X)E(X^2) - E(X).

Squaring inside but not outside. E(X)2=ΞΌ2E(X)^2 = \mu^2 is the square of a single number. E(X2)=βˆ‘x2pE(X^2) = \sum x^2 p is the weighted sum of squares. They are different.

Linear transformation on variance. Var(aX+b)=a2Var(X)\text{Var}(a X + b) = a^2 \text{Var}(X), not aVar(X)a \text{Var}(X), and the +b+ b has no effect on variance.

Negative variance. If you get a negative variance, you have a calculation error. Variance is always non-negative.

In one sentence

A discrete random variable is summarised by its probability distribution; its mean is E(X)=βˆ‘xipiE(X) = \sum x_i p_i, its variance is E(X2)βˆ’ΞΌ2E(X^2) - \mu^2, and linear transformations aX+ba X + b scale the mean by aa, shift it by bb, and scale the variance by a2a^2.

Past exam questions, worked

Real questions from past NESA papers on this dot point, with our answer explainer.

2022 HSC Q244 marksThe discrete random variable $X$ has probability distribution $P(X = 0) = 0.2$, $P(X = 1) = 0.5$, $P(X = 2) = 0.2$, $P(X = 3) = 0.1$. Find $E(X)$ and $\text{Var}(X)$.
Show worked answer β†’

E(X)=βˆ‘xP(X=x)=0β‹…0.2+1β‹…0.5+2β‹…0.2+3β‹…0.1=0+0.5+0.4+0.3=1.2E(X) = \sum x P(X = x) = 0 \cdot 0.2 + 1 \cdot 0.5 + 2 \cdot 0.2 + 3 \cdot 0.1 = 0 + 0.5 + 0.4 + 0.3 = 1.2.

For the variance, first compute E(X2)=0β‹…0.2+1β‹…0.5+4β‹…0.2+9β‹…0.1=0.5+0.8+0.9=2.2E(X^2) = 0 \cdot 0.2 + 1 \cdot 0.5 + 4 \cdot 0.2 + 9 \cdot 0.1 = 0.5 + 0.8 + 0.9 = 2.2.

Var(X)=E(X2)βˆ’[E(X)]2=2.2βˆ’1.44=0.76\text{Var}(X) = E(X^2) - [E(X)]^2 = 2.2 - 1.44 = 0.76.

Markers reward the explicit weighted sum for E(X)E(X), the use of E(X2)βˆ’ΞΌ2E(X^2) - \mu^2 for the variance, and clean arithmetic.

2021 HSC Q253 marksA discrete random variable $X$ has $E(X) = 5$ and $\text{Var}(X) = 4$. Let $Y = 3 X - 2$. Find $E(Y)$ and the standard deviation of $Y$.
Show worked answer β†’

Linearity of expectation: E(Y)=E(3Xβˆ’2)=3E(X)βˆ’2=3(5)βˆ’2=13E(Y) = E(3 X - 2) = 3 E(X) - 2 = 3(5) - 2 = 13.

Variance scales by the square of the coefficient and is unchanged by adding a constant: Var(Y)=Var(3Xβˆ’2)=9Var(X)=36\text{Var}(Y) = \text{Var}(3 X - 2) = 9 \text{Var}(X) = 36.

Standard deviation: ΟƒY=36=6\sigma_Y = \sqrt{36} = 6.

Markers expect explicit use of E(aX+b)=aE(X)+bE(a X + b) = a E(X) + b and Var(aX+b)=a2Var(X)\text{Var}(a X + b) = a^2 \text{Var}(X), with the standard deviation as the positive square root.

Related dot points