M
hscscience Maths Adv · Y12
0/100daily goal
0
0
0 due
0
L1 · 0 XP
KJ
Your weak spots
Insights load after your first practice round.
MAV-12-07 · Continuous random variables ~45 min ⚡ +95 XP available

Quantiles, Expectation and Variance

Every summary statistic you built for a discrete variable now returns, with the sum replaced by an integral. The median and quartiles come out of the cumulative function by solving an equation; the mean and variance come out of the density by integrating. This completes the continuous toolkit.

Today's hook, The mean, the median and the mode are three different answers to "where is the middle". For a symmetric distribution they coincide. For a skewed one they can be far apart, and which one a report quotes is often a choice about what it wants you to believe.
0/5QUESTS
1

Orient to the summaries

Commit to a prediction about three different middles.

01
Recall, your gut answer first
+5 XP warm-up

A distribution has a long tail stretching to the right. Without looking ahead predict the order of its mean, median and mode from smallest to largest, and say which of the three a news report would quote if it wanted the figure to sound large.

auto-saved
2

Quantiles from the CDF

Find the median and quartiles by solving F(x) = p.

02
Median and quartiles
core concept

We just saw that the CDF gives the accumulated probability below any value. That raises a question: quantiles ask the reverse — given an amount of accumulated probability, which value sits there? This card answers it → set $F$ equal to the required proportion and solve for $x$.

The median is the value with half the probability below it. The quartiles cut off a quarter and three quarters. Each is a value of $x$, read off by inverting the cumulative function.

$$F(Q_1) = 0.25, \qquad F(m) = 0.5, \qquad F(Q_3) = 0.75$$

The general form is $F(x_p) = p$, so any percentile works the same way. Because $F$ is non-decreasing and continuous, such a value always exists.

Worked through. Take $f(x) = \dfrac{x}{8}$ on $[0, 4]$, whose cumulative function is $F(x) = \dfrac{x^2}{16}$.

  • Median: $\dfrac{m^2}{16} = 0.5$, so $m^2 = 8$ and $m = 2\sqrt{2} \approx 2.828$.
  • Lower quartile: $\dfrac{Q_1^2}{16} = 0.25$, so $Q_1^2 = 4$ and $Q_1 = 2$.
  • Upper quartile: $\dfrac{Q_3^2}{16} = 0.75$, so $Q_3^2 = 12$ and $Q_3 = 2\sqrt{3} \approx 3.464$.

Only the positive root is taken in each case, because the domain is $[0, 4]$. Discarding the negative root is a step the marker expects to see, not an automatic one.

Interquartile range. $\text{IQR} = Q_3 - Q_1 = 2\sqrt{3} - 2 \approx 1.464$. The middle half of the distribution is squeezed into that width, well to the right of centre, which is the signature of a density that rises toward its upper end.

Quantiles come from the CDF: solve $F(x) = p$ for $x$. Median $p = 0.5$, $Q_1$ at $0.25$, $Q_3$ at $0.75$.; Reject any root outside the domain, and say that you have.

Pause, copy the quantile rule $F(x_p) = p$ with the three standard values of $p$, and the note about rejecting roots outside the domain, into your book.

Fill the blanks: $X$ is uniformly distributed on $[0, 10]$, so $F(x) = \dfrac{x}{10}$. Give each answer as a decimal.
median $=$
$Q_1 =$
$Q_3 =$

3

Expectation by integration

Replace the discrete sum with an integral.

03
The expected value of a continuous variable
core concept

We just saw quantiles obtained from the cumulative function. That raises a question: the mean was a probability-weighted sum in the discrete case, so what weights the values when there is no list to sum over? This card answers it → the density does, and the sum becomes an integral.

Set the two side by side, because the correspondence is the whole idea:

discretecontinuous
$E(X) = \sum x\,p(x)$$E(X) = \displaystyle\int_{a}^{b} x\,f(x)\,dx$
$\sum p(x) = 1$$\displaystyle\int_{a}^{b} f(x)\,dx = 1$
$$E(X) = \mu = \int_{a}^{b} x\,f(x)\,dx$$

