Mathematical Methods · Units 3 & 4

Continuous Random Variables and Probability Density Functions

Understand continuous random variables and probability density functions the easy way, with plain English intuition, probability as area, finding unknown constants, mean, variance, median and percentiles, worked examples and an auto marked practice test. VCE Maths Methods Units 3 and 4.

Learn

Toss a dart at a dartboard and ask “what is the chance it lands exactly halfway out, at a distance of precisely 5.000…5.000\ldots centimetres”. The honest answer is zero, because there are infinitely many distances it could hit and no single one of them is special. Yet the dart clearly lands somewhere. That is the puzzle a continuous random variable solves. When a quantity can take any value in a range, we stop asking about single points and start asking about intervals, and the chance of landing in an interval turns out to be an area under a curve.

0.511.52 0.20.40.60.8
A probability density function. The chance the variable lands between two values is the shaded area under the curve, and the whole area under the curve always adds to 1.

Why a curve instead of a table

A discrete random variable comes with a tidy table, every value paired with its probability. A continuous random variable can land on any value in an interval, so a table would need infinitely many rows. Instead we describe it with a smooth curve called a probability density function, written f(x)f(x).

The height of the curve is not a probability. It is a density, a measure of how thickly probability is packed near each point. Probability itself lives in the area under the curve. To find the chance that XX falls between aa and bb, you integrate the density across that stretch.

Pr⁡(a≤X≤b)=∫abf(x) dx\Pr(a \le X \le b) = \int_a^b f(x)\,dx

Because a single point has no width, it traps no area, which is exactly why the chance of any exact value is zero. This also means it never matters whether you write << or ≤\le for a continuous variable. The endpoints contribute nothing.

The two rules every density must obey

A curve is only a genuine probability density function if it passes two tests. First, it can never dip below zero, because a negative probability makes no sense. Second, the total area underneath, across every value the variable can take, must be exactly 11, because the variable has to land somewhere.

∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1

In practice the density is zero outside some interval, so this giant integral collapses to an integral over just that interval. This second rule is your workhorse. Most questions hand you a density with an unknown constant out the front, and you pin the constant down by forcing the total area to equal 11.

Finding an unknown constant

Suppose f(x)=kxf(x) = kx on [0,4][0, 4] and zero elsewhere. Integrate across the support, set the result equal to 11, and solve.

∫04kx dx=k[x22]04=8k=1⇒k=18\int_0^4 kx\,dx = k\left[\frac{x^2}{2}\right]_0^4 = 8k = 1 \quad\Rightarrow\quad k = \frac{1}{8}

Once the constant is known the density is fully defined, and every other question is just a definite integral. A common trap is forgetting that ff is zero outside the support, then integrating over the wrong limits. Always integrate only across the part of the number line where the density actually lives.

Mean, variance, median and percentiles

Everything you learned for discrete variables carries over, with sums becoming integrals. The mean weights each value by its density and adds them up continuously.

E(X)=∫−∞∞x f(x) dxE(X) = \int_{-\infty}^{\infty} x\,f(x)\,dx

For the variance you first find E(X2)E(X^2) by integrating x2f(x)x^2 f(x), then subtract the square of the mean. The standard deviation is the square root of the variance, and it is the answer most students forget to finish.

Var⁡(X)=E(X2)−[E(X)]2,sd(X)=Var⁡(X)\operatorname{Var}(X) = E(X^2) - [E(X)]^2, \qquad sd(X) = \sqrt{\operatorname{Var}(X)}

The median mm is the value that splits the area exactly in half. You find it by setting the area from the start of the support up to mm equal to 12\tfrac{1}{2} and solving for mm.

∫−∞mf(x) dx=12\int_{-\infty}^{m} f(x)\,dx = \frac{1}{2}

A percentile works the same way with a different target. The pp th percentile is the value with that fraction of the area to its left, so for the 9090 th percentile you set the area equal to 0.90.9 instead of 0.50.5. The median is simply the 5050 th percentile in disguise.

The mistakes that cost the most marks

Examiner reports return to the same slips year after year. Some students set up the wrong definite integral, often by ignoring where the density is zero or by splitting one clean integral into two when a single one would do. Read the support carefully and write one integral with the correct limits.

The other classic error is statistical. Students grind out the variance correctly, then hand it in when the question asked for the standard deviation. The fix is one habit. Check the command word, and if it says standard deviation, take the square root before you stop. Keep your answers exact unless the question asks for a decimal, because a value rounded too early can lose a mark that a clean exact form would have kept.

