IB Maths AA HL
Topic 4 — Statistics & Probability
Paper 1 & 2
HL only
~7 min read
Median & Mode of a CRV
For a continuous random variable, the median m is the value that splits the area under the pdf in half: P(X ≤ m) = ½. The mode is the value of x where f(x) is largest — found by differentiating the pdf and solving f′(x) = 0, then comparing with the endpoints. For symmetric pdfs, the median sits at the line of symmetry — no integration needed.
📘 What you need to know
- Median definition: P(X ≤ m) = P(X ≥ m) = ½ — the area is split in half.
- Median equation: ∫−∞m f(x) dx = ½ (or the equivalent upper-tail version).
- Symmetric pdf → median = mean = mode = the axis of symmetry; no integration required.
- Mode definition: the value of x in the domain that produces the largest f(x).
- Smooth interior maximum: solve f′(x) = 0 and discard roots outside the domain.
- Endpoints matter: always check f(a) and f(b) — the mode could sit at a boundary.
- Piecewise pdf: first compute partial areas at each junction to find which piece contains the median.
- Multiple modes are possible if f has more than one local maximum — compare f-values to confirm.
The median of a CRV
Median definition
∫−∞m f(x) dx = 12
Two shortcuts make this easier than it looks:
Symmetry shortcut
f(a + x) = f(a − x)
median = axis of symmetry, no integration
Direct integration
∫am f(x) dx = ½
solve for m as the upper limit
The mode of a CRV
The mode is whichever x in the domain gives the largest f(x). For a smooth pdf, candidates come from two places:
- Interior critical points: solve f′(x) = 0 and keep only those inside the domain.
- Endpoints: check f(a) and f(b) directly.
Compare the f-value at each candidate; the largest wins. For more than one critical point, use the second derivative or simply test signs of f′ on either side.
Watch out: f′(x) = 0 can also produce minima or saddle points. If f′ = 0 gives the lowest f-value on the domain, the mode is at one of the endpoints.
Piecewise pdfs — which piece holds the median?
For a piecewise pdf you can’t just integrate from one end to m — the integrand changes at each junction. Compute the cumulative area at each junction first, then locate the median in whichever piece pushes the running total past ½.
🧭 Recipe — find the median or mode
- Sketch the pdf — symmetry tells you the median for free.
- For the median of a non-symmetric pdf: set up ∫ f(x) dx = ½ from the lower limit to m.
- For piecewise pdfs: compute partial areas at each junction first, then locate the piece holding the median.
- For the mode: differentiate f, solve f′(x) = 0, keep only roots inside the domain.
- Always compare f at every interior critical point AND both endpoints — biggest f-value wins.
Worked examples
WE 1Median by symmetry — no integration needed
The continuous random variable X has pdf f(x) = 34(1 − x²) for −1 ≤ x ≤ 1 (and 0 otherwise). Find the median of X.
Test for symmetry
f(−x) = (3/4)(1 − (−x)²) = (3/4)(1 − x²) = f(x)
→ f is symmetric about x = 0
Symmetric pdf → median = axis of symmetry
Median = 0
no need to integrate — symmetry does the whole job
WE 2Median of a linear pdf via integration
The continuous random variable X has pdf f(x) = 18x for 0 ≤ x ≤ 4 (and 0 otherwise). Find the median.
Set up median equation
∫₀^m (1/8)x dx = 1/2
[x²/16]₀^m = 1/2
m²/16 = 1/2
Solve for m
m² = 8
m = ±2√2 → take positive root (must be in [0, 4])
Median = 2√2 ≈ 2.83 (3 sf)
always reject the negative root if it falls outside the pdf’s domain
WE 3Median of a quadratic pdf — exact form
The continuous random variable X has pdf f(x) = 3x² for 0 ≤ x ≤ 1 (and 0 otherwise). Find the exact value of the median.
Set up median equation
∫₀^m 3x² dx = 1/2
[x³]₀^m = 1/2
m³ = 1/2
Take cube root
m = (1/2)^(1/3) = 2^(−1/3)
Rationalise: multiply by 2^(2/3)/2^(2/3)
m = 2^(2/3)/2 = ∛4 / 2
Median = ∛4 / 2 ≈ 0.794 (3 sf)
exact form is preferred when asked — leave the cube root in surd form
WE 4Median of a piecewise pdf
The continuous random variable X has pdf:
f(x) = 18x for 0 ≤ x ≤ 2;
f(x) = 14 for 2 ≤ x ≤ 5;
f(x) = 0 otherwise.
Find the median of X.
Step 1: find cumulative area at the junction x = 2
P(X ≤ 2) = ∫₀² (1/8)x dx = [x²/16]₀² = 4/16 = 1/4
1/4 < 1/2 → median lives in piece 2 (the constant region)
Step 2: build up to ½ in piece 2
1/4 + ∫₂^m (1/4) dx = 1/2
1/4 + (m − 2)/4 = 1/2
(m − 2)/4 = 1/4
m − 2 = 1 → m = 3
Median = 3
piecewise rule: ALWAYS check partial areas at junctions BEFORE integrating
WE 5Mode by differentiation — interior critical point
The continuous random variable X has pdf f(x) = 427x²(3 − x) for 0 ≤ x ≤ 3 (and 0 otherwise). Find the mode.
Expand: f(x) = (4/27)(3x² − x³)
Differentiate
f′(x) = (4/27)(6x − 3x²) = (4/27) · 3x(2 − x)
Solve f′(x) = 0
x = 0 or x = 2
Compare f at both critical points and endpoints
f(0) = 0; f(2) = (4/27)(4)(1) = 16/27 ≈ 0.59
f(3) = (4/27)(9)(0) = 0
Largest at x = 2
Mode = 2
always test the endpoints too — they’re free candidates
WE 6Mode at an endpoint — f′ = 0 gives a minimum
The continuous random variable X has pdf f(x) = 38(2 − x)² for 0 ≤ x ≤ 2 (and 0 otherwise). Find the mode.
Differentiate using chain rule
f′(x) = (3/8) · 2(2 − x) · (−1) = −(3/4)(2 − x)
Solve f′(x) = 0
2 − x = 0 → x = 2
Check this is in the domain — yes, x = 2 is an endpoint
f(2) = (3/8)(0)² = 0 → this is a MINIMUM, not a max!
Compare f at both endpoints
f(0) = (3/8)(2)² = (3/8)(4) = 3/2
f(2) = 0
Largest f at x = 0
Mode = 0
f′ = 0 doesn’t always give the mode — endpoint f-values can win
💡 Top tips
- Sketch first — symmetry can give the median for free; shape can give the mode at a glance.
- Reject roots outside the domain when solving for m — only one root usually survives.
- Always check endpoints when finding the mode; f′ = 0 doesn’t catch boundary maxima.
- For piecewise pdfs, the partial-area check at each junction tells you which piece holds m.
- Hidden polynomial: integral equations like m⁴ − 32m² + 128 = 0 often factor as quadratics in m².
⚠ Common mistakes
- Confusing median with mean — median splits area in half; mean is the integral ∫ xf(x) dx.
- Forgetting to check endpoints when finding the mode — f′ = 0 catches interior critical points only.
- Choosing the wrong root — if the equation gives ±m, only one will lie inside the pdf’s domain.
- Treating P(X = m) ≠ 0 — for a CRV it’s exactly 0; the median is well-defined regardless.
- For piecewise: integrating from the lower limit to m without first checking which piece m is in.
Final sub-section: Mean & Variance of a CRV. The mean is computed by E(X) = ∫ xf(x) dx — note the extra factor of x. Variance comes from Var(X) = E(X²) − [E(X)]², and the linear transformation rules (E(aX + b) = aE(X) + b, Var(aX + b) = a²Var(X)) carry over from discrete random variables unchanged.
Need help with Statistics & Probability?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.
Book Free Session →