The value $x$ is weighted by the density at $x$, and the integral accumulates those weighted values across the whole domain. Everything you know about the expected value carries over: it is the balance point of the density curve, it is a long-run average, and it need not be a value the variable is especially likely to take.

Worked through. For $f(x) = \dfrac{x}{8}$ on $[0, 4]$:

$E(X) = \displaystyle\int_{0}^{4} x \cdot \frac{x}{8}\,dx = \int_{0}^{4} \frac{x^2}{8}\,dx = \frac{1}{8}\left[\frac{x^3}{3}\right]_{0}^{4} = \frac{1}{8} \cdot \frac{64}{3} = \frac{8}{3} \approx 2.667$

Compare with the median $2\sqrt{2} \approx 2.828$ found above. The mean sits below the median here, because the density is heaviest at the right but drops to zero abruptly at $x = 4$ while trailing to zero gradually at the left.

Quick check: Which integral gives the expected value of a continuous random variable with density $f$ on $[a, b]$?

4

Variance by integration

Compute the variance and standard deviation by integration.

04
Var(X) for a continuous variable
core concept

We just saw the mean as $\int x f(x)\,dx$. That raises a question: the variance was the expected squared deviation, so does the same substitution work for it? This card answers it → it does, and the computational shortcut $E(X^2) - \mu^2$ survives unchanged.

$$\operatorname{Var}(X) = \int_{a}^{b} (x - \mu)^2 f(x)\,dx = \int_{a}^{b} x^2 f(x)\,dx - \mu^2$$

The right-hand form is the one to use. It needs $E(X^2) = \displaystyle\int_a^b x^2 f(x)\,dx$, which is no harder than the integral for the mean, and it avoids expanding a squared bracket inside the integral.

As always, $\operatorname{SD}(X) = \sigma = \sqrt{\operatorname{Var}(X)}$.

Worked through, continuing with $f(x) = \dfrac{x}{8}$ on $[0, 4]$, for which $\mu = \dfrac{8}{3}$:

$E(X^2) = \displaystyle\int_{0}^{4} x^2 \cdot \frac{x}{8}\,dx = \frac{1}{8}\left[\frac{x^4}{4}\right]_{0}^{4} = \frac{1}{8} \cdot 64 = 8$

$\operatorname{Var}(X) = 8 - \left(\dfrac{8}{3}\right)^2 = 8 - \dfrac{64}{9} = \dfrac{72 - 64}{9} = \dfrac{8}{9} \approx 0.889$

$\sigma = \sqrt{\dfrac{8}{9}} = \dfrac{2\sqrt{2}}{3} \approx 0.943$

The uniform case is worth memorising. For $X$ uniform on $[a, b]$, integration gives $E(X) = \dfrac{a+b}{2}$, the midpoint, and $\operatorname{Var}(X) = \dfrac{(b-a)^2}{12}$. Both are quotable, and both are quick to re-derive if you forget them.

$E(X) = \int_a^b x f(x)\,dx$ and $\operatorname{Var}(X) = \int_a^b x^2 f(x)\,dx - \mu^2$.; Continuous uniform on $[a,b]$: $E(X) = (a+b)/2$ and $\operatorname{Var}(X) = (b-a)^2/12$.

Pause, copy the two integral formulas for $E(X)$ and $\operatorname{Var}(X)$, together with the uniform results $(a+b)/2$ and $(b-a)^2/12$, into your book.

True or false: For a continuous random variable, the median is always equal to the mean.

5

Work the examples

Work three examples, then read the traps.

05
Worked examples
worked
PROBLEM 1 · ALL THREE MIDDLES

A density is $f(x) = \dfrac{3x^2}{8}$ on $0 \leq x \leq 2$, with cumulative function $F(x) = \dfrac{x^3}{8}$. Find the mode, the median and the mean, and comment on their order.

1
$f'(x) = \dfrac{6x}{8} > 0 \text{ on } (0, 2] \implies \text{mode} = 2$
The density increases across the whole domain, so its greatest value is at the right endpoint.
PROBLEM 2 · VARIANCE OF THAT DENSITY

For the same density $f(x) = \dfrac{3x^2}{8}$ on $[0, 2]$ with $\mu = \dfrac{3}{2}$, find $\operatorname{Var}(X)$ and $\sigma$.