Lock it in with active recall

Cover the answer and say each one out loud before you flip. Rate yourself honestly — the cards you find hard come back sooner, the ones you know are spaced further out.

Active recall

Answer from memory first, then flip. Rate yourself and each card returns on a spaced schedule (1 → 3 → 7 → 16 days).

For a continuous random variable, how do you find Pr⁡(a≤X≤b)\Pr(a \le X \le b)?
What two rules must every probability density function obey?
How do you find an unknown constant in a density?
Write the mean of a continuous random variable, and how the variance follows.
How do you find the median mm of a continuous random variable?
Why is Pr⁡(X=c)\Pr(X = c) zero for a continuous variable, and what does that let you swap?
Recall · Discrete random variables
How does the mean formula differ between discrete and continuous variables?

See these tools in action in the Worked Examples tab, then test yourself in Try It.

Worked examples

Worked Example 1Pinning down the constant of a density, from a real exam

The queuing time TT (in minutes) at a customer service desk has probability density function f(t)=k t(16−t2)f(t) = k\,t(16 - t^2) for 0≤t≤40 \le t \le 4, and f(t)=0f(t) = 0 elsewhere, for some k∈Rk \in R. Show that k=164k = \dfrac{1}{64}.

  1. 1

    The total probability is 11. Set the integral of the density over [0,4][0, 4] equal to 11.

    ∫04kt(16−t2) dt=1\int_0^4 k t(16 - t^2)\,dt = 1
  2. 2

    Expand and antidifferentiate, then evaluate.

    k[8t2−t44]04=k(128−64)=64kk\left[8t^2 - \frac{t^4}{4}\right]_0^4 = k\left(128 - 64\right) = 64k
  3. 3

    Set the result equal to 11 and solve for the constant. The report notes this show that required explicit working, with the omitted dtdt a common slip.

    64k=1  ⟹  k=16464k = 1 \implies k = \frac{1}{64}
Answer
k=164k = \dfrac{1}{64}

VCAA 2023 Mathematical Methods Exam 1, Q8a

Worked Example 2Mean, standard deviation and a conditional probability, from a real exam

The mass of each piece of luggage (kg) is a continuous random variable XX with density f(x)=167500x2(30−x)f(x) = \dfrac{1}{67500}x^2(30 - x) for 0≤x≤300 \le x \le 30, and f(x)=0f(x) = 0 elsewhere. A piece is labelled heavy if its mass exceeds 2323 kg. Find the mean of XX, the standard deviation of XX, and, given that a piece is heavier than the mean, the probability it is labelled as heavy (to three decimal places).

  1. 1

    The mean is μ=∫030xf(x) dx\mu = \int_0^{30} x f(x)\,dx, and the standard deviation is σ=∫030x2f(x) dx−μ2\sigma = \sqrt{\int_0^{30} x^2 f(x)\,dx - \mu^2}.

    μ=18,σ=36=6\mu = 18, \quad \sigma = \sqrt{36} = 6
  2. 2

    The condition heavier than the mean means X>18X > 18. Set up the conditional probability as a ratio of two areas.

    Pr⁡(X>23∣X>18)=Pr⁡(X>23)Pr⁡(X>18)\Pr(X > 23 \mid X > 18) = \frac{\Pr(X > 23)}{\Pr(X > 18)}
  3. 3

    Evaluate each integral and divide. The report warns against finding the variance instead of the standard deviation, and against using the wrong denominator here.

    ∫2330f(x) dx∫1830f(x) dx≈0.446\frac{\int_{23}^{30} f(x)\,dx}{\int_{18}^{30} f(x)\,dx} \approx 0.446
Answer
μ=18,σ=6,Pr⁡(X>23∣X>18)≈0.446\mu = 18, \quad \sigma = 6, \quad \Pr(X > 23 \mid X > 18) \approx 0.446

VCAA 2024 Mathematical Methods Exam 2, Section B Q4b

Worked Example 3Finding the constant, then a probability

