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… 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.
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).
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 X falls between a and b, you integrate the density across that stretch.
Pr(a≤X≤b)=∫abf(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 ≤ 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 1, because the variable has to land somewhere.
∫−∞∞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 1.
Finding an unknown constant
Suppose f(x)=kx on [0,4] and zero elsewhere. Integrate across the support, set the result equal to 1, and solve.
∫04kxdx=k[2x2]04=8k=1⇒k=81
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 f 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)=∫−∞∞xf(x)dx
For the variance you first find E(X2) by integrating x2f(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)
The medianm 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 m equal to 21 and solving for m.
∫−∞mf(x)dx=21
A percentile works the same way with a different target. The p th percentile is the value with that fraction of the area to its left, so for the 90 th percentile you set the area equal to 0.9 instead of 0.5. The median is simply the 50 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)?
Integrate the density: Pr(a≤X≤b)=∫abf(x)dx. Probability is the area under the curve.
What two rules must every probability density function obey?
It is never negative, f(x)≥0, and its total area is one: ∫−∞∞f(x)dx=1.
How do you find an unknown constant in a density?
Force the total area to equal 1 — integrate across the support and solve. For f(x)=kx on [0,4], 8k=1 gives k=81.
Write the mean of a continuous random variable, and how the variance follows.
E(X)=∫−∞∞xf(x)dx, then Var(X)=E(X2)−[E(X)]2 and sd(X)=Var(X).
How do you find the medianm of a continuous random variable?
The median splits the area in half: solve ∫−∞mf(x)dx=21. A percentile uses a different target, e.g. 0.9 for the 90th.
Why is Pr(X=c) zero for a continuous variable, and what does that let you swap?
A single point has no width, so it traps no area. This is why < and ≤ give the same probability for a continuous variable.
Recall · Discrete random variables
How does the mean formula differ between discrete and continuous variables?
Discrete sums: E(X)=∑xxPr(X=x). Continuous integrates: E(X)=∫xf(x)dx. The variance formula is the same for both.
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 T (in minutes) at a customer service desk has probability density function f(t)=kt(16−t2) for 0≤t≤4, and f(t)=0 elsewhere, for some k∈R. Show that k=641.
1
The total probability is 1. Set the integral of the density over [0,4] equal to 1.
∫04kt(16−t2)dt=1
2
Expand and antidifferentiate, then evaluate.
k[8t2−4t4]04=k(128−64)=64k
3
Set the result equal to 1 and solve for the constant. The report notes this show that required explicit working, with the omitted dt a common slip.
64k=1⟹k=641
Answer
k=641
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 X with density f(x)=675001x2(30−x) for 0≤x≤30, and f(x)=0 elsewhere. A piece is labelled heavy if its mass exceeds 23 kg. Find the mean of X, the standard deviation of X, and, given that a piece is heavier than the mean, the probability it is labelled as heavy (to three decimal places).
1
The mean is μ=∫030xf(x)dx, and the standard deviation is σ=∫030x2f(x)dx−μ2.
μ=18,σ=36=6
2
The condition heavier than the mean means X>18. Set up the conditional probability as a ratio of two areas.
Pr(X>23∣X>18)=Pr(X>18)Pr(X>23)
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.
∫1830f(x)dx∫2330f(x)dx≈0.446
Answer
μ=18,σ=6,Pr(X>23∣X>18)≈0.446
VCAA 2024 Mathematical Methods Exam 2, Section B Q4b
Worked Example 3Finding the constant, then a probability
A continuous random variable X has density f(x)=kx for 0≤x≤4, and f(x)=0 elsewhere. Find k, then find Pr(X>2).
1
The total area under any density must be 1. Integrate over the interval where f is non zero and set it equal to 1.
∫04kxdx=k[2x2]04=k⋅8=1
2
Solve for the constant.
k=81
3
For Pr(X>2), find the area to the right of 2, which means integrate from 2 to the top of the support, 4.
Pr(X>2)=∫248xdx=81[2x2]24
4
Evaluate.
Pr(X>2)=81(8−2)=86=43
Answer
k=81,Pr(X>2)=43
Worked Example 4The mean and the median
A continuous random variable X has density f(x)=83x2 for 0≤x≤2, and f(x)=0 elsewhere. Find the mean E(X) and the median m.
1
The mean is E(X)=∫xf(x)dx over the support. Multiply the density by x, then integrate.
E(X)=∫02x⋅83x2dx=83∫02x3dx=83[4x4]02
2
Evaluate the mean.
E(X)=83⋅416=23
3
The median m splits the area in half. Set the area from the start of the support up to m equal to 21.
∫0m83x2dx=81[x3]0m=8m3=21
4
Solve for m, keeping the value exact.
m3=4⇒m=34≈1.587
Answer
E(X)=23,m=34
Worked Example 5Variance and standard deviation
A continuous random variable X is uniform on [0,2], so f(x)=21 for 0≤x≤2 and f(x)=0 elsewhere. Find E(X), then Var(X) and the standard deviation.
1
First the mean, E(X)=∫xf(x)dx.
E(X)=∫02x⋅21dx=21[2x2]02=21⋅2=1
2
Now E(X2)=∫x2f(x)dx, where you square x but keep the same density.
E(X2)=∫02x2⋅21dx=21[3x3]02=21⋅38=34
3
Variance is the average of the squares minus the square of the average.
Var(X)=E(X2)−[E(X)]2=34−12=31
4
The standard deviation is the square root of the variance. Do not stop at the variance.
sd(X)=Var(X)=31≈0.577
Answer
E(X)=1,Var(X)=31,sd(X)=31
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 h be the probability density function for a continuous random variable X, where h(x)=6x+k for −3≤x<0, h(x)=−2x+k for 0≤x≤1, and h(x)=0 elsewhere, with k a positive real number. The value of Pr(X<0.5) is:
1mark
Show worked solution
First find k by forcing the total area to be 1: ∫−30(6x+k)dx+∫01(−2x+k)dx=1 gives 4k=2, so k=21. Then Pr(X<0.5)=∫−30hdx+∫00.5hdx=43+163=1615.
VCAA 2024 Mathematical Methods Exam 2, Section A Q14
Q2.Let f be the probability density function for a continuous random variable X, where f(x)=ksin(x) for 0≤x<4π, f(x)=kcos(x) for 4π≤x≤2π, and f(x)=0 otherwise, with k a positive real number. The value of k is:
1mark
Show worked solution
Set the total area under f to 1: k∫0π/4sinxdx+k∫π/4π/2cosxdx=1. Both pieces integrate to 1−21, so k(2−2)=1 and k=2−21.
VCAA 2025 Mathematical Methods Exam 2, Section A Q14
Q3.The continuous random variable X has probability density function f(x)=83(4−3x) for 0≤x≤34, and f(x)=0 otherwise. Find k such that Pr(X>k)=169.
3marks
Work this on paper. The worked solution appears once you submit.
Show worked solution
Set up the definite integral for the right tail:
∫k4/383(4−3x)dx=169.
Antidifferentiating, [−16(4−3x)2]k4/3=16(4−3k)2=169 (the upper limit contributes 0), so
(4−3k)2=9⇒k=31,
rejecting k=37 as it lies outside the domain. The report notes errors raising the bracketed term to the power and dividing by 2 instead of 6.
VCAA 2025 Mathematical Methods Exam 1, Q8a
Q4.A continuous random variable X has density f(x)=ax for 0≤x≤3, and f(x)=0 elsewhere. The value of a is:
1mark
Need a hint?
Set the total area to 1: integrate ax from 0 to 3, equate to 1, then solve for a.
Show worked solution
The total area must equal 1, so ∫03axdx=a[2x2]03=29a=1, giving a=92. Option C, 29, is the area before you invert to solve for a.
Q5.A continuous random variable X has density f(x)=8x for 0≤x≤4. The probability Pr(X<2) is:
1mark
Need a hint?
Probability is area: integrate the density from 0 to 2, and watch you are finding the area on the correct side.
Show worked solution
Pr(X<2)=∫028xdx=81[2x2]02=81⋅2=41. Option A, 43, is Pr(X>2), the area on the other side, so it answers the wrong question.
Q6.A continuous random variable X has density f(x)=83x2 for 0≤x≤2. The mean E(X) is:
1mark
Need a hint?
The mean is ∫xf(x)dx over the support: multiply the density by x, then integrate from 0 to 2.
Show worked solution
E(X)=∫02x⋅83x2dx=83[4x4]02=83⋅4=23. Option A, 1, is the midpoint of the interval [0,2], which only equals the mean when the density is symmetric.
Q7.A continuous random variable X has density f(x)=21x for 0≤x≤2. The median m satisfies:
1mark
Need a hint?
The median splits the area in half: set the integral of the density from 0 to m equal to 21, then solve for m.
Show worked solution
The median splits the area in half, so ∫0m21xdx=4m2=21, giving m2=2 and m=2. Option C, 34, is the mean of this distribution, not the median. The mean and median only coincide when the density is symmetric.
Q8.A continuous random variable X has E(X)=1 and E(X2)=34. Correct to three decimal places, the standard deviation of X is:
1mark
Need a hint?
Find the variance as E(X2)−[E(X)]2 first, then do not forget to take the square root for the standard deviation.
Show worked solution
Var(X)=E(X2)−[E(X)]2=34−1=31, so the standard deviation is 31≈0.577. Option D leaves the answer as the variance 31≈0.333, the single most common error flagged in examiner reports. Always take the square root.
Q9.A continuous random variable X has density f(x)=cx2 for 0≤x≤3, and f(x)=0 elsewhere. Find the exact value of c, then find Pr(X≤1), giving an exact value.
3marks
Work this on paper. The worked solution appears once you submit.
Show worked solution
The total area must equal 1:
∫03cx2dx=c[3x3]03=9c=1,soc=91.
Then, in one definite integral,
Pr(X≤1)=∫0191x2dx=91[3x3]01=91⋅31=271.
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.