Free access until 31 December 2026 · Physics and Maths questions and notes, updated continuously · Build a test · Get an email before anything changes
IAL Maths (Edexcel) · S2 · Topic S2.2A2≈ 35 min read

S2.2 Continuous random variables

⤓ Presentation⤓ PowerPointPresentation: opens offline in any browser, simulations live. PowerPoint: editable.

A2 content (Statistics 2, specification sections 2.1 to 2.5); it uses the integration and differentiation from P1–P2 and a scientific calculator.

What this page covers

7 points
  • Probability density functions \(f(x)\): the two conditions, and probabilities as areas
  • Pdfs defined in pieces, and areas found by geometry when a piece is a straight line
  • Cumulative distribution functions \(F(x)\): building \(F\) from \(f\) piece by piece, and using \(F\) for probabilities
  • Going back with \(f(x)=F'(x)\), and finding unknown constants
  • \(E(X)\), \(E(X^2)\), \(E(g(X))\) and \(\text{Var}(X)\) by integration; \(E(aX+b)\) and \(\text{Var}(aX+b)\)
  • The mode, median, quartiles and percentiles
  • Sketching a pdf and describing its skewness

In one minute

6 points
  • A continuous random variable is described by a probability density function \(f(x)\) with \(f(x)\ge0\) and total area 1, and every probability is an area: \(P(a\lt X\lt b)=\int_a^b f(x)\,dx\).
  • \(P(X=a)=0\), so \(\lt\) and \(\le\) give the same answer.
  • The cdf \(F(x)=P(X\le x)=\int_{-\infty}^{x}f(t)\,dt\) rises from 0 to 1 with no jumps; \(F(b)-F(a)=P(a\lt X\le b)\), and going back \(f(x)=F'(x)\).
  • Piecewise: integrate piece by piece and carry the running total across each join; always define \(f\) and \(F\) for all real \(x\).
  • \(E(X)=\int xf(x)\,dx\), \(\text{Var}(X)=\int x^2f(x)\,dx-\mu^2\); \(E(aX+b)=aE(X)+b\), \(\text{Var}(aX+b)=a^2\text{Var}(X)\).
  • Mode: where \(f\) is greatest. Median: \(F(m)=0.5\); quartiles: \(F=0.25\) and \(0.75\). Mode < median < mean: positive skew; mean < median < mode: negative skew.

Contents

13 sections
  1. What is a probability density function?
  2. How do you work with a pdf defined in pieces?
  3. What is the cumulative distribution function F(x)?
  4. How do you get from F(x) back to f(x), and find constants?
  5. How do you find E(X) and Var(X) by integration?
  6. How do you find the mode, median and quartiles?
  7. How do you sketch a pdf and describe its skewness?
  8. Exam tips for S2.2
  9. Common misconceptions
  10. How this topic connects
  11. Key formulae
  12. Check your understanding
  13. Specification checklist

What is a probability density function?

A continuous random variable \(X\) can take any value in an interval — a waiting time, a length, a mass. There are infinitely many possible values, so probabilities cannot be listed one value at a time as they were in S1. Instead \(X\) is described by a curve, and probability becomes area under that curve. This page is really the calculus of P1–P2 with a statistical meaning attached.

A probability density function (pdf) \(f(x)\) is a function with \(f(x)\ge0\) for all \(x\) and \(\int_{-\infty}^{\infty}f(x)\,dx=1\), such that \[P(a\lt X\lt b)=\int_a^b f(x)\,dx.\]
  • Probability = area. The probability that \(X\) lies between \(a\) and \(b\) is the area under the pdf between those values.
  • A single value has probability 0: \(P(X=a)=\int_a^a f(x)\,dx=0\). So \(P(X\lt b)\) and \(P(X\le b)\) are equal — unlike for the discrete variables in S1.
  • \(f(x)\) is not a probability, so it may be bigger than 1. For example \(f(x)=2.5\) on \(0\le x\le0.4\) is a valid pdf: the area is \(2.5\times0.4=1\).
  • A pdf is usually non-zero only on an interval. Write "0 otherwise" as part of the definition, so that \(f\) is defined for every real \(x\).
−0.200.20.40.60.8100.511.522.53xf(x)area = 2.5 × 0.4 = 1height 2.5 > 1 is allowed
A valid pdf whose height is 2.5. The height is a density, not a probability; only the total area has to equal 1.
Worked example 1 Easy · Show that, find

The continuous random variable \(X\) has pdf \(f(x)=k(x^2+2)\) for \(0\le x\le3\), and \(f(x)=0\) otherwise. (a) Show that \(k=\frac{1}{15}\). (b) Find \(P(1\lt X\lt2)\).

(a) The total area must be 1: \[\int_0^3 k(x^2+2)\,dx=k\left[\frac{x^3}{3}+2x\right]_0^3=k(9+6)=15k.\] Setting \(15k=1\) gives \(k=\frac{1}{15}\)

(b) Probability = area from 1 to 2: \[\frac{1}{15}\left[\frac{x^3}{3}+2x\right]_1^2=\frac{1}{15}\left[\left(\frac83+4\right)-\left(\frac13+2\right)\right]=\frac{1}{15}\times\frac{13}{3}=\] \(\frac{13}{45}\approx0.2889\)

Check that \(f(x)\ge0\): \(x^2+2\) is always positive, so the pdf is valid.

−0.500.511.522.533.500.20.40.60.8xf(x)f(x) = (x² + 2)/1513/45
The pdf \(f(x)=\frac{x^2+2}{15}\) on \(0\le x\le3\) and 0 elsewhere. The whole shaded region has area 1; the red strip between \(x=1\) and \(x=2\) has area \(\frac{13}{45}\), which is \(P(1\lt X\lt2)\). Notice that \(f\) jumps down to 0 at \(x=3\): a pdf does not have to be continuous.
Common error — substituting instead of integrating

\(f(1.5)\) is a height, not a probability. Every probability for a continuous random variable is an area: integrate \(f\), or use \(F\).

How do you work with a pdf defined in pieces?

Many pdfs use a different formula on different intervals. Nothing new is needed, only care:

  • The total area is the sum of the integrals over every piece.
  • A probability that crosses a join is split at the join: \(P(1\lt X\lt3)=\int_1^2(\text{first piece})+\int_2^3(\text{second piece})\).
  • When a piece is a straight line, the area is a triangle or trapezium — geometry is often quicker than integration.
  • A pdf may jump at a join; it does not have to be continuous. (The cdf never jumps.)
Worked example 2 Medium · Find

The continuous random variable \(X\) has pdf \(f(x)=kx\) for \(0\le x\le2\), \(f(x)=\frac{k}{2}(6-x)\) for \(2\lt x\le6\), and \(f(x)=0\) otherwise. (a) Find \(k\). (b) Find \(P(X\gt4)\) and \(P(1\lt X\lt3)\).

(a) The graph is a triangle with base 0 to 6 and height \(f(2)=2k\): area \(=\frac12\times6\times2k=6k=1\), so \(k=\frac16\). The pdf is \[f(x)=\begin{cases}\dfrac{x}{6} & 0\le x\le2\\[4pt] \dfrac{6-x}{12} & 2\lt x\le6\\[4pt] 0 & \text{otherwise}\end{cases}\]

(b) \(P(X\gt4)\) is the small triangle from 4 to 6, with height \(f(4)=\frac{2}{12}=\frac16\): \(\frac12\times2\times\frac16=\) \(\frac16\)

\(P(1\lt X\lt3)\) crosses the join at 2, so split it: \[\int_1^2\frac{x}{6}\,dx+\int_2^3\frac{6-x}{12}\,dx=\frac14+\frac{7}{24}=\] \(\frac{13}{24}\)

0123456700.10.20.30.4xf(x)(2, 1/3)13/241/6
The triangular pdf of Worked example 2. Its base is 6 and its height \(\frac13\), so the area is \(\frac12\times6\times\frac13=1\). The teal region (from 1 to 3) crosses the join; the red triangle for \(x\gt4\) has area \(\frac16\).
Exam tip — sketch a piecewise pdf first

The sketch shows where the joins are, whether straight-line pieces give triangles you can use, and which piece each probability needs.

What is the cumulative distribution function F(x)?

Integrating the pdf every time you want a probability is slow. The cumulative distribution function does the integrating once, as a running total of area, and then every probability is a subtraction.

The cumulative distribution function (cdf) is \(F(x)=P(X\le x)=\int_{-\infty}^{x}f(t)\,dt\), the area under the pdf to the left of \(x\).
  • \(F\) rises from 0 to 1: \(F(x)=0\) below the lowest possible value, \(F(x)=1\) above the highest, and \(F\) never decreases.
  • \(F\) is continuous — no jumps — because a single value has probability 0. At every join the two formulas give the same value.
  • Probabilities come straight from \(F\): \(P(a\lt X\le b)=F(b)-F(a)\), and \(P(X\gt a)=1-F(a)\).
  • Piecewise method: on each piece, \(F(x)=(\text{total area of all earlier pieces})+\int_{\text{join}}^{x}f(t)\,dt\). Use \(t\) as the dummy variable so that \(x\) can be the upper limit.
  • Give \(F\) for all real \(x\): include the "0" and "1" lines.
Worked example 3 Medium · Find

For the pdf in Worked example 2, (a) find the cumulative distribution function \(F(x)\), and (b) use it to find \(P(1\lt X\lt3)\).

(a) First piece, \(0\le x\le2\): \(F(x)=\int_0^x\frac{t}{6}\,dt=\frac{x^2}{12}\), so \(F(2)=\frac{4}{12}=\frac13\).

Second piece, \(2\lt x\le6\) — start from the \(\frac13\) already collected: \[F(x)=\frac13+\int_2^x\frac{6-t}{12}\,dt=\frac13+\frac{1}{12}\left(6x-\frac{x^2}{2}-10\right)=\frac{12x-x^2-12}{24}.\]

Check the ends of the second piece: at \(x=2\), \(\frac{24-4-12}{24}=\frac13\) ✓; at \(x=6\), \(\frac{72-36-12}{24}=1\) ✓.

\[F(x)=\begin{cases}0 & x\lt0\\[2pt] \dfrac{x^2}{12} & 0\le x\le2\\[4pt] \dfrac{12x-x^2-12}{24} & 2\lt x\le6\\[4pt] 1 & x\gt6\end{cases}\]

(b) Use \(F\) — no integration needed: \(F(3)-F(1)=\frac{36-9-12}{24}-\frac{1}{12}=\frac58-\frac{1}{12}=\) \(\frac{13}{24}\), as in Worked example 2.

0123456700.250.50.751xF(x)join (2, 1/3)Q₁mQ₃
The cdf of the triangular distribution. It is 0 for \(x\lt0\), curves up as \(\frac{x^2}{12}\) to \(\frac13\) at the join, continues smoothly as \(\frac{12x-x^2-12}{24}\) to 1 at \(x=6\), and stays at 1. Reading across at 0.25, 0.5 and 0.75 gives the quartiles found in Worked example 6.
Common error — forgetting the earlier pieces

Integrating only the second piece from 2 to \(x\) gives \(\frac{1}{12}\left(6x-\frac{x^2}{2}-10\right)\), which is 0 at \(x=2\) and only \(\frac23\) at \(x=6\). Check that \(F\) reaches exactly 1 at the top end.

0123456700.250.50.751xcorrect Fmissing the 1/3only 2/3 at x = 6
The dashed red curve is the second piece integrated on its own. It drops back to 0 at the join and never reaches 1, so it cannot be a cdf. Adding the \(\frac13\) already collected lifts it onto the blue curve.

How do you get from F(x) back to f(x), and find constants?

Integration takes \(f\) to \(F\), so differentiation takes \(F\) back to \(f\): \(f(x)=F'(x)=\dfrac{d}{dx}F(x)\). Differentiate each piece; where \(F\) is constant (0 or 1), \(f=0\).

Unknown constants are fixed by conditions you already know:

  • from a pdf: total area = 1;
  • from a cdf: \(F=0\) at the lowest value, \(F=1\) at the highest value, and \(F\) takes the same value on both sides of every join;
  • extra information: a given probability, a given mean \(E(X)\), or a given median — each gives one more equation.

Two unknowns need two equations: typically "area = 1" plus one piece of extra information.

Worked example 4 Medium · Find

The continuous random variable \(X\) has cumulative distribution function \[F(x)=\begin{cases}0 & x\lt1\\ k(x^3-1) & 1\le x\le3\\ 1 & x\gt3\end{cases}\] (a) Find \(k\). (b) Find \(P(X\gt2)\). (c) Find the probability density function of \(X\).

(a) \(F\) must reach 1 at the top of the range: \(F(3)=k(27-1)=26k=1\), so \(k=\frac{1}{26}\) (and \(F(1)=0\) joins the "0" line, as it must).

(b) Use the complement: \(P(X\gt2)=1-F(2)=1-\frac{7}{26}=\) \(\frac{19}{26}\)

(c) Differentiate each piece: \[f(x)=\begin{cases}\dfrac{3x^2}{26} & 1\le x\le3\\[4pt] 0 & \text{otherwise}\end{cases}\]

00.511.522.533.5400.250.50.751xF(x)F(x) = (x³ − 1)/26F(2) = 7/26
The cdf of Worked example 4: flat at 0 before \(x=1\), rising as \(\frac{x^3-1}{26}\), and flat at 1 after \(x=3\). Its height at \(x=2\) is \(\frac{7}{26}\).
00.511.522.533.5400.250.50.751xf(x)f(x) = 3x²/267/26
Its derivative \(f(x)=\frac{3x^2}{26}\). The area under \(f\) from 1 to 2 equals the height \(F(2)=\frac{7}{26}\) in the previous figure — differentiation and integration undo each other.
Exam tip — finish the pdf properly

When you write a pdf obtained by differentiating, use the inequalities from the cdf and finish with "0 otherwise". Whether the end points carry \(\le\) or \(\lt\) does not affect any probability.

How do you find E(X) and Var(X) by integration?

The S1 formulas for a discrete random variable carry over with one change: a sum over values becomes an integral over the range, so \(\sum xP(X=x)\) becomes \(\int xf(x)\,dx\).

Mean, variance and \(E(g(X))\) (in the formulae booklet — know how to use them) \[E(X)=\mu=\int xf(x)\,dx,\qquad \text{Var}(X)=\int x^2f(x)\,dx-\mu^2,\qquad E(g(X))=\int g(x)f(x)\,dx.\] Each integral is over the whole range where \(f(x)\ne0\); for a piecewise pdf add the integrals over the pieces. \(\int x^2f(x)\,dx\) is \(E(X^2)\), and the standard deviation is \(\sigma=\sqrt{\text{Var}(X)}\).

"Mean squared" \(\mu^2\) and "mean of the squares" \(E(X^2)\) are different things: \(\text{Var}(X)=E(X^2)-[E(X)]^2\) is never negative.

Linear functions of \(X\) (not in the formulae booklet — learn them) \[E(aX+b)=aE(X)+b,\qquad \text{Var}(aX+b)=a^2\,\text{Var}(X).\] Adding \(b\) shifts every value but does not change the spread; multiplying by \(a\) scales the spread by \(|a|\), so the variance by \(a^2\).
Worked example 5 Medium · Find, show that

\(X\) has the pdf of Worked example 1, \(f(x)=\frac{1}{15}(x^2+2)\) for \(0\le x\le3\), 0 otherwise. (a) Find \(E(X)\). (b) Show that \(\text{Var}(X)=0.6375\). (c) \(Y=4X-3\). Find \(E(Y)\) and \(\text{Var}(Y)\).

(a) Multiply by \(x\) and integrate: \[E(X)=\frac{1}{15}\int_0^3(x^3+2x)\,dx=\frac{1}{15}\left[\frac{x^4}{4}+x^2\right]_0^3=\frac{1}{15}\left(\frac{81}{4}+9\right)=\frac{39}{20}=\] 1.95

(b) \(E(X^2)\) — multiply by \(x^2\): \[\frac{1}{15}\int_0^3(x^4+2x^2)\,dx=\frac{1}{15}\left[\frac{x^5}{5}+\frac{2x^3}{3}\right]_0^3=\frac{1}{15}\left(\frac{243}{5}+18\right)=\frac{111}{25}=4.44.\] Subtract the square of the mean: \(\text{Var}(X)=4.44-1.95^2=4.44-3.8025=\) 0.6375 ✓

(c) Linear rules: \(E(Y)=4\times1.95-3=\) 4.8, \(\text{Var}(Y)=4^2\times0.6375=\) 10.2

The "−3" has no effect on the variance, and the 4 is squared. The standard deviation of \(X\) is \(\sqrt{0.6375}\approx0.798\).

Common error — the linear rule for variance

Writing \(\text{Var}(4X-3)=4\text{Var}(X)-3\), or \(16\text{Var}(X)-9\). Only the multiplier matters, and it is squared: \(\text{Var}(aX+b)=a^2\text{Var}(X)\).

How do you find the mode, median and quartiles?

  • Mode: the value of \(x\) where \(f(x)\) is greatest. If the maximum is a turning point, solve \(f'(x)=0\) (and check it is a maximum). If \(f\) is increasing or decreasing over the whole range, the mode is at an end point — a sketch shows which.
  • Median \(m\): half the area lies on each side, so \(F(m)=0.5\).
  • Quartiles: \(F(Q_1)=0.25\) and \(F(Q_3)=0.75\); interquartile range \(=Q_3-Q_1\). A percentile is similar: the 90th percentile \(p\) solves \(F(p)=0.9\).
  • With a piecewise \(F\), first decide which piece contains the value: compare 0.5 (or 0.25, 0.75) with \(F\) at the joins.
  • The equation \(F(m)=0.5\) may be a quadratic (keep the root inside the range) or a quartic that has to be solved numerically — show a sign change or use the method the question gives.
Worked example 6 Medium · Find

Use the cdf from Worked example 3 to find, in exact form, (a) the lower quartile, (b) the median and the upper quartile of \(X\). (c) Find the interquartile range to 3 significant figures.

Which piece? At the join \(F(2)=\frac13\approx0.333\). Since \(0.25\lt\frac13\), \(Q_1\) is in the first piece; 0.5 and 0.75 are above \(\frac13\), so \(m\) and \(Q_3\) are in the second.

(a) \(\dfrac{q^2}{12}=\dfrac14\Rightarrow q^2=3\Rightarrow\) \(Q_1=\sqrt3\approx1.73\)

(b) Median, from the second piece: \(\dfrac{12m-m^2-12}{24}=\dfrac12\Rightarrow m^2-12m+24=0\Rightarrow m=6\pm2\sqrt3\). \(6+2\sqrt3\approx9.46\) is outside \(2\lt x\le6\), so \(m=6-2\sqrt3\approx2.54\)

Upper quartile: \(\dfrac{12q-q^2-12}{24}=\dfrac34\Rightarrow q^2-12q+30=0\Rightarrow\) \(Q_3=6-\sqrt6\approx3.55\)

(c) \((6-\sqrt6)-\sqrt3\approx\) 1.82

For this distribution the mode is 2 (the peak), the median is 2.54 and the mean is \(\frac83\approx2.67\): mode < median < mean.

Worked example 7 Hard · Find, show that

\(X\) has pdf \(f(x)=\frac{4}{27}x^2(3-x)\) for \(0\le x\le3\), 0 otherwise. (a) Find the mode. (b) Show that \(E(X)=1.8\). (c) Show that the median \(m\) satisfies \(m^4-4m^3+13.5=0\), and show that \(1.8\lt m\lt1.9\).

(a) Differentiate \(f(x)=\frac{4}{27}(3x^2-x^3)\): \(f'(x)=\frac{4}{27}(6x-3x^2)=\frac{4}{27}\times3x(2-x)=0\Rightarrow x=0\) or \(x=2\). \(f(0)=0\) and \(f(2)=\frac{16}{27}\); \(f''(2)=\frac{4}{27}(6-12)\lt0\), so the maximum is at \(x=2\): mode = 2

(b) \[\frac{4}{27}\int_0^3(3x^3-x^4)\,dx=\frac{4}{27}\left[\frac{3x^4}{4}-\frac{x^5}{5}\right]_0^3=\frac{4}{27}\left(\frac{243}{4}-\frac{243}{5}\right)=\frac{4}{27}\times\frac{243}{20}=\] 1.8

(c) The cdf on \(0\le x\le3\): \(F(x)=\frac{4}{27}\int_0^x(3t^2-t^3)\,dt=\frac{4}{27}\left(x^3-\frac{x^4}{4}\right)=\frac{4x^3-x^4}{27}\).

\(F(m)=0.5\Rightarrow4m^3-m^4=13.5\Rightarrow m^4-4m^3+13.5=0\).

Sign change — compare \(F\) with 0.5 either side: \(F(1.8)=0.4752\lt0.5\) and \(F(1.9)=0.5335\gt0.5\), so \(1.8\lt m\lt1.9\). \(F\) is continuous and increasing, so it passes 0.5 exactly once in between. Solving numerically gives \(m\approx1.84\).

00.511.522.5300.20.40.6xf(x)mean 1.8mode 2median ≈ 1.840.50.5
\(f(x)=\frac{4}{27}x^2(3-x)\). The peak (mode) is at \(x=2\); the median ≈ 1.84 splits the area into two halves of 0.5; the mean 1.8 is pulled furthest towards the long tail on the left. Mean < median < mode: negative skew.
Common error — the wrong piece or the wrong root

Solving \(F(m)=0.5\) with the wrong piece, or keeping a root outside the range. Check \(F\) at the join first, and reject any solution that does not lie in the interval where that formula applies.

How do you sketch a pdf and describe its skewness?

To sketch a pdf, draw each piece on its interval — straight lines, parabolas or cubics — and show \(f=0\) outside the range. Mark the end points, the values at the joins and the maximum. Curves need not meet the axis.

  • Positive skew: the long tail is to the right; typically mode < median < mean.
  • Negative skew: the long tail is to the left; typically mean < median < mode.
  • Symmetric: mean = median = mode (for a single-peaked pdf), and the mean is the line of symmetry — no integration needed.

To justify skewness, quote the values you have found and compare them; a sketch alone is a description, not a reason.

00.511.522.5300.20.40.6xf(x)positive skewsymmetricnegative skew
Three pdfs on \(0\le x\le3\). Positive skew, \(f(x)=\frac{4}{27}x(3-x)^2\): mode 1, median ≈ 1.16, mean 1.2. Symmetric, \(f(x)=\frac29x(3-x)\): all three equal 1.5. Negative skew, \(f(x)=\frac{4}{27}x^2(3-x)\): mean 1.8, median ≈ 1.84, mode 2. The mean moves furthest into the tail.
Worked example 8 Hard · Find, describe

The continuous random variable \(X\) has pdf \(f(x)=a+bx\) for \(0\le x\le4\), 0 otherwise, where \(a\) and \(b\) are constants. Given that \(E(X)=\frac73\): (a) find \(a\) and \(b\); (b) find \(\text{Var}(X)\); (c) find the median, in the form \(p+q\sqrt5\); (d) state the mode and describe the skewness, giving a reason.

(a) Area = 1: \(\int_0^4(a+bx)\,dx=4a+8b=1\). And \(E(X)=\frac73\): \(\int_0^4(ax+bx^2)\,dx=8a+\frac{64}{3}b=\frac73\). Double the first equation and subtract: \(\left(\frac{64}{3}-16\right)b=\frac73-2\Rightarrow\frac{16}{3}b=\frac13\Rightarrow\) \(b=\frac{1}{16}\), \(a=\frac18\)

(b) \(E(X^2)=\int_0^4\left(\frac{x^2}{8}+\frac{x^3}{16}\right)dx=\frac83+4=\frac{20}{3}\), so \(\text{Var}(X)=\frac{20}{3}-\frac{49}{9}=\) \(\frac{11}{9}\approx1.22\)

(c) \(F(x)=\frac{x}{8}+\frac{x^2}{32}=\frac{x^2+4x}{32}\); \(F(m)=\frac12\Rightarrow m^2+4m-16=0\Rightarrow m=-2\pm2\sqrt5\). The root must lie in \([0,4]\), so \(m=-2+2\sqrt5\approx2.47\)

(d) \(f(x)=\frac{2+x}{16}\) increases throughout, so mode = 4. Mean \(\frac73\approx2.33\) < median ≈ 2.47 < mode 4, so negative skew.

A follow-on: for \(Y=3X-1\), \(E(Y)=3\times\frac73-1=6\) and \(\text{Var}(Y)=9\times\frac{11}{9}=11\).

−0.500.511.522.533.544.500.10.20.30.4xf(x)f(x) = (2 + x)/16mean 2.33median 2.47mode 40.50.5
Worked example 8: a trapezium-shaped pdf with \(f(0)=\frac18\) and \(f(4)=\frac38\). The mode is at the right-hand end, the median splits the area in half at 2.47, and the mean 2.33 lies further left: negative skew.
Exam tip — the comparison is the reason

For "describe the skewness, giving a reason", write the three values in order — for example "mean 2.33 < median 2.47 < mode 4" — and then the conclusion.

Exam tips for S2.2

Exam tip 1 — define it everywhere

A pdf finishes with "0 otherwise"; a cdf starts with "0, \(x\lt\) lowest value" and ends with "1, \(x\gt\) highest value". A cdf with only the middle line is incomplete.

Exam tip 2 — check the cdf at the ends and the joins

Substitute the end points and join values into your \(F\). It must give 0 at the bottom, 1 at the top and the same value from both sides of each join. This catches most slips before they cost later parts.

Exam tip 3 — choose the piece before solving

For a median or quartile with a piecewise cdf, write \(F\) at each join first. Then solve only in the piece that contains 0.25, 0.5 or 0.75, and reject roots outside that piece.

Exam tip 4 — keep exact values in Var(X)

Find \(E(X)\) and \(E(X^2)\) as fractions before subtracting. A rounded mean squared can change the third significant figure of a small variance.

Exam tip 5 — use symmetry

If the pdf is symmetric about \(x=c\), then \(E(X)=\) median \(=c\). State the symmetry as your reason and save the integration for the variance.

Common misconceptions

MisconceptionWhy it is wrongCorrect idea
\(f(x)\) is the probability that \(X=x\).For a continuous variable \(P(X=x)=0\); \(f\) is a density, a height.Probabilities are areas: integrate \(f\), or subtract values of \(F\).
A pdf can never be greater than 1.Only the total area has to be 1.\(f(x)\ge0\) and \(\int f(x)\,dx=1\); heights above 1 are fine on a short interval.
\(P(X\lt3)\) and \(P(X\le3)\) are different.The single value 3 has probability 0.For continuous \(X\), \(\lt\) and \(\le\) give the same probability.
The second piece of \(F\) is just the integral of the second piece of \(f\).\(F\) is cumulative, so it must include the area already collected.Add \(F\) at the join to the integral from the join to \(x\).
The mode is where \(f'(x)=0\).The greatest value may be at an end point, as for an increasing pdf.Sketch \(f\); use \(f'=0\) only for a turning point inside the range.
\(\text{Var}(X)=\int x^2f(x)\,dx\).That is \(E(X^2)\), not the variance.\(\text{Var}(X)=E(X^2)-[E(X)]^2\).

How this topic connects

S1 discrete random variables and summary statistics

\(E(X)\), \(\text{Var}(X)\) and the linear rules for \(aX+b\) are the same ideas, with sums replaced by integrals. Median, quartiles, interquartile range and the mean–median–mode test for skewness are the population versions of the statistics you calculated from data. The Normal distribution in S1.6 is a continuous random variable whose cdf comes from tables instead of integration.

S2.3 Continuous uniform distribution

The rectangular distribution is the simplest pdf of all: a constant height on an interval. Its mean, variance and cdf are special cases of the integrals on this page.

Integration and numerical methods (P1–P3)

Every result here uses the power rule and definite integrals from P1–P2; a median from a cubic or quartic is located by a sign change or an iteration from P3. In IAL Physics, the time until a radioactive nucleus decays is a continuous random variable whose median is the half-life.

Key formulae

FormulaUseIn the formulae list?
\(f(x)\ge0\), \(\int f(x)\,dx=1\) over the whole rangechecking a pdf is valid; finding a constantNo – learn it
\(P(a\lt X\lt b)=\int_a^b f(x)\,dx\)probability as an areaNo – learn it
\(F(x)=P(X\le x)=\int_{-\infty}^{x}f(t)\,dt\)building the cdf from the pdfYes
\(f(x)=F'(x)\); \(P(a\lt X\le b)=F(b)-F(a)\)pdf from the cdf; probabilities from the cdfNo – derive it
\(E(X)=\int xf(x)\,dx\); \(E(g(X))=\int g(x)f(x)\,dx\)mean; expectation of a function of \(X\)Yes
\(\text{Var}(X)=\int x^2f(x)\,dx-\mu^2\)variance by integrationYes
\(E(aX+b)=aE(X)+b\); \(\text{Var}(aX+b)=a^2\text{Var}(X)\)linear functions of \(X\)No – learn it
\(F(m)=0.5\); \(F(Q_1)=0.25\); \(F(Q_3)=0.75\)median and quartilesNo – learn it
mode: \(f'(x)=0\) at an interior maximum, otherwise the end point where \(f\) is greatestmodeNo – derive it

Check your understanding

1. \(f(x)=kx\) for \(0\le x\le4\), 0 otherwise, is a pdf. Find \(k\).

\(\int_0^4kx\,dx=8k=1\), so \(k=\frac18\).

2. Why is \(P(X=2)=0\) for a continuous random variable, even when \(f(2)\gt0\)?

It is the area under \(f\) between 2 and 2 — a strip of zero width — so it is \(\int_2^2f(x)\,dx=0\). Only intervals have positive probability.

3. \(F(x)=\frac{x^2}{9}\) for \(0\le x\le3\). Find \(f(x)\) on this interval and the median.

\(f(x)=F'(x)=\frac{2x}{9}\). Median: \(\frac{m^2}{9}=0.5\), so \(m=\sqrt{4.5}=\frac{3\sqrt2}{2}\approx2.12\).

4. \(E(X)=3\) and \(\text{Var}(X)=2\). Find \(E(5-2X)\) and \(\text{Var}(5-2X)\).

\(E=5-2\times3=-1\); \(\text{Var}=(-2)^2\times2=8\). The 5 does not affect the variance, and the −2 is squared.

5. A pdf is decreasing over its whole range \(0\le x\le5\). Where is the mode, and what skewness would you expect?

The mode is at the lower end point, \(x=0\), because \(f\) is greatest there. The long tail is to the right, so expect positive skew: mode < median < mean.

6. For the pdf \(f(x)=\frac{3x^2}{26}\), \(1\le x\le3\), find \(E(X)\).

\(E(X)=\int_1^3\frac{3x^3}{26}\,dx=\frac{3}{26}\left[\frac{x^4}{4}\right]_1^3=\frac{3}{26}\times\frac{80}{4}=\frac{60}{26}=\frac{30}{13}\approx2.31\).

Specification checklist

  • (S2 2.1) I understand that a continuous random variable is described by a probability density function, that probabilities are areas under it, and that any single value has probability 0.
  • (S2 2.1) I can check that a function is a valid pdf and find an unknown constant from the total area, including for pdfs defined in pieces.
  • (S2 2.2) I can find the cumulative distribution function from a pdf, piece by piece, and state it for all real values of \(x\).
  • (S2 2.2) I can use a cdf to find probabilities, including probabilities of the form \(P(X\gt a)\).
  • (S2 2.3) I can obtain the pdf from the cdf by differentiating, and find constants from the conditions on \(F\) at the end points and joins.
  • (S2 2.4) I can find \(E(X)\), \(E(X^2)\), \(E(g(X))\) and \(\text{Var}(X)\) by integration, and use \(E(aX+b)\) and \(\text{Var}(aX+b)\).
  • (S2 2.5) I can find the mode, median, quartiles and percentiles of a continuous distribution.
  • (S2 2.5) I can sketch a pdf and describe its skewness by comparing the mean, median and mode.