Skip to main content
ExamExplained
NSW · Maths Advanced
Maths Advanced study scene
§-Syllabus dot point
NSWMaths AdvancedSyllabus dot point

How do probability density functions describe continuous random variables, and how do we extract probabilities and summary statistics from them?

Use probability density functions and cumulative distribution functions to find probabilities, medians, modes, means and variances of continuous random variables

A focused answer to the HSC Maths Advanced dot point on continuous random variables. Probability density functions, cumulative distribution functions, computing probabilities by integration, and finding mean, median, mode and variance, with worked examples.

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

What this dot point is asking

NESA wants you to work with continuous random variables defined by a probability density function (pdf). You must find unknown constants by enforcing total probability =1= 1, compute probabilities as definite integrals, build the cumulative distribution function, and find the mean, variance, median and mode using integrals. The thread running through all of it is one picture: the pdf is a curve, and the probability of any interval is the area under that curve, so every task here is an area or an integral.

The answer

A probability density functionThe density f of x equals x over 8 on the interval 0 to 4, a straight line rising from the origin; the whole triangular area beneath it equals 1.xf(x)01234area = 1f(x) = x/8Step 1A valid density encloses total area 1.Here ½ × 4 × 0.5 = 1, so f(x) = x/8 is valid.

Probability density functions

A continuous random variable XX is described by a probability density function ff satisfying

  • f(x)0f(x) \ge 0 for all xx (a density cannot be negative),
  • f(x)dx=1\int_{-\infty}^{\infty} f(x) \, dx = 1 (the total area under the curve is 11).

In Maths Advanced, ff is non-zero only on a finite interval [a,b][a, b] called the support, and the total integral is taken over that interval. The value f(x)f(x) is a density, not a probability: it can exceed 11, and on its own it tells you nothing until you integrate it over an interval. This is the key shift from the discrete case, where each value carried its own probability pip_i.

The most important consequence is that for a continuous random variable, P(X=c)=0P(X = c) = 0 for any single value cc. A single point has no width, so it has no area, so it has no probability. Probabilities live on intervals only.

Probabilities as integrals

For any interval [c,d][c, d] inside the support, the probability is the area under the density over that interval:

P(cXd)=cdf(x)dx.P(c \le X \le d) = \int_c^d f(x) \, dx.

Because single points have zero probability, P(cXd)=P(c<X<d)P(c \le X \le d) = P(c < X < d). The strict and non-strict inequalities give the same value, so you never have to worry about whether the endpoints are included.

Probability is the area over an intervalThe same density with the region between x equals 1 and x equals 3 shaded; that area equals the probability that X lies between 1 and 3, which is one half.xf(x)01234P(1 ≤ X ≤ 3)= ½Step 2P(1 ≤ X ≤ 3) is the shaded area = ∫₁³ x/8 dx = ½.Single points have zero width, so they add no probability.

Cumulative distribution function

The cumulative distribution function (cdf) accumulates probability from the left:

F(x)=P(Xx)=xf(t)dt.F(x) = P(X \le x) = \int_{-\infty}^{x} f(t) \, dt.

Useful properties:

  • FF is non-decreasing, with F()=0F(-\infty) = 0 and F()=1F(\infty) = 1 (and F=0F = 0 below the support, F=1F = 1 above it).
  • P(cXd)=F(d)F(c)P(c \le X \le d) = F(d) - F(c), so once you have FF every interval probability is a subtraction.
  • Where ff is continuous, F(x)=f(x)F'(x) = f(x): the pdf is the derivative of the cdf, the cdf is the integral of the pdf. They are two views of the same distribution.

Mean, variance, median, mode

The mean (expected value) weights each value xx by its density and integrates:

E(X)=μ=xf(x)dx.E(X) = \mu = \int_{-\infty}^{\infty} x f(x) \, dx.

The variance integrates the squared deviation from the mean, and is almost always computed via the shortcut on the right:

Var(X)=σ2=(xμ)2f(x)dx=E(X2)μ2,\text{Var}(X) = \sigma^2 = \int_{-\infty}^{\infty} (x - \mu)^2 f(x) \, dx = E(X^2) - \mu^2,

where E(X2)=x2f(x)dxE(X^2) = \int x^2 f(x) \, dx. The standard deviation is σ=Var(X)\sigma = \sqrt{\text{Var}(X)}.

The median mm splits the area in half:

mf(x)dx=12,equivalentlyF(m)=12.\int_{-\infty}^{m} f(x) \, dx = \frac{1}{2}, \quad \text{equivalently} \quad F(m) = \frac{1}{2}.