1
$E(X^2) = \displaystyle\int_{0}^{2} x^2 \cdot \frac{3x^2}{8}\,dx = \frac{3}{8}\int_{0}^{2} x^4\,dx$
Multiply by $x^2$, not by $x$. Combining the powers first keeps the antiderivative simple.
PROBLEM 3 · DERIVING THE UNIFORM RESULTS

Show by integration that a variable uniform on $[a, b]$ has $E(X) = \dfrac{a+b}{2}$ and $\operatorname{Var}(X) = \dfrac{(b-a)^2}{12}$.

1
$E(X) = \displaystyle\int_{a}^{b} \frac{x}{b-a}\,dx = \frac{1}{b-a}\left[\frac{x^2}{2}\right]_{a}^{b} = \frac{b^2 - a^2}{2(b-a)}$
The density is the constant $\tfrac{1}{b-a}$, so it comes straight outside the integral.
6

When the integral is out of reach

Know what to do when the integral is beyond the course.

06
Densities you cannot integrate by hand
syllabus scope

We just saw $E(X)$ and $\operatorname{Var}(X)$ evaluated for polynomial densities. That raises a question: plenty of real densities produce integrals no Mathematics Advanced technique can do, so what then? This card answers it → the syllabus expects you to set the integral up correctly and evaluate it with a computational application.

The formulas are unchanged. What changes is who does the antidifferentiation. The syllabus divides the work in two:

Within the course
Polynomial densities, and simple exponential ones. Evaluate these by hand, showing the antiderivative and the substitution of both limits.
Beyond the course
Anything needing a technique you have not met. Set the integral up in full, then evaluate it using an online computational application and state that you did.
The mark is in the set-up
Correct limits, the right integrand ($xf(x)$ or $x^2f(x)$), and the subtraction of $\mu^2$. Those are what is being assessed either way.

The normal distribution, which the next lessons cover, is the standard example. Its density is $f(x) = \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}$, and even the plain area $\int f$ has no antiderivative expressible in elementary functions. That is precisely why the normal distribution is handled with tables and the empirical rule rather than by integration.

Odd one out: Three of these correctly describe a summary statistic of a continuous random variable. Which one is wrong?

7

Practise and reflect

Read the traps, work the quick-fire set, then revisit.

07
Where these marks are lost
exam technique
Trap 01
Integrating f instead of x f(x)
$\int_a^b f(x)\,dx$ is always 1, never the mean. If your expected value comes out as 1 for every density you meet, this is why.
Trap 02
Solving f(x) = 0.5 for the median
The median comes from the cumulative function: $F(m) = 0.5$. Setting the density to $0.5$ answers a question nobody asked, and often has no solution at all.
Trap 03
Keeping a root outside the domain
$m^2 = 8$ has two roots, and only $m = 2\sqrt{2}$ lies in $[0, 4]$. Say that you rejected the other, rather than silently dropping it.
Trap 04
Assuming the mean equals the median
They agree only for a symmetric density. For any skewed distribution they differ, and questions are built precisely on that gap.
08
Quick-fire set
practice
1

$X$ is uniform on $[4, 10]$. Write down $E(X)$ and $\operatorname{Var}(X)$ using the standard results.

2

$f(x) = \dfrac{1}{2}x$ on $[0, 2]$. Find $E(X)$ by integration.

3

$F(x) = \dfrac{x^2}{36}$ on $[0, 6]$. Find the median and the lower quartile exactly.

4

A student computes $E(X) = 3$ and $E(X^2) = 8$ for a continuous variable. Explain why one of these numbers must be wrong.

5

Explain in one sentence why the mean and median of a symmetric density must coincide.

Match each equation or integral to the statistic it produces:

  • $F(x) = 0.5$
  • $\int_{a}^{b} x f(x)\,dx$
  • $\int_{a}^{b} x^2 f(x)\,dx - \mu^2$
  • $F(x) = 0.75$
  • the variance
  • the upper quartile
  • the median
  • the expected value
09
Revisit your thinking