A continuous random variable XX has density f(x)=kxf(x) = kx for 0≤x≤40 \le x \le 4, and f(x)=0f(x) = 0 elsewhere. Find kk, then find Pr⁡(X>2)\Pr(X > 2).

  1. 1

    The total area under any density must be 11. Integrate over the interval where ff is non zero and set it equal to 11.

    ∫04kx dx=k[x22]04=k⋅8=1\int_0^4 kx \,dx = k\left[\frac{x^2}{2}\right]_0^4 = k\cdot 8 = 1
  2. 2

    Solve for the constant.

    k=18k = \frac{1}{8}
  3. 3

    For Pr⁡(X>2)\Pr(X > 2), find the area to the right of 22, which means integrate from 22 to the top of the support, 44.

    Pr⁡(X>2)=∫24x8 dx=18[x22]24\Pr(X > 2) = \int_2^4 \frac{x}{8}\,dx = \frac{1}{8}\left[\frac{x^2}{2}\right]_2^4
  4. 4

    Evaluate.

    Pr⁡(X>2)=18(8−2)=68=34\Pr(X > 2) = \frac{1}{8}\left(8 - 2\right) = \frac{6}{8} = \frac{3}{4}
Answer
k=18,Pr⁡(X>2)=34k = \dfrac{1}{8}, \quad \Pr(X > 2) = \dfrac{3}{4}
Worked Example 4The mean and the median

A continuous random variable XX has density f(x)=38x2f(x) = \dfrac{3}{8}x^2 for 0≤x≤20 \le x \le 2, and f(x)=0f(x) = 0 elsewhere. Find the mean E(X)E(X) and the median mm.

  1. 1

    The mean is E(X)=∫x f(x) dxE(X) = \int x\,f(x)\,dx over the support. Multiply the density by xx, then integrate.

    E(X)=∫02x⋅38x2 dx=38∫02x3 dx=38[x44]02E(X) = \int_0^2 x\cdot\frac{3}{8}x^2 \,dx = \frac{3}{8}\int_0^2 x^3 \,dx = \frac{3}{8}\left[\frac{x^4}{4}\right]_0^2
  2. 2

    Evaluate the mean.

    E(X)=38⋅164=32E(X) = \frac{3}{8}\cdot\frac{16}{4} = \frac{3}{2}
  3. 3

    The median mm splits the area in half. Set the area from the start of the support up to mm equal to 12\tfrac{1}{2}.

    ∫0m38x2 dx=18[x3]0m=m38=12\int_0^m \frac{3}{8}x^2 \,dx = \frac{1}{8}\big[x^3\big]_0^m = \frac{m^3}{8} = \frac{1}{2}
  4. 4

    Solve for mm, keeping the value exact.

    m3=4⇒m=43≈1.587m^3 = 4 \quad\Rightarrow\quad m = \sqrt[3]{4} \approx 1.587
Answer
E(X)=32,m=43E(X) = \dfrac{3}{2}, \quad m = \sqrt[3]{4}
Worked Example 5Variance and standard deviation

A continuous random variable XX is uniform on [0,2][0, 2], so f(x)=12f(x) = \dfrac{1}{2} for 0≤x≤20 \le x \le 2 and f(x)=0f(x) = 0 elsewhere. Find E(X)E(X), then Var⁡(X)\operatorname{Var}(X) and the standard deviation.

  1. 1

    First the mean, E(X)=∫x f(x) dxE(X) = \int x\,f(x)\,dx.

    E(X)=∫02x⋅12 dx=12[x22]02=12⋅2=1E(X) = \int_0^2 x\cdot\frac{1}{2}\,dx = \frac{1}{2}\left[\frac{x^2}{2}\right]_0^2 = \frac{1}{2}\cdot 2 = 1
  2. 2

    Now E(X2)=∫x2f(x) dxE(X^2) = \int x^2 f(x)\,dx, where you square xx but keep the same density.

    E(X2)=∫02x2⋅12 dx=12[x33]02=12⋅83=43E(X^2) = \int_0^2 x^2\cdot\frac{1}{2}\,dx = \frac{1}{2}\left[\frac{x^3}{3}\right]_0^2 = \frac{1}{2}\cdot\frac{8}{3} = \frac{4}{3}
  3. 3

    Variance is the average of the squares minus the square of the average.

    Var⁡(X)=E(X2)−[E(X)]2=43−12=13\operatorname{Var}(X) = E(X^2) - [E(X)]^2 = \frac{4}{3} - 1^2 = \frac{1}{3}
  4. 4

    The standard deviation is the square root of the variance. Do not stop at the variance.

    sd(X)=Var⁡(X)=13≈0.577sd(X) = \sqrt{\operatorname{Var}(X)} = \frac{1}{\sqrt{3}} \approx 0.577
Answer
E(X)=1,Var⁡(X)=13,sd(X)=13E(X) = 1, \quad \operatorname{Var}(X) = \dfrac{1}{3}, \quad sd(X) = \dfrac{1}{\sqrt{3}}

Practice questions