The mode is the value of xx where ff is largest. If ff is differentiable on the interior of the support, look for a critical point of ff; if ff is monotone on the support, the mode is at the endpoint where ff is highest.

Why every technique here is an integral

Continuous random variables are where the calculus and statistics strands of Maths Advanced meet. A probability is an integral, the cdf is an integral with a variable upper limit, the mean weights xx by the density and integrates, and the variance integrates the squared deviation. So the practical skill being tested is your integration: setting up the right definite integral over the support, finding the antiderivative, and evaluating cleanly. The statistics is the interpretation wrapped around the calculus, which is also why this dot point pairs so naturally with the integration techniques from the calculus strand.

The standard problem types

NESA questions on this dot point fall into a small number of recognisable shapes, and naming the type tells you the first move:

  • "Find the value of the constant kk": enforce f=1\int f = 1 over the support.
  • "Find P(aXb)P(a \le X \le b)": integrate ff from aa to bb (or use F(b)F(a)F(b) - F(a)).
  • "Find the mean / expected value": integrate xf(x)x f(x).
  • "Find the variance / standard deviation": compute E(X2)E(X^2), then use Var(X)=E(X2)μ2\text{Var}(X) = E(X^2) - \mu^2.
  • "Find the median": solve F(m)=12F(m) = \frac{1}{2}.
  • "Find the mode": maximise ff on the support.

Sketching the density

A quick sketch of ff over its support guides the work. The total area under the curve must be 11, the median splits that area in half, and the mode sits under the highest point of the curve. For a symmetric density the mean, median and mode coincide at the centre of symmetry, which can save an integral if you spot the symmetry early.

How exam questions ask about continuous random variables

  • "Show that k=k = \dots" or "find the value of kk." Set supportf=1\int_{\text{support}} f = 1 and solve.
  • "Find P(X>a)P(X > a) / P(aXb)P(a \le X \le b)." Integrate ff over the interval, or use FF. For a "greater than" question, integrate up to the top of the support (or use 1F(a)1 - F(a)).
  • "Find the expected value / mean." Integrate xf(x)x f(x) over the support.
  • "Find the variance / standard deviation." Find E(X2)=x2fE(X^2) = \int x^2 f, then Var(X)=E(X2)μ2\text{Var}(X) = E(X^2) - \mu^2, then square-root for σ\sigma.
  • "Find the cumulative distribution function." Integrate ff with a variable upper limit; remember to state F=0F = 0 below the support and F=1F = 1 above it.
  • "Find the median / mode." Solve F(m)=12F(m) = \frac12 for the median; maximise ff for the mode.

Edge cases worth knowing

  • A piecewise density. If ff is defined in pieces, integrate each piece over its own sub-interval and add. The cdf is then also piecewise, continuous at the joins.
  • The mode at an endpoint. When ff is monotone on the support there is no interior critical point, so the mode is the endpoint where ff is largest. Do not chase a derivative that never vanishes.
  • A density that exceeds 11. This is fine: ff is a density, not a probability. On a narrow support the height can be well above 11 while the area stays 11.
  • Spotting symmetry. If ff is symmetric about a centre cc, then E(X)=E(X) = median =c= c immediately, and P(X>c)=12P(X > c) = \frac12, saving you an integral.

Exam-style practice questions

Practice questions written in the style of NESA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

2022 HSC Q285 marksA continuous random variable XX has probability density function f(x)=kxf(x) = k x for 0x40 \le x \le 4 and 00 elsewhere. Find kk, P(1X3)P(1 \le X \le 3), and the mean E(X)E(X).
Show worked answer →

Total probability: 04kxdx=kx2204=8k=1\int_0^4 k x \, dx = k \cdot \frac{x^2}{2} \Big|_0^4 = 8 k = 1, so k=18k = \frac{1}{8}.

P(1X3)=13x8dx=18x2213=116(91)=816=12P(1 \le X \le 3) = \int_1^3 \frac{x}{8} \, dx = \frac{1}{8} \cdot \frac{x^2}{2} \Big|_1^3 = \frac{1}{16} (9 - 1) = \frac{8}{16} = \frac{1}{2}.

Mean: E(X)=04xx8dx=1804x2dx=18x3304=6424=83E(X) = \int_0^4 x \cdot \frac{x}{8} \, dx = \frac{1}{8} \int_0^4 x^2 \, dx = \frac{1}{8} \cdot \frac{x^3}{3} \Big|_0^4 = \frac{64}{24} = \frac{8}{3}.

Markers reward solving for kk using the total probability, computing the probability as a definite integral, and using E(X)=xf(x)dxE(X) = \int x f(x) \, dx over the support.