Earlier you were asked to order the mean, median and mode for a density with a long tail to the right, and which one a report would quote to sound large. The order is mode < median < mean. The mode sits at the peak, near the bulk of the data; the mean is dragged furthest toward the tail because the integral $\int x f(x)\,dx$ weights extreme values by how far out they are, while the median only counts how many lie beyond it. A report wanting a large figure quotes the mean — which is exactly why average income is usually reported as a mean and typical income as a median.

auto-saved
10
Where this goes next

The continuous toolkit is now complete: density, cumulative function, interval probability, quantiles, mean and variance. The remaining lessons apply all of it to one specific density, the normal, which models an enormous range of natural measurements. Its integral is beyond this course, which is why it is approached through the empirical rule and standardised scores rather than by integration.

Complete the short-answer practice

Apply the lesson methods, then compare each response with its comprehensive answer.

01
Focus-area checkpoint
checkpoint

Use the visible short-answer practice below during this lesson. After completing the focus area, use Checkpoint 3 for the checkpoint question bank.

02
Short answer
ApplyBand 43 marks

Q1. A continuous random variable has density $f(x) = \dfrac{x}{2}$ for $0 \leq x \leq 2$, and zero elsewhere.

(a) Find the cumulative distribution function $F(x)$ on $[0, 2]$. (b) Find the median exactly. (c) Find $E(X)$ and $\operatorname{Var}(X)$. (3 marks)

auto-saved
ApplyBand 53 marks

Q2. The lifetime $L$ hours of a component is modelled by the density $f(l) = \dfrac{3(4 - l)^2}{64}$ for $0 \leq l \leq 4$, and zero elsewhere.

(a) Verify that $f$ is a valid density. (b) Show that $F(l) = 1 - \dfrac{(4-l)^3}{64}$ and hence find the median lifetime, to two decimal places. (c) Find the mode, and explain in context what the gap between the mode and the median tells you about component lifetimes. (3 marks)

auto-saved
EvaluateBand 63 marks

Q3. Two councils report on household water use. Council A reports a mean of 640 litres per day; Council B reports a median of 480 litres per day. Both are drawing on the same continuous distribution, which is strongly skewed to the right.

(a) Explain, referring to the integral $\int x f(x)\,dx$, why the mean exceeds the median for a right-skewed distribution. (b) Each council claims its figure is "the typical household". Evaluate both claims. (c) A third analyst proposes reporting the interquartile range alongside the median. Explain what that adds, and describe how each quartile would be obtained from the distribution. (3 marks)

auto-saved
Comprehensive answers (click to reveal)

Drill 1: $E(X) = \tfrac{4 + 10}{2} = 7$ and $\operatorname{Var}(X) = \tfrac{(10-4)^2}{12} = \tfrac{36}{12} = 3$.

Drill 2: $E(X) = \int_0^2 x \cdot \tfrac{x}{2}\,dx = \tfrac{1}{2}\left[\tfrac{x^3}{3}\right]_0^2 = \tfrac{1}{2} \cdot \tfrac{8}{3} = \tfrac{4}{3} \approx 1.333$.

Drill 3: $F(m) = \tfrac{m^2}{36} = 0.5$ gives $m^2 = 18$, so $m = 3\sqrt{2} \approx 4.243$ (rejecting the negative root, which is outside $[0, 6]$). $F(Q_1) = 0.25$ gives $Q_1^2 = 9$, so $Q_1 = 3$.

Drill 4: $\operatorname{Var}(X) = E(X^2) - \mu^2 = 8 - 3^2 = -1$, and a variance can never be negative because it is an average of squared quantities. So at least one of the two values is wrong; in fact $E(X^2) \geq [E(X)]^2$ always holds, with equality only for a constant.

Drill 5: If the density is symmetric about $x = c$, then exactly half the area lies on each side of $c$, so $F(c) = 0.5$ and $c$ is the median; and the symmetric pairing of values equidistant from $c$ makes their contributions to $\int x f(x)\,dx$ average to $c$, so $c$ is also the mean.

