All revision notes topics

4.14 Discrete and continuous random variablesIB Maths: Analysis and Approaches HL: Revision notes

Section 1

Mean and variance of a discrete random variable

For a discrete random variable XX: E(X)=∑x P(X=x),E(X2)=∑x2 P(X=x),E(X) = \sum x\,P(X = x), \qquad E(X^2) = \sum x^2\,P(X = x), Var(X)=E(X2)−[E(X)]2=E((X−μ)2).\mathrm{Var}(X) = E(X^2) - [E(X)]^2 = E\big((X - \mu)^2\big). The standard deviation is Var(X)\sqrt{\mathrm{Var}(X)}.

Example: P(X=0,1,2,3)=0.1,0.3,0.4,0.2P(X = 0, 1, 2, 3) = 0.1, 0.3, 0.4, 0.2 gives E(X)=1.7E(X) = 1.7, E(X2)=3.7E(X^2) = 3.7 and Var(X)=3.7−2.89=0.81\mathrm{Var}(X) = 3.7 - 2.89 = 0.81.

Key termsexpected valuevariancestandard deviation
Common mistake

Writing E(X2)=[E(X)]2E(X^2) = [E(X)]^2. Square each value before weighting: E(X2)=∑x2P(X=x)E(X^2) = \sum x^2P(X = x).

Section 2

Linear transformations and fair games

If aa and bb are constants: E(aX+b)=aE(X)+b,Var(aX+b)=a2 Var(X).E(aX + b) = aE(X) + b, \qquad \mathrm{Var}(aX + b) = a^2\,\mathrm{Var}(X). Adding bb shifts every value, so it changes the mean but not the spread. Multiplying by aa scales the standard deviation by ∣a∣|a| and the variance by a2a^2.

A game is fair if the player's expected gain is 0. If a player pays 8 dollars and wins 5 dollars per point, the gain is Y=5X−8Y = 5X - 8, so E(Y)=5(1.7)−8=0.5≠0E(Y) = 5(1.7) - 8 = 0.5 \neq 0: not fair, it favours the player.

Key termsfair gamelinear transformation
Common mistake

Writing Var(aX+b)=a Var(X)+b\mathrm{Var}(aX + b) = a\,\mathrm{Var}(X) + b. The constant bb disappears and aa is squared.

Section 3

Continuous random variables and pdfs

A continuous random variable is described by a probability density function (pdf) f(x)f(x) with f(x)≥0 for all x,∫−∞∞f(x) dx=1.f(x) \ge 0 \text{ for all } x, \qquad \int_{-\infty}^{\infty} f(x)\,dx = 1. Probabilities are areas: P(a<X<b)=∫abf(x) dxP(a < X < b) = \int_a^b f(x)\,dx. For any single value, P(X=a)=0P(X = a) = 0, so << and ≤\le give the same probability.

A pdf may be piecewise: integrate each piece over its own interval and add. For f(x)=kxf(x) = kx on [0,2][0, 2] and k(6−x)2\frac{k(6 - x)}{2} on (2,6](2, 6]: 2k+4k=12k + 4k = 1, so k=16k = \frac{1}{6}.

Key termsprobability density functionpiecewise function
Exam tip

To find an unknown constant in a pdf, set the total integral equal to 1.

Common mistake

Reading f(a)f(a) as a probability. The height of a pdf is a density, and it can be greater than 1.

Section 4

Mode and median of a continuous random variable

The mode is the value of xx where f(x)f(x) is greatest. Find it by differentiating and checking for a maximum, and remember to compare with the endpoints. For f(x)=427x2(3−x)f(x) = \frac{4}{27}x^2(3 - x): 6x−3x2=06x - 3x^2 = 0 gives the mode x=2x = 2.

The median mm satisfies ∫−∞mf(x) dx=12.\int_{-\infty}^{m} f(x)\,dx = \frac{1}{2}. For a piecewise pdf, first find which piece contains mm by working out the probability of the first piece. If the equation gives two roots, reject the one outside the domain.

Key termsmodemedian
Exam tip

For the bus pdf, P(X≤2)=13P(X \le 2) = \frac{1}{3}, so the median is beyond 2: m=6−23≈2.54m = 6 - 2\sqrt{3} \approx 2.54.

Section 5

Mean and variance of a continuous random variable

Replace sums by integrals: E(X)=∫−∞∞xf(x) dx,E(X2)=∫−∞∞x2f(x) dx,Var(X)=E(X2)−[E(X)]2.E(X) = \int_{-\infty}^{\infty} x f(x)\,dx, \qquad E(X^2) = \int_{-\infty}^{\infty} x^2 f(x)\,dx, \qquad \mathrm{Var}(X) = E(X^2) - [E(X)]^2. In practice you only integrate over the interval where f(x)≠0f(x) \neq 0. For f(t)=t8f(t) = \frac{t}{8} on [0,4][0, 4]: E(T)=83E(T) = \frac{8}{3}, E(T2)=8E(T^2) = 8, Var(T)=89\mathrm{Var}(T) = \frac{8}{9}.

The linear transformation rules hold for continuous variables too: a charge C=3+2.5TC = 3 + 2.5T has E(C)=293E(C) = \frac{29}{3} and Var(C)=6.25×89\mathrm{Var}(C) = 6.25\times\frac{8}{9}.

Exam tip

On Paper 2 you may use a GDC to evaluate these integrals, but write down the integral you are evaluating to earn the method mark.

Must know

  • Discrete: E(X)=∑xP(X=x)E(X) = \sum xP(X = x), Var(X)=E(X2)−[E(X)]2\mathrm{Var}(X) = E(X^2) - [E(X)]^2.
  • E(aX+b)=aE(X)+bE(aX + b) = aE(X) + b; Var(aX+b)=a2Var(X)\mathrm{Var}(aX + b) = a^2\mathrm{Var}(X).
  • Fair game: expected gain =0= 0.
  • pdf: f(x)≥0f(x) \ge 0 and total area 1; probabilities are integrals.
  • Mode: maximum of ff. Median: area up to mm is 12\frac{1}{2}.
  • Continuous mean and variance: ∫xf(x) dx\int x f(x)\,dx and ∫x2f(x) dx−μ2\int x^2 f(x)\,dx - \mu^2.

That's the notes covered.

Carry on to the next subtopic.