2021 HSC Q264 marksA continuous random variable has probability density function f(x)=38x2f(x) = \frac{3}{8} x^2 for 0x20 \le x \le 2. Find the median of XX.
Show worked answer →

The median mm satisfies 0mf(x)dx=12\int_0^m f(x) \, dx = \frac{1}{2}.

0m38x2dx=38m33=m38\int_0^m \frac{3}{8} x^2 \, dx = \frac{3}{8} \cdot \frac{m^3}{3} = \frac{m^3}{8}.

Set m38=12\frac{m^3}{8} = \frac{1}{2}, so m3=4m^3 = 4 and m=431.587m = \sqrt[3]{4} \approx 1.587.

Markers expect the median condition stated as a definite integral equal to 12\frac{1}{2}, the antiderivative, and the cube root taken cleanly.

Practice questions

Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.

foundation2 marksA continuous random variable XX has probability density function f(x)=29xf(x) = \frac{2}{9} x for 0x30 \le x \le 3 and 00 elsewhere. Find P(X1)P(X \le 1).
Show worked solution →

The probability is the area under ff from 00 to 11, so integrate the density over that interval:

P(X1)=0129xdx=29x2201=19(10)=19.P(X \le 1) = \int_0^1 \frac{2}{9} x \, dx = \frac{2}{9} \cdot \frac{x^2}{2} \Big|_0^1 = \frac{1}{9} (1 - 0) = \frac{1}{9}.

So P(X1)=19P(X \le 1) = \dfrac{1}{9}.

Marker's note: one mark for setting up the definite integral of ff over [0,1][0, 1], one for the correct value 19\frac{1}{9}. Integrating over the whole support [0,3][0, 3] instead of [0,1][0, 1] is the slip to avoid.

foundation2 marksA continuous random variable is uniformly distributed with constant density f(x)=kf(x) = k for 2x72 \le x \le 7 and 00 elsewhere. Find kk, then find P(X>5)P(X > 5).
Show worked solution →

Enforce total probability =1= 1 to pin down kk. The support has width 72=57 - 2 = 5, so

27kdx=k(72)=5k=1    k=15.\int_2^7 k \, dx = k (7 - 2) = 5k = 1 \;\Rightarrow\; k = \frac{1}{5}.

Integrate over [5,7][5, 7] for the tail probability.

P(X>5)=5715dx=15(75)=25.P(X > 5) = \int_5^7 \frac{1}{5} \, dx = \frac{1}{5} (7 - 5) = \frac{2}{5}.

So k=15k = \dfrac{1}{5} and P(X>5)=25P(X > 5) = \dfrac{2}{5}.

Marker's note: one mark for k=15k = \frac{1}{5} from f=1\int f = 1, one for P(X>5)=25P(X > 5) = \frac{2}{5}. For a uniform density every probability is just density times interval width, so no antiderivative is strictly needed.

foundation3 marksThe density f(x)=29xf(x) = \frac{2}{9} x on 0x30 \le x \le 3 has cumulative distribution function F(x)=x29F(x) = \frac{x^2}{9} on that interval. Find the median of XX, giving an exact value and a decimal to two decimal places.
Show worked solution →

The median mm splits the area in half, so set F(m)=12F(m) = \frac{1}{2}:

m29=12    m2=92.\frac{m^2}{9} = \frac{1}{2} \;\Rightarrow\; m^2 = \frac{9}{2}.

Take the positive root (the median lies in the support [0,3][0, 3]):

m=32=3222.12.m = \frac{3}{\sqrt{2}} = \frac{3 \sqrt{2}}{2} \approx 2.12.

Marker's note: one mark for stating F(m)=12F(m) = \frac{1}{2}, one for m2=92m^2 = \frac{9}{2}, one for the exact value 322\frac{3\sqrt{2}}{2} (and rounding to 2.122.12). Rejecting the negative root is expected since mm must lie in the support.

core4 marksA continuous random variable is uniformly distributed with density f(x)=15f(x) = \frac{1}{5} for 2x72 \le x \le 7. Find the mean E(X)E(X) and the variance Var(X)\text{Var}(X).
Show worked solution →

Mean: integrate xf(x)x f(x) over the support.

E(X)=27x15dx=15x2227=110(494)=4510=92.E(X) = \int_2^7 x \cdot \frac{1}{5} \, dx = \frac{1}{5} \cdot \frac{x^2}{2} \Big|_2^7 = \frac{1}{10} (49 - 4) = \frac{45}{10} = \frac{9}{2}.

Variance: build E(X2)E(X^2), then use Var(X)=E(X2)μ2\text{Var}(X) = E(X^2) - \mu^2.