Q1 (3 marks): (a) $F(x) = \int_0^x \tfrac{t}{2}\,dt = \tfrac{1}{2}\left[\tfrac{t^2}{2}\right]_0^x = \tfrac{x^2}{4}$ for $0 \leq x \leq 2$. Check $F(0) = 0$ ✓ and $F(2) = \tfrac{4}{4} = 1$ ✓ [1]. (b) $\tfrac{m^2}{4} = 0.5$ gives $m^2 = 2$, so $m = \sqrt{2} \approx 1.414$, rejecting $m = -\sqrt{2}$ which lies outside the domain [1]. (c) $E(X) = \int_0^2 x \cdot \tfrac{x}{2}\,dx = \tfrac{1}{2}\left[\tfrac{x^3}{3}\right]_0^2 = \tfrac{4}{3}$. $E(X^2) = \int_0^2 x^2 \cdot \tfrac{x}{2}\,dx = \tfrac{1}{2}\left[\tfrac{x^4}{4}\right]_0^2 = 2$. So $\operatorname{Var}(X) = 2 - \left(\tfrac{4}{3}\right)^2 = 2 - \tfrac{16}{9} = \tfrac{2}{9} \approx 0.222$ [1].

Q2 (3 marks): (a) $(4 - l)^2 \geq 0$ for all $l$, so $f \geq 0$ on $[0,4]$ ✓. And $\int_0^4 \tfrac{3(4-l)^2}{64}\,dl = \tfrac{3}{64}\left[-\tfrac{(4-l)^3}{3}\right]_0^4 = \tfrac{1}{64}\left[-(4-l)^3\right]_0^4 = \tfrac{1}{64}\left(0 + 64\right) = 1$ ✓ [1]. (b) $F(l) = \int_0^l \tfrac{3(4-t)^2}{64}\,dt = \tfrac{1}{64}\left[-(4-t)^3\right]_0^l = \tfrac{64 - (4-l)^3}{64} = 1 - \tfrac{(4-l)^3}{64}$ ✓. Setting $F(m) = 0.5$: $\tfrac{(4-m)^3}{64} = 0.5$, so $(4-m)^3 = 32$, giving $4 - m = \sqrt[3]{32} \approx 3.1748$ and $m \approx 0.83$ hours [1]. (c) $f'(l) = -\tfrac{6(4-l)}{64} < 0$ for $l < 4$, so $f$ is strictly decreasing and the mode is the left endpoint, $l = 0$. The mode at 0 with a median of only $0.83$ says most components fail very early, while a thin tail of survivors stretches out to 4 hours. Half of all components fail within the first 50 minutes, so a "typical" lifetime quoted as the mean would badly overstate what most users experience [1].

Q3 (3 marks): (a) $E(X) = \int x f(x)\,dx$ weights every value by how large it is as well as by its density. A household using 3000 litres contributes six times as much to the integral as one using 500, however few such households there are. The median counts only how many observations lie either side and is indifferent to how extreme they are. So a long right tail pulls the mean up while leaving the median almost unmoved [1]. (b) Council B's figure is the better description of a typical household: with strong right skew the median is where the middle household actually sits. Council A's mean of 640 is not wrong, but it is not typical — it is inflated by a minority of very heavy users, and more than half of all households use less than it. Council A's figure is the right one for a different question, namely total demand, since mean $\times$ number of households gives the total the network must supply [1]. (c) The IQR reports the spread of the middle half, so it says how variable typical use is, which a median alone cannot. It is also resistant to the extreme tail that distorts the standard deviation. $Q_1$ is obtained by solving $F(x) = 0.25$ and $Q_3$ by solving $F(x) = 0.75$, then $\text{IQR} = Q_3 - Q_1$ [1].

Review and complete

Retrieve the central ideas, then mark the lesson complete or continue to the module quiz.

01
Retrieve the lesson before you leave
  1. Write the three quantile equations from memory, and say which function they use.
  2. Write the integral formulas for $E(X)$ and $\operatorname{Var}(X)$, and state the discrete formula each one replaces.
  3. Explain why a right-skewed distribution has its mean above its median, referring to the integrand $x f(x)$.

Answer from memory first, then return to the matching Learn checkpoint to check and correct your response.

01
Take the full module quiz
quiz

A full module quiz covering every lesson in this module, not just this one. Set aside a decent block of time and treat it like a real assessment.

Start the module quiz →

Mark lesson as complete

Tick when you've finished the practice and review.