Skip to main content

Continuous random variables and PDFs (SACE Stage 2 Mathematical Methods)

Syllabus dot point

“A continuous random variable is described by a probability density function, where probability is the area under the curve found by integration.”

8 min read

Quick answer

A continuous random variable can take any value in an interval, so probability is described by a probability density function f(x)f(x). Probabilities are areas under the curve: P(a≤X≤b)=∫abf(x) dxP(a\le X\le b)=\int_a^b f(x)\,dx. A valid PDF satisfies f(x)≥0f(x)\ge 0 everywhere and ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty} f(x)\,dx=1.

Jump to a section
  1. What this dot point is asking
  2. Probability is area
  3. Mean and variance by integration
  4. The median and other percentiles
  5. The cumulative distribution function
  6. Common errors
  7. Why it matters
  8. Exam-style questions

What this dot point is asking

A continuous random variable can take any value in a range - a height, a time, a mass - not just a list of separate values. Because there are infinitely many possible values, the probability of any single exact value is zero, and we describe probability by a density function instead. This is the key conceptual shift from Topic 2: where a discrete variable had a probability attached to each value, a continuous variable has probability spread smoothly across an interval, and you recover any probability by measuring area rather than reading off a table entry.

Probability density function (PDF)

A function f(x)f(x) is a probability density function for a continuous random variable XX if f(x)≥0f(x)\ge 0 for all xx and the total area under it is 11:

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

Probability is area

The defining idea of Topic 5 is that probability equals area under the curve, computed by integration:

Probability from a PDF

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

Because a single point has zero width, P(X=a)=0P(X=a)=0, and so P(a≤X≤b)=P(a<X<b)P(a\le X\le b)=P(a<X<b) - strict and inclusive inequalities give the same answer.

Checking a PDF and finding a probability

XX has density f(x)=kxf(x)=kx for 0≤x≤20\le x\le 2 and f(x)=0f(x)=0 elsewhere. This example finds kk and then the probability P(X≤1)P(X\le 1).

Step 1: find kk using the total-area condition

Every valid PDF must have total area equal to 11 over its full range. Setting the integral of ff equal to 11 lets us solve for the unknown constant:

∫02kx dx=k[x22]02=k⋅2=1⇒k=12.\int_0^2 kx\,dx=k\Big[\tfrac{x^2}{2}\Big]_0^2=k\cdot 2=1 \quad\Rightarrow\quad k=\tfrac12.

Step 2: find P(X≤1)P(X\le 1) as area under the curve

Probability for a continuous variable is the area under the density between the limits. Now that k=12k=\tfrac12 is known, we integrate f(x)=12xf(x)=\tfrac12 x from 00 to 11:

P(X≤1)=∫0112x dx=12[x22]01=12⋅12=14.P(X\le 1)=\int_0^1 \tfrac12 x\,dx=\tfrac12\Big[\tfrac{x^2}{2}\Big]_0^1=\tfrac12\cdot\tfrac12=\frac14.

Final answer: k=12k=\tfrac12 and P(X≤1)=14P(X\le 1)=\tfrac14.

Mean and variance by integration

The discrete sums become integrals for a continuous variable:

Mean and variance of a continuous variable

μ=E(X)=∫−∞∞x f(x) dx,Var⁡(X)=∫−∞∞x2f(x) dx−μ2.\mu=E(X)=\int_{-\infty}^{\infty} x\,f(x)\,dx, \qquad \operatorname{Var}(X)=\int_{-\infty}^{\infty} x^2 f(x)\,dx-\mu^2.

Mean of a density

For the density f(x)=12xf(x)=\tfrac12 x on [0,2][0,2], this example finds E(X)E(X) using the integral definition of the mean.

Step 1: set up the mean integral

The mean of a continuous random variable is E(X)=∫x f(x) dxE(X)=\int x\,f(x)\,dx over the variable's range. Substituting f(x)=12xf(x)=\tfrac12 x gives the integrand x⋅12x=12x2x\cdot\tfrac12 x=\tfrac12 x^2, which we integrate from 00 to 22:

E(X)=∫02x⋅12x dx=∫0212x2 dx.E(X)=\int_0^2 x\cdot\tfrac12 x\,dx=\int_0^2 \tfrac12 x^2\,dx.

Step 2: evaluate the integral

Using the power rule, the antiderivative of 12x2\tfrac12 x^2 is 12⋅x33=x36\tfrac12\cdot\tfrac{x^3}{3}=\tfrac{x^3}{6}. Evaluating between 00 and 22:

12[x33]02=12⋅83=43≈1.33.\tfrac12\Big[\tfrac{x^3}{3}\Big]_0^2=\tfrac12\cdot\tfrac{8}{3}=\frac{4}{3}\approx 1.33.

Final answer: E(X)=43≈1.33E(X)=\tfrac43\approx 1.33.

The median and other percentiles

The median mm of a continuous variable splits the area in half: it is the value with ∫−∞mf(x) dx=0.5\int_{-\infty}^{m} f(x)\,dx=0.5. More generally, the ppth percentile is the value with cumulative area p100\dfrac{p}{100} below it. For the density f(x)=12xf(x)=\tfrac12 x on [0,2][0,2], the median solves ∫0m12x dx=0.5\int_0^m \tfrac12 x\,dx=0.5, that is m24=0.5\tfrac{m^2}{4}=0.5, giving m=2≈1.41m=\sqrt{2}\approx 1.41. Notice the median is larger than you might first guess: because the density rises toward x=2x=2, more probability sits on the right, pulling the halfway point above the midpoint of the interval. Comparing the mean (43≈1.33\tfrac43\approx 1.33) with the median (1.411.41) describes the skew of the distribution.