E(X2)=27x215dx=15x3327=115(3438)=33515=673.E(X^2) = \int_2^7 x^2 \cdot \frac{1}{5} \, dx = \frac{1}{5} \cdot \frac{x^3}{3} \Big|_2^7 = \frac{1}{15} (343 - 8) = \frac{335}{15} = \frac{67}{3}.

Var(X)=673(92)2=673814=26824312=2512.\text{Var}(X) = \frac{67}{3} - \left(\frac{9}{2}\right)^2 = \frac{67}{3} - \frac{81}{4} = \frac{268 - 243}{12} = \frac{25}{12}.

So E(X)=92E(X) = \dfrac{9}{2} and Var(X)=25122.08\text{Var}(X) = \dfrac{25}{12} \approx 2.08.

Marker's note: one mark for E(X)=92E(X) = \frac{9}{2}, one for setting up E(X2)E(X^2), one for E(X2)=673E(X^2) = \frac{67}{3}, one for Var(X)=2512\text{Var}(X) = \frac{25}{12}. The check is the uniform-variance formula (ba)212=2512\frac{(b-a)^2}{12} = \frac{25}{12}; using E(X2)E(X)E(X^2) - E(X) instead of E(X2)μ2E(X^2) - \mu^2 is the classic trap.

core4 marksA study guide plots the probability density function of a continuous random variable XX as a single straight-line segment falling from the point (0,1)(0, 1) on the vertical axis down to the point (2,0)(2, 0) on the horizontal axis, with f(x)=0f(x) = 0 everywhere outside 0x20 \le x \le 2. (a) Confirm the graph shows a valid density. (b) Find P(X<1)P(X < 1). (c) State the mode of XX.
Show worked solution →

Part (a): the region under the line is a triangle, and a valid density encloses total area 11. The triangle has base 22 (from x=0x = 0 to x=2x = 2) and height 11 (the value f(0)=1f(0) = 1), so

area=12×2×1=1,\text{area} = \frac{1}{2} \times 2 \times 1 = 1,

which confirms the graph is a valid density. Its equation is the line through (0,1)(0, 1) and (2,0)(2, 0), namely

f(x)=1x2,0x2.f(x) = 1 - \frac{x}{2}, \quad 0 \le x \le 2.

Part (b): P(X<1)P(X < 1) is the area under the line from 00 to 11.

P(X<1)=01(1x2)dx=[xx24]01=114=34.P(X < 1) = \int_0^1 \left(1 - \frac{x}{2}\right) dx = \left[ x - \frac{x^2}{4} \right]_0^1 = 1 - \frac{1}{4} = \frac{3}{4}.

Part (c): the mode is where ff is largest. The line falls steadily across [0,2][0, 2], so its highest value is at the left endpoint, giving mode =0= 0.

Marker's note: one mark for confirming area 11 (or reading f(x)=1x2f(x) = 1 - \frac{x}{2} off the graph), two for the integral setting up and evaluating P(X<1)=34P(X < 1) = \frac{3}{4}, one for mode =0= 0. Reading the line's equation off the two labelled points is the skill being tested; a symmetric guess for the mode misses that this density is not symmetric.

exam5 marksA continuous random variable XX has probability density function f(x)=ksinxf(x) = k \sin x for 0xπ0 \le x \le \pi and 00 elsewhere, where kk is a constant. (a) Show that k=12k = \frac{1}{2}. (b) Hence find P(Xπ3)P\left(X \le \frac{\pi}{3}\right) as an exact value. (c) Find the median of XX, justifying your answer.
Show worked solution →

Part (a): enforce total probability =1= 1 over the support [0,π][0, \pi].

0πksinxdx=k[cosx]0π=k(cosπ+cos0)=k(1+1)=2k.\int_0^\pi k \sin x \, dx = k \left[ -\cos x \right]_0^\pi = k \left( -\cos \pi + \cos 0 \right) = k (1 + 1) = 2k.

Setting 2k=12k = 1 gives k=12k = \dfrac{1}{2}, as required.

Part (b): integrate the density from 00 to π3\frac{\pi}{3}.

P(Xπ3)=0π/312sinxdx=12[cosx]0π/3=12(cosπ3+cos0).P\left(X \le \frac{\pi}{3}\right) = \int_0^{\pi/3} \frac{1}{2} \sin x \, dx = \frac{1}{2} \left[ -\cos x \right]_0^{\pi/3} = \frac{1}{2} \left( -\cos \frac{\pi}{3} + \cos 0 \right).

Since cosπ3=12\cos \frac{\pi}{3} = \frac{1}{2},

P(Xπ3)=12(112)=1212=14.P\left(X \le \frac{\pi}{3}\right) = \frac{1}{2} \left( 1 - \frac{1}{2} \right) = \frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}.

Part (c): the median mm solves F(m)=12F(m) = \frac{1}{2}. The cdf is

F(m)=0m12sinxdx=12(1cosm).F(m) = \int_0^m \frac{1}{2} \sin x \, dx = \frac{1}{2} (1 - \cos m).

Setting this equal to 12\frac{1}{2}:

12(1cosm)=12    1cosm=1    cosm=0    m=π2.\frac{1}{2} (1 - \cos m) = \frac{1}{2} \;\Rightarrow\; 1 - \cos m = 1 \;\Rightarrow\; \cos m = 0 \;\Rightarrow\; m = \frac{\pi}{2}.

This matches the symmetry of sinx\sin x about x=π2x = \frac{\pi}{2} on [0,π][0, \pi], which splits the area evenly.

Marker's note: one mark for the integral in (a), one for k=12k = \frac{1}{2}; one for the setup and one for 14\frac{1}{4} in (b); one for solving F(m)=12F(m) = \frac{1}{2} to reach m=π2m = \frac{\pi}{2} in (c). Work in radians throughout, since ddx(cosx)=sinx\frac{d}{dx}(-\cos x) = \sin x holds only in radian measure.

exam5 marksA continuous random variable XX models a machine setting with probability density function f(x)=kx(4x)f(x) = k\,x(4 - x) for 0x40 \le x \le 4 and 00 elsewhere. (a) Show that k=332k = \frac{3}{32}. (b) Explain, using the symmetry of ff, why the mean of XX is 22. (c) Find the variance of XX.
Show worked solution →

Part (a): total probability =1= 1 over [0,4][0, 4]. Expand and integrate:

04kx(4x)dx=k04(4xx2)dx=k[2x2x33]04.\int_0^4 k\,x(4 - x) \, dx = k \int_0^4 \left( 4x - x^2 \right) dx = k \left[ 2x^2 - \frac{x^3}{3} \right]_0^4.

Evaluate at x=4x = 4:

k(2(16)643)=k(32643)=k96643=32k3.k \left( 2(16) - \frac{64}{3} \right) = k \left( 32 - \frac{64}{3} \right) = k \cdot \frac{96 - 64}{3} = \frac{32k}{3}.

Setting 32k3=1\dfrac{32k}{3} = 1 gives k=332k = \dfrac{3}{32}, as required.

Part (b): ff is symmetric about x=2x = 2. Replacing xx by 4x4 - x leaves x(4x)x(4 - x) unchanged, so the curve is a mirror image about the midpoint x=2x = 2 of the support. For a symmetric density the mean sits at the centre of symmetry, so E(X)=2E(X) = 2.

Part (c): use Var(X)=E(X2)μ2\text{Var}(X) = E(X^2) - \mu^2 with μ=2\mu = 2. First find E(X2)E(X^2):

E(X2)=04x2332x(4x)dx=33204(4x3x4)dx=332[x4x55]04.E(X^2) = \int_0^4 x^2 \cdot \frac{3}{32} x(4 - x) \, dx = \frac{3}{32} \int_0^4 \left( 4x^3 - x^4 \right) dx = \frac{3}{32} \left[ x^4 - \frac{x^5}{5} \right]_0^4.

Evaluate at x=4x = 4 (using 44=2564^4 = 256 and 45=10244^5 = 1024):

E(X2)=332(25610245)=332128010245=3322565=245.E(X^2) = \frac{3}{32} \left( 256 - \frac{1024}{5} \right) = \frac{3}{32} \cdot \frac{1280 - 1024}{5} = \frac{3}{32} \cdot \frac{256}{5} = \frac{24}{5}.

Then

Var(X)=24522=2454=24205=45.\text{Var}(X) = \frac{24}{5} - 2^2 = \frac{24}{5} - 4 = \frac{24 - 20}{5} = \frac{4}{5}.

So Var(X)=45\text{Var}(X) = \dfrac{4}{5}.

Marker's note: one mark for the integral in (a), one for k=332k = \frac{3}{32}; one for the symmetry argument giving μ=2\mu = 2 in (b); one for E(X2)=245E(X^2) = \frac{24}{5} and one for Var(X)=45\text{Var}(X) = \frac{4}{5} in (c). Spotting the symmetry saves a full mean integral; using E(X2)μ2E(X^2) - \mu^2 (not E(X2)E(X)E(X^2) - E(X)) is essential.

ExamExplained