Continuous random variables

S2 Topic 2, spec point by spec point (Continuous random variables). Each spec point has the method, worked examples written the way the mark scheme wants them, how the marks go and the mistakes that cost the most marks.

Spec2.1Continuous random variables

Understand the concept of a continuous random variable.

The idea

A continuous random variable can take any value in a range (a time, a length, a mass). There are infinitely many possible values, so the probability of any one exact value is 0:

\[P(X = a) = 0\]

Probabilities come from areas under a curve (the probability density function, 2.2). So \(P(X < a) = P(X \leqslant a)\): the end point doesn't matter.

one exact value

\(X\) is continuous. \(P(X = 5) = 0\).

  • B1 for 0 (WST02 Jan 2026 Q2b).
  • Model comments: e.g. "a model with \(f(x) = 0\) for \(x > 4\) says no component lasts longer than 4000 hours, which may not be realistic" (WST02 Jan 2017 Q4c).

Often asked as: one-mark parts inside a pdf question.

Using "\(\leqslant\)" vs "\(<\)" corrections from discrete distributions.

Spec2.2The probability density function and cumulative distribution function

Use the probability density function \(f(x)\), with \(P(a < X \leqslant b) = \int_a^b f(x)\,dx\), and the cumulative distribution function \(F(x_0) = P(X \leqslant x_0) = \int_{-\infty}^{x_0} f(x)\,dx\), for simple (possibly piecewise) polynomials.

The pdf

A function \(f(x)\) is a pdf if:

  1. \(f(x) \geqslant 0\) for all \(x\);
  2. the total area is 1: \(\int_{-\infty}^{\infty} f(x)\,dx = 1\).

\[P(a < X < b) = \int_a^b f(x)\,dx\]

Unknown constants come from "area \(= 1\)" (and any other condition). Sketch the pdf: it shows the shape, the mode and the skew.

The cdf

\(F(x) = P(X \leqslant x)\) is the area to the left of \(x\). It rises from 0 to 1. Write it for all \(x\), piece by piece:

\[F(x) = \begin{cases} 0 & x < a \\ \int_a^x f(t)\,dt & a \leqslant x \leqslant b \\ 1 & x > b \end{cases}\]

For a piecewise pdf, each later piece of \(F\) must start from the value \(F\) has already reached, so \(F\) is continuous where the pieces join.

\(P(a < X < b) = F(b) - F(a)\).

constant, probability and cdf

\(f(x) = kx^2(4 - x)\) for \(0 \leqslant x \leqslant 4\), 0 otherwise. Find \(k\), \(P(X < 2)\) and \(F(x)\).

\(\displaystyle\int_0^4 k(4x^2 - x^3)\,dx = k\Big[\frac43x^3 - \frac14x^4\Big]_0^4 = k\left(\frac{256}{3} - 64\right) = \frac{64k}{3} = 1\), so \(k = \frac{3}{64}\).

\(F(x) = \frac{3}{64}\left(\frac43x^3 - \frac14x^4\right) = \frac{x^3}{16} - \frac{3x^4}{256}\) for \(0 \leqslant x \leqslant 4\) (0 below, 1 above).

\(P(X < 2) = F(2) = \frac12 - \frac{3}{16} = \frac{5}{16}\).

  • M1 for integrating with one term correct, A1 for the integral, A1 cso for substituting limits and equating to 1 (WST02 Jan 2021 Q4a).
  • Piecewise pdfs: M1 for an area equation, M1 for a condition like \(f(1) = 0\), dM1 for solving, A1 A1 (WST02 Jun 2017 Q3b).
  • Finding \(a\) with \(P(X > a) = 0.4\): M1 for \(F(a) = 0.6\), M1 for solving the quadratic, A1 with the invalid root rejected (WST02A Jan 2026 Q3a).

Often asked as: the second most examined S2 point (97 questions). Find constants; probabilities; the cdf for all values; sketch the pdf (WST02 May 2024 Q6c).

Leaving out the "0" and "1" parts of the cdf, or their ranges.

Forgetting to add the earlier area for later pieces of a piecewise cdf.

Spec2.3The relationship between f(x) and F(x)

Use \(f(x) = \dfrac{dF(x)}{dx}\).

The idea

Integrating \(f\) gives \(F\); differentiating \(F\) gives \(f\). So from a given cdf you can get the pdf (and then the mean, variance and mode).

At a join between pieces of \(F\), the two expressions must give the same value (continuity), which can be used to find an unknown.

pdf from cdf

\(F(x) = \dfrac{x^2 + x}{6}\) for \(0 \leqslant x \leqslant 2\) (0 below, 1 above). Find \(f(x)\) and \(a\) with \(P(X > a) = 0.4\).

