Cambridge International AS & A Level · Topic 4.1
A-Level Further Maths 9231 / Topic 4.1 / AS & A Level

Area under f, height of F.

A probability density function describes a continuous random variable by area; its cumulative distribution function \(F(x) = P(X \le x)\) adds that area up as you move to the right. Learn to move between the two, including for pdfs defined in pieces, and use whichever is quicker to find probabilities, the median, quartiles, percentiles and the mode.

The key idea

A pdf \(f\) satisfies \(f(x) \ge 0\) everywhere and \(\displaystyle\int f(x)\,dx = 1\) over its whole range. The CDF is \(F(x) = P(X \le x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt\), so \(f(x) = F'(x)\). Then \(P(a < X < b) = F(b) - F(a)\), and the \(p\)th percentile is the value \(q\) with \(F(q) = p\) (the median solves \(F(m) = 0.5\)). The mode is where \(f\) is greatest.

x f(x) 1 2 3 0 ¼ ½ area ½ area ½ f(x) = ¼x f(x) = ½ x F(x) 1 2 3 0 ½ ¾ 1 m = 2 Q₃ = 2.5 ⅛x² ½x − ½ pdf CDF
Fig. 1: the piecewise pdf f(x) = x/4 for 0 ≤ x ≤ 2, f(x) = 1/2 for 2 < x ≤ 3 (left) and its CDF (right). Each piece of the pdf has area 1/2, so F(2) = 1/2 and the median is 2. F rises from 0 to 1, is continuous, is steepest where f is largest, and is flat at 0 and 1 outside the range
Section 01

What makes a valid pdf.

For a continuous random variable \(X\), probability is area under the pdf: \(P(a < X < b) = \displaystyle\int_{a}^{b} f(x)\,dx\). Any single value has probability zero, so \(<\) and \(\le\) give the same answer. A function is a pdf only if it is never negative and its total area is 1. In Further Mathematics the pdf is often defined piecewise: a different formula on each interval, and \(0\) outside them. Find the total area by integrating each piece over its own interval and adding.

Worked example Find k, then a probability
\(X\) has pdf \(f(x) = k(4x - x^{2})\) for \(0 \le x \le 3\), and \(f(x) = 0\) otherwise. Find \(k\) and \(P(X < 1)\).
  1. \(4x - x^{2} = x(4 - x) \ge 0\) on \(0 \le x \le 3\), so \(f\) is non-negative when \(k > 0\).
  2. \[\int_{0}^{3} (4x - x^{2})\,dx = \Big[2x^{2} - \tfrac{1}{3}x^{3}\Big]_{0}^{3} = 18 - 9 = 9\]
  3. Total area 1: \(9k = 1\), so \(k = \dfrac{1}{9}\).
  4. \[P(X < 1) = \frac{1}{9}\Big[2x^{2} - \tfrac{1}{3}x^{3}\Big]_{0}^{1} = \frac{1}{9}\cdot\frac{5}{3}\]
Answer: \(k = \dfrac{1}{9}\), \(P(X < 1) = \dfrac{5}{27}\)
Worked example A piecewise pdf
\(X\) has pdf \(f(x) = kx\) for \(0 \le x \le 2\), \(f(x) = \tfrac{1}{2}k(6 - x)\) for \(2 < x \le 6\), and \(0\) otherwise. Find \(k\) and sketch \(f\).
  1. \[\int_{0}^{2} kx\,dx = \Big[\tfrac{1}{2}kx^{2}\Big]_{0}^{2} = 2k\]
  2. \[\int_{2}^{6} \tfrac{1}{2}k(6 - x)\,dx = \tfrac{1}{2}k\Big[6x - \tfrac{1}{2}x^{2}\Big]_{2}^{6} = \tfrac{1}{2}k(18 - 10) = 4k\]
  3. Total area: \(2k + 4k = 6k = 1\), so \(k = \dfrac{1}{6}\).
  4. Sketch: a triangle rising from \((0, 0)\) to a peak \(\left(2, \tfrac{1}{3}\right)\), then falling to \((6, 0)\); zero elsewhere. As a check, the triangle's area is \(\tfrac{1}{2} \times 6 \times \tfrac{1}{3} = 1\).
Answer: \(k = \dfrac{1}{6}\); \(f(x) = \dfrac{x}{6}\) on \([0, 2]\) and \(\dfrac{6 - x}{12}\) on \((2, 6]\)
Your turn
\(X\) has pdf \(f(x) = k(x + 1)\) for \(0 \le x \le 2\), and \(0\) otherwise. Find \(k\).
Examiner trap

Area 1 is not enough. \(f(x) = x - \tfrac{1}{2}\) on \(0 \le x \le 2\) has total area exactly 1, but it is negative for \(0 \le x < \tfrac{1}{2}\), so it is NOT a pdf. Always check the sign of every piece as well as the area.

Section 02

From pdf to CDF and back.

The CDF is the running total of area: \(F(x) = P(X \le x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt\). It starts at \(0\), never decreases, and reaches \(1\). Always write \(F\) for every real \(x\): \(F(x) = 0\) below the range and \(F(x) = 1\) above it. Going the other way, differentiate: \(f(x) = F'(x)\) on each piece. For probabilities, \(P(a < X \le b) = F(b) - F(a)\), with no integration needed once you have \(F\).

For a piecewise pdf, each piece of \(F\) must start where the previous piece ended, so that \(F\) is continuous. On the second interval, add the area already collected:

\[F(x) = F(2) + \int_{2}^{x} f(t)\,dt \quad \text{for } 2 \le x \le 3.\]
Worked example CDF of the piecewise pdf in Fig. 1
\(X\) has pdf \(f(x) = \tfrac{1}{4}x\) for \(0 \le x \le 2\), \(f(x) = \tfrac{1}{2}\) for \(2 < x \le 3\), and \(0\) otherwise. Find \(F(x)\) and hence \(P(1 < X < 2.4)\).
  1. For \(0 \le x \le 2\): \(F(x) = \displaystyle\int_{0}^{x} \tfrac{1}{4}t\,dt = \tfrac{1}{8}x^{2}\), so \(F(2) = \tfrac{1}{2}\).
  2. For \(2 \le x \le 3\): \[F(x) = \tfrac{1}{2} + \int_{2}^{x} \tfrac{1}{2}\,dt = \tfrac{1}{2} + \tfrac{1}{2}(x - 2) = \tfrac{1}{2}x - \tfrac{1}{2}\]
  3. Check: \(F(3) = \tfrac{3}{2} - \tfrac{1}{2} = 1\). Then \(F(x) = 0\) for \(x < 0\) and \(F(x) = 1\) for \(x > 3\).
  4. \(P(1 < X < 2.4) = F(2.4) - F(1) = (1.2 - 0.5) - \tfrac{1}{8} = 0.7 - 0.125\).
Answer: \(F(x) = 0\) for \(x < 0\); \(\tfrac{1}{8}x^{2}\) for \(0 \le x \le 2\); \(\tfrac{1}{2}x - \tfrac{1}{2}\) for \(2 < x \le 3\); \(1\) for \(x > 3\). \(P(1 < X < 2.4) = 0.575\)
Worked example pdf from a CDF
\(X\) has CDF \(F(x) = 0\) for \(x < 1\), \(F(x) = \tfrac{1}{8}(x^{2} - 1)\) for \(1 \le x \le 3\), \(F(x) = 1\) for \(x > 3\). Find the pdf and \(P(1.5 < X < 2.5)\).
  1. Differentiate on \(1 \le x \le 3\): \(f(x) = \tfrac{1}{8}(2x) = \tfrac{1}{4}x\).
  2. Outside the range \(F\) is constant, so \(f(x) = 0\) there.
  3. \[P(1.5 < X < 2.5) = F(2.5) - F(1.5) = \frac{6.25 - 1}{8} - \frac{2.25 - 1}{8} = \frac{4}{8}\]
Answer: \(f(x) = \tfrac{1}{4}x\) for \(1 \le x \le 3\), \(0\) otherwise; \(P(1.5 < X < 2.5) = \tfrac{1}{2}\)
Your turn
\(X\) has CDF \(F(x) = \tfrac{1}{27}x^{3}\) for \(0 \le x \le 3\) (with \(0\) below and \(1\) above). Find \(f(x)\) and \(P(X > 2)\).
Examiner trap

Do not restart each piece of \(F\) from zero. Integrating \(\tfrac{1}{2}\) on its own gives \(\tfrac{1}{2}x\), and then \(F(3) = \tfrac{3}{2}\): impossible for a probability. Check that adjacent pieces agree at the boundary and that \(F\) equals 1 at the top of the range.

Stage 1 · Learn

Check your understanding

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

\(X\) has pdf \(f(x) = kx^{2}\) for \(0 \le x \le 3\), and \(0\) otherwise. Find \(k\).

Quick check+10 XP

\(X\) has CDF \(F(x) = \tfrac{1}{16}x^{2}\) for \(0 \le x \le 4\). Find \(P(1 < X < 3)\).

Quick check+10 XP

Which of these could NOT be a pdf on \(0 \le x \le 2\) (with \(f(x) = 0\) elsewhere)?

Quick check+10 XP

\(X\) has CDF \(F(x) = \tfrac{1}{8}x^{3}\) for \(0 \le x \le 2\). What is the pdf on this interval?

Section 03

Median, percentiles and the mode.

The median \(m\) splits the area in half: \(F(m) = 0.5\). In the same way the lower quartile solves \(F(q) = 0.25\), the upper quartile \(F(q) = 0.75\) and the 90th percentile \(F(q) = 0.9\). For a piecewise \(F\), first find \(F\) at the boundaries to see which piece contains the answer, then solve on that piece and keep only the root inside its interval. The mode is the value of \(x\) where \(f\) is greatest: use \(f'(x) = 0\) for a turning point, but also look at the ends of the intervals and at any jumps.

Worked example Median and quartiles of a piecewise pdf
For the triangular pdf \(f(x) = \tfrac{1}{6}x\) on \(0 \le x \le 2\), \(f(x) = \tfrac{1}{12}(6 - x)\) on \(2 < x \le 6\), find the median and the quartiles.
  1. \(F(x) = \tfrac{1}{12}x^{2}\) on \([0, 2]\), so \(F(2) = \tfrac{1}{3}\).
  2. On \([2, 6]\) it is quickest to use the area to the right of \(x\), a triangle: \[F(x) = 1 - \tfrac{1}{2}(6 - x)\cdot\tfrac{6 - x}{12} = 1 - \frac{(6 - x)^{2}}{24}\]
  3. Lower quartile: \(0.25 < \tfrac{1}{3}\), so use the first piece: \(\tfrac{1}{12}q^{2} = \tfrac{1}{4}\), \(q = \sqrt{3}\).
  4. Median: \(0.5 > \tfrac{1}{3}\), so use the second piece: \((6 - m)^{2} = 12\), \(6 - m = \pm 2\sqrt{3}\).
  5. \(m = 6 + 2\sqrt{3}\) lies outside \([2, 6]\), so \(m = 6 - 2\sqrt{3}\).
  6. Upper quartile: \((6 - q)^{2} = 6\), so \(q = 6 - \sqrt{6}\).
Answer: \(Q_{1} = \sqrt{3} \approx 1.73\), \(m = 6 - 2\sqrt{3} \approx 2.54\), \(Q_{3} = 6 - \sqrt{6} \approx 3.55\)
Worked example Mode, and comparing it with the median
\(X\) has pdf \(f(x) = \tfrac{4}{27}x^{2}(3 - x)\) for \(0 \le x \le 3\), and \(0\) otherwise. Find the mode, and show that the median is less than the mode.
  1. \(f(x) = \tfrac{4}{27}(3x^{2} - x^{3})\), so \(f'(x) = \tfrac{4}{27}(6x - 3x^{2}) = \tfrac{4}{9}x(2 - x)\).
  2. \(f'(x) = 0\) at \(x = 0\) or \(x = 2\); \(f(0) = f(3) = 0\) and \(f(2) = \tfrac{16}{27} > 0\), so the maximum is at \(x = 2\).
  3. \[F(x) = \frac{4}{27}\Big(x^{3} - \tfrac{1}{4}x^{4}\Big) = \frac{4x^{3} - x^{4}}{27}\]
  4. \(F(2) = \dfrac{32 - 16}{27} = \dfrac{16}{27} > \dfrac{1}{2}\): more than half the area lies below 2, so \(F(m) = \tfrac{1}{2}\) at some \(m < 2\).
Answer: Mode \(= 2\); since \(F(2) = \tfrac{16}{27} > 0.5\), the median is less than 2
Your turn
\(X\) has pdf \(f(x) = \tfrac{3}{8}x^{2}\) for \(0 \le x \le 2\). Find the 90th percentile.
Examiner trap

The median solves \(F(m) = 0.5\), NOT \(f(m) = 0.5\): the height of the pdf is not a probability. And when you solve a quadratic for a percentile, reject the root outside the interval of the piece you used, even if it is positive.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to AS & A Level Further Mathematics Paper 1 to 4 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

\(X\) has pdf \(f(x) = k\) for \(0 \le x < 1\), \(f(x) = \tfrac{1}{2}k(3 - x)\) for \(1 \le x \le 3\), and \(0\) otherwise. Find \(k\).

Exam style+20 XP

\(X\) has CDF \(F(x) = \tfrac{1}{8}(x^{2} + 2x)\) for \(0 \le x \le 2\). Find the median.

Exam style+20 XP

\(X\) has CDF \(F(x) = \tfrac{1}{4}x^{2}\) for \(0 \le x \le 1\), \(F(x) = \tfrac{1}{4}(2x - 1)\) for \(1 < x \le 2.5\), \(0\) below and \(1\) above. Find \(P(0.5 < X < 2)\).

Exam style+20 XP

\(X\) has pdf \(f(x) = \tfrac{1}{4}x(4 - x^{2})\) for \(0 \le x \le 2\). Find the mode.

Skill unlocked

Area under f, height of F.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Finding k, a pdf from a piecewise CDF, quartiles and percentiles, a full piecewise CDF, a pdf with two unknowns and a modelled waiting time.