The cumulative distribution function

Just as discrete variables have a running total, a continuous variable has a cumulative distribution function F(x)=∫−∞xf(t) dtF(x)=\int_{-\infty}^{x} f(t)\,dt, which gives P(X≤x)P(X\le x) directly. By the Fundamental Theorem of Calculus, differentiating the CDF returns the density: F′(x)=f(x)F'(x)=f(x). This is why probability questions can be answered either by integrating the density between limits or by subtracting two values of the CDF, P(a≤X≤b)=F(b)−F(a)P(a\le X\le b)=F(b)-F(a) - whichever the question makes easier.

Common errors

Treating f(x) as a probability or ignoring the function's range

The value f(x)f(x) is a density, not a probability - it can exceed 1, and only the area under it between limits is a probability. Also, the PDF is zero outside its stated interval, so integrate only over the part of [a,b][a,b] where ff is non-zero; integrating kxkx beyond [0,2][0,2] would wrongly add area that does not exist.

Always verify total area equals 1

Before computing any probability, confirm (or use) ∫f(x) dx=1\int f(x)\,dx=1 over the variable's range. This both finds unknown constants like kk and is a quick sanity check that your density is valid.

Why it matters

Probability density functions are the continuous counterpart of the discrete distributions in Topic 2 and the foundation for the normal distribution that follows. The "probability = area = integral" principle ties Topic 5 directly back to the integral calculus of Topic 3.

Exam-style questions

Questions in the style of SACE Board exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

SACE 2022-style5 marks
Calculator-assumed. A continuous probability density function is f(x)=af(x) = a (a constant) defined for 0≤x≤40 \le x \le 4. (a) Find the value of aa. (b) Write an integral expression for the mean and evaluate it.
Show worked answer →

(a) A valid PDF has total area 11, so ∫04a dx=1\int_0^4 a\,dx = 1. The rectangle of width 44 and height aa gives 4a=14a = 1, so a=14a = \tfrac{1}{4}. (2 marks)

(b) The mean is ∫04xf(x) dx\int_0^4 x f(x)\,dx:

μ=∫04x⋅14 dx=14[x22]04=14⋅8=2.\mu = \int_0^4 x \cdot \tfrac{1}{4}\,dx = \tfrac{1}{4}\Big[\tfrac{x^2}{2}\Big]_0^4 = \tfrac{1}{4}\cdot 8 = 2.

So a=14a = \tfrac{1}{4} and the mean is 22. This is a uniform distribution, so the mean sits at the midpoint, a useful check. (3 marks: 1 for the expression, 2 for evaluation.)

SACE 2023-style2 marks
Calculator-assumed. The time TT (in minutes) for a customer to receive an order is modelled by f(t)=0.3e−0.3tf(t) = 0.3e^{-0.3t} for t≥0t \ge 0. Determine the probability that a randomly chosen customer receives their order in less than 5 minutes.
Show worked answer →

Probability is the area under the density: P(T<5)=∫050.3e−0.3t dtP(T < 5) = \int_0^5 0.3e^{-0.3t}\,dt.

The antiderivative of 0.3e−0.3t0.3e^{-0.3t} is −e−0.3t-e^{-0.3t}. Evaluate:

P(T<5)=[−e−0.3t]05=−e−1.5+e0=1−e−1.5=1−0.2231≈0.777.P(T < 5) = \Big[-e^{-0.3t}\Big]_0^5 = -e^{-1.5} + e^0 = 1 - e^{-1.5} = 1 - 0.2231 \approx 0.777.

So P(T<5)≈0.777P(T < 5) \approx 0.777. Marks: one for the integral set-up, one for evaluating 1−e−1.51 - e^{-1.5}.

SACE 2021-style3 marks
Calculator-assumed. The lifetime XX (years) of a component has density f(x)=kx(4−x)f(x) = kx(4 - x) for 0≤x≤40 \le x \le 4, zero otherwise. Find kk, then P(X≤2)P(X \le 2).
Show worked answer →

Total area is 11: ∫04kx(4−x) dx=k∫04(4x−x2) dx=k[2x2−x33]04=k(32−643)=k⋅323=1\int_0^4 kx(4 - x)\,dx = k\int_0^4 (4x - x^2)\,dx = k\Big[2x^2 - \tfrac{x^3}{3}\Big]_0^4 = k\left(32 - \tfrac{64}{3}\right) = k\cdot\tfrac{32}{3} = 1, so k=332k = \tfrac{3}{32}.

Then P(X≤2)=332∫02(4x−x2) dx=332[2x2−x33]02=332(8−83)=332⋅163=12P(X \le 2) = \tfrac{3}{32}\int_0^2 (4x - x^2)\,dx = \tfrac{3}{32}\Big[2x^2 - \tfrac{x^3}{3}\Big]_0^2 = \tfrac{3}{32}\left(8 - \tfrac{8}{3}\right) = \tfrac{3}{32}\cdot\tfrac{16}{3} = \tfrac{1}{2}.

So k=332k = \tfrac{3}{32} and P(X≤2)=0.5P(X \le 2) = 0.5 (which is expected by the symmetry of the density about x=2x = 2). Marks: one for the area integral, one for kk, one for P(X≤2)P(X \le 2).

Practise this

Sources & how we know this

ExamExplained