\(f(x) = F'(x) = \frac{x}{3} + \frac16\) for \(0 \leqslant x \leqslant 2\), 0 otherwise.

\(F(a) = 0.6\): \(a^2 + a - 3.6 = 0\), so \(a = \dfrac{-1 + \sqrt{15.4}}{2} = 1.46\) (the negative root is outside the range).

  • M1 for differentiating \(F\), A1 for \(f\) with its range (WST02A Jan 2026 Q3b).
  • Joining pieces: M1 for setting the two cdf expressions equal at the join, A1 for the quadratic, M1 solve, A1 (WST02 Oct 2023 Q6b).
  • Finding the cdf from a piecewise pdf: M1 integrate with correct limits (or \(+c\) with \(F = 0\) or 1 at an end), B1 for the 0 and 1 lines, A1 A1 for the middle lines (WST02 Jan 2019 Q7c).

Often asked as: given \(F\), find \(f\), then \(E(X)\), the mode or a probability.

Forgetting to state \(f(x) = 0\) outside the range.

Spec2.4Mean and variance of continuous random variables

Find the mean and variance of a continuous random variable.

The formulas

\[E(X) = \int x f(x)\,dx \qquad E(X^2) = \int x^2 f(x)\,dx \qquad \text{Var}(X) = E(X^2) - [E(X)]^2\]

Integrate over the range where \(f(x) \neq 0\). They're the continuous versions of \(\sum xp\) and \(\sum x^2p\). The rules \(E(aX + b) = aE(X) + b\) and \(\text{Var}(aX + b) = a^2\text{Var}(X)\) still hold.

For a symmetric pdf, the mean is the line of symmetry.

mean and variance

\(f(x) = \frac{x}{3} + \frac16\) on \([0, 2]\). Find \(E(X)\) and \(\text{Var}(X)\).

\(E(X) = \displaystyle\int_0^2\left(\frac{x^2}{3} + \frac{x}{6}\right)dx = \Big[\frac{x^3}{9} + \frac{x^2}{12}\Big]_0^2 = \frac89 + \frac13 = \frac{11}{9}\).

\(E(X^2) = \Big[\frac{x^4}{12} + \frac{x^3}{18}\Big]_0^2 = \frac43 + \frac49 = \frac{16}{9}\). \(\text{Var}(X) = \frac{16}{9} - \frac{121}{81} = \frac{23}{81}\).

units in context

Lifetimes in thousands of hours have \(f(x) = \frac{3}{64}x^2(4 - x)\) on \([0, 4]\). \(E(X) = \frac{3}{64}\Big[x^4 - \frac{x^5}{5}\Big]_0^4 = 2.4\), so the mean lifetime is 2400 hours.

  • M1 for integrating \(xf(x)\) (powers up), A1 for the integral, A1 for the value; M1 for \(\int x^2f(x)\), A1ft, A1 for the variance (WST02A Jan 2026 Q3b).
  • Forgetting to convert "thousands of hours" loses the last mark (WST02 Jan 2017 Q4a).
  • Unknown constants from given \(E(X)\) or \(E(X^2)\): form equations and solve (WST02 Jan 2021 Q4b, WST02 May 2024 Q6).

Often asked as: mean and variance; constants from a given mean; \(E(3X - 2)\) etc.

\(\text{Var}(X) = \int x^2f(x)\,dx\) without subtracting \([E(X)]^2\).

Spec2.5Mode, median and quartiles

Find the mode, median and quartiles of a continuous random variable.

The definitions

Choose the root that lies in the range of the variable.

Skewness

Compare the mean, median and mode: mean \(<\) median \(<\) mode means negative skew; mean \(>\) median \(>\) mode means positive skew.

mode, median, skew

\(f(x) = \frac{3}{64}(4x^2 - x^3)\) on \([0, 4]\), with \(E(X) = 2.4\). Find the mode and median, and describe the skew.

\(f'(x) = \frac{3}{64}(8x - 3x^2) = 0 \Rightarrow x = \frac83\): mode \(= 2.67\).

Median: \(\frac{m^3}{16} - \frac{3m^4}{256} = 0.5\). Solving numerically, \(m = 2.46\).

Mean \(2.4 <\) median \(2.46 <\) mode \(2.67\): negative skew.

  • Mode: B1 from a sketch or M1 A1 by differentiating (WST02A Jan 2026 Q6b); pdfs from cdfs must be differentiated first (WST02 Oct 2021 Q3d).
  • Skewness: M1 for a justification comparing mean, median and/or mode (comparing with 0.5 is M0), A1ft (WST02 Jun 2025 Q1e).
  • Quartiles read from \(F\): e.g. if \(F(1) = \frac14\), then \(Q_1 = 1\) (WST02 Jan 2016 Q4c).

Often asked as: mode, median, quartiles, and skewness; show the median lies between two values (sign change).

Taking the mode as where \(F\) is greatest.

Solving \(f(m) = 0.5\) instead of \(F(m) = 0.5\).