Practice test

Try it yourself

9 questions, 13 marks

Choose your answers, then submit to see your score and the full worked solutions. Multiple choice is marked for you, just like Exam 2 Section A.

Q1.Let hh be the probability density function for a continuous random variable XX, where h(x)=x6+kh(x) = \dfrac{x}{6} + k for −3≤x<0-3 \le x < 0, h(x)=−x2+kh(x) = -\dfrac{x}{2} + k for 0≤x≤10 \le x \le 1, and h(x)=0h(x) = 0 elsewhere, with kk a positive real number. The value of Pr⁡(X<0.5)\Pr(X < 0.5) is:

1mark

VCAA 2024 Mathematical Methods Exam 2, Section A Q14

Q2.Let ff be the probability density function for a continuous random variable XX, where f(x)=ksin⁡(x)f(x) = k\sin(x) for 0≤x<π40 \le x < \dfrac{\pi}{4}, f(x)=kcos⁡(x)f(x) = k\cos(x) for π4≤x≤π2\dfrac{\pi}{4} \le x \le \dfrac{\pi}{2}, and f(x)=0f(x) = 0 otherwise, with kk a positive real number. The value of kk is:

1mark

VCAA 2025 Mathematical Methods Exam 2, Section A Q14

Q3.The continuous random variable XX has probability density function f(x)=38(4−3x)f(x) = \dfrac{3}{8}(4 - 3x) for 0≤x≤430 \le x \le \dfrac{4}{3}, and f(x)=0f(x) = 0 otherwise. Find kk such that Pr⁡(X>k)=916\Pr(X > k) = \dfrac{9}{16}.

3marks

Work this on paper. The worked solution appears once you submit.

VCAA 2025 Mathematical Methods Exam 1, Q8a

Q4.A continuous random variable XX has density f(x)=axf(x) = ax for 0≤x≤30 \le x \le 3, and f(x)=0f(x) = 0 elsewhere. The value of aa is:

1mark
Need a hint?
Set the total area to 11: integrate axax from 00 to 33, equate to 11, then solve for aa.

Q5.A continuous random variable XX has density f(x)=x8f(x) = \dfrac{x}{8} for 0≤x≤40 \le x \le 4. The probability Pr⁡(X<2)\Pr(X < 2) is:

1mark
Need a hint?
Probability is area: integrate the density from 00 to 22, and watch you are finding the area on the correct side.

Q6.A continuous random variable XX has density f(x)=38x2f(x) = \dfrac{3}{8}x^2 for 0≤x≤20 \le x \le 2. The mean E(X)E(X) is:

1mark
Need a hint?
The mean is ∫x f(x) dx\int x\,f(x)\,dx over the support: multiply the density by xx, then integrate from 00 to 22.

Q7.A continuous random variable XX has density f(x)=12xf(x) = \dfrac{1}{2}x for 0≤x≤20 \le x \le 2. The median mm satisfies:

1mark
Need a hint?
The median splits the area in half: set the integral of the density from 00 to mm equal to 12\tfrac{1}{2}, then solve for mm.

Q8.A continuous random variable XX has E(X)=1E(X) = 1 and E(X2)=43E(X^2) = \dfrac{4}{3}. Correct to three decimal places, the standard deviation of XX is:

1mark
Need a hint?
Find the variance as E(X2)−[E(X)]2E(X^2) - [E(X)]^2 first, then do not forget to take the square root for the standard deviation.

Q9.A continuous random variable XX has density f(x)=cx2f(x) = cx^2 for 0≤x≤30 \le x \le 3, and f(x)=0f(x) = 0 elsewhere. Find the exact value of cc, then find Pr⁡(X≤1)\Pr(X \le 1), giving an exact value.

3marks

Work this on paper. The worked solution appears once you submit.

Frequently asked questions

Why is the probability of any exact value zero?
Because a single point has no width, it traps no area under the curve, and for a continuous variable probability is area. There are infinitely many possible values, so no single one carries any probability on its own. This is why you can swap a less than sign for a less than or equal sign without changing the answer.
What is the difference between the density and the probability?
The height of the curve is the density, which tells you how thickly probability is packed near a point, not the probability itself. The probability only appears once you find the area under the curve across an interval by integrating. So the density can be larger than one, but an area never can.
How do I find the median of a continuous random variable?
The median is the value that splits the total area exactly in half. You set the area from the start of the support up to the median equal to one half and solve for it. A percentile works the same way, just with a different target, so the ninetieth percentile uses zero point nine instead of one half.