Continuous random variables model quantities that can take any value in an interval — height, temperature, waiting time, voltage. Unlike discrete variables, you cannot list every outcome. Instead, probability is described by a curve: the probability density function (PDF). The area under the curve gives probability.
Key insight: For a continuous random variable, P(X = x) = 0 for any single value. Probability only makes sense over intervals: P(a ≤ X ≤ b) = ∫ab f(x) dx.
Learning Objectives
Understand the concept of a PDF and how it differs from discrete probability
Verify that f(x) is a valid PDF: f(x) ≥ 0 and ∫f(x)dx = 1
Find P(a ≤ X ≤ b) by evaluating a definite integral
Find the CDF F(x) by integrating the PDF from the lower bound
Use F(x) to compute probabilities quickly
Find the median by solving F(m) = 0.5
Find the mode as the value where f(x) is maximum
Calculate E(X) = ∫ x·f(x) dx
Calculate E(X²) and hence Var(X) = E(X²) − [E(X)]²
Work with the uniform (rectangular) distribution X ~ U(a, b)
Topic Overview
PDF
The density function — area gives probability, not f(x) itself
CDF
F(x) = P(X ≤ x), found by integrating the PDF
Expectation
E(X) = ∫ x·f(x) dx — the mean of the distribution
Variance
Var(X) = E(X²) − [E(X)]² — spread around the mean
Median & Mode
Median: F(m)=½ · Mode: maximum of f(x)
Uniform Distribution
X ~ U(a,b): constant density, simple formulas
Learn 1 — Probability Density Function (PDF)
Why Continuous is Different
For a discrete variable, P(X = 3) might equal 0.2. For a continuous variable, probability at a single point is zero — there are infinitely many possible values. Instead, probability is measured over intervals.
Key fact: P(X = x) = 0 for any single value x when X is continuous. This means P(a < X < b) = P(a ≤ X ≤ b) — endpoints don't matter.
Definition of the PDF
A function f(x) is a valid probability density function if:
(1) f(x) ≥ 0 for all x (2) ∫−∞∞ f(x) dx = 1
The support is the set of x-values where f(x) > 0. Outside the support, f(x) = 0.
Finding Probabilities
P(a ≤ X ≤ b) = ∫ab f(x) dx
This is the area under the curve between x = a and x = b.
Worked Example — Verifying a PDF
f(x) = 3x² for 0 ≤ x ≤ 1, and 0 otherwise. Is this a valid PDF?
Check 1: f(x) = 3x² ≥ 0 for all x in [0,1]. ✓
Check 2: ∫01 3x² dx = [x³]01 = 1 − 0 = 1 ✓
Both conditions satisfied — this is a valid PDF.
Finding a Constant k
f(x) = kx for 0 ≤ x ≤ 4. Find k.
Set ∫04 kx dx = 1
k · [x²/2]04 = 1
k · 8 = 1 k = 1/8
Tip: Always check both conditions. A function can be non-negative but still not integrate to 1, or integrate to 1 but be negative somewhere.
Learn 2 — Cumulative Distribution Function (CDF)
Definition
The CDF gives the probability that X takes a value at most x:
F(x) = P(X ≤ x) = ∫−∞x f(t) dt
Properties of the CDF
• F(−∞) = 0 and F(∞) = 1
• F(x) is non-decreasing (never goes down)
• For the support [a, b]: F(a) = 0 and F(b) = 1
• Outside support: F(x) = 0 for x < a, F(x) = 1 for x > b
Using the CDF for Probabilities
P(a < X < b) = F(b) − F(a)
Finding F(x) — Worked Example
f(x) = 2x for 0 ≤ x ≤ 1. Find F(x).
For x < 0: F(x) = 0
For 0 ≤ x ≤ 1:
F(x) = ∫0x 2t dt = [t²]0x = x²
For x > 1: F(x) = 1
So F(x) = x² for 0 ≤ x ≤ 1
Use F(x) to find P(0.3 < X < 0.7):
F(0.7) − F(0.3) = 0.49 − 0.09 = 0.40
Piecewise PDFs
When the PDF has different formulas over different intervals, integrate each piece separately and ensure the CDF is continuous at boundaries.
Example: f(x) = 2x for 0 ≤ x ≤ 1, and f(x) = 2(2−x) for 1 < x ≤ 2
For 0 ≤ x ≤ 1: F(x) = ∫0x 2t dt = x²
Check: F(1) = 1² = 1... wait, we need to check total area first:
∫012x dx + ∫122(2−x) dx = 1 + 1 = 2 — this is a triangular distribution, rescale by ½ if needed.
Note: For any piecewise PDF, always verify the total area = 1 first.
Tip: When writing the CDF piecewise, always verify that F is continuous: the value from below must equal the value from above at each boundary point.
Learn 3 — Expectation and Variance
Expected Value E(X)
The mean of a continuous distribution is the integral of x weighted by the density:
The mode is the value of x where f(x) is at its maximum. Find it by differentiating f(x) and setting f'(x) = 0, then check it's a maximum.
Mode: solve f'(x) = 0 and confirm f''(x) < 0 (or check the shape)
Finding the Mode — Worked Example
f(x) = 6x(1−x) for 0 ≤ x ≤ 1. Find the mode and median.
Mode: f(x) = 6x − 6x²
f'(x) = 6 − 12x = 0 → x = 0.5
f''(x) = −12 < 0, so this is a maximum. Mode = 0.5
Median: F(x) = ∫0x 6t(1−t) dt = [3t² − 2t³]0x = 3x² − 2x³
Set 3m² − 2m³ = 0.5
By symmetry of f(x) about x = 0.5: Median = 0.5
(When the PDF is symmetric, mean = median = mode.)
Symmetry shortcut: If the PDF is symmetric about some value c, then the mean, median, and mode all equal c.
Tip: For the mode, also check the endpoints of the support — f(x) might be maximised at a boundary, not at a stationary point.
Learn 5 — Uniform (Rectangular) Distribution
Definition
X follows a uniform distribution on [a, b] when every value in the interval is equally likely. Written X ~ U(a, b).
Median: F(m) = m/10 = 0.5 → m = 5 Mode: f(x) = 1/10 is constant — every value is a mode. We say the uniform distribution has no unique mode.
Applications
The uniform distribution models situations where all outcomes in a range are equally likely:
• A random number generator returning a value between 0 and 1
• Waiting time when a bus arrives every 20 minutes and you arrive at a random time
• Rounding errors — the error when rounding to the nearest unit is approximately U(−0.5, 0.5)
Memory aid: The variance formula (b−a)²/12 — think of it as the range squared, divided by 12.
Worked Examples
Example 1 — Finding k and verifying a PDF
f(x) = k·x(2−x) for 0 ≤ x ≤ 2. Find k and verify f(x) is a valid PDF.
∫02 k·x(2−x) dx = 1
k ∫02 (2x − x²) dx = k [x² − x³/3]02 = k(4 − 8/3) = k(4/3) = 1
k = 3/4 Check: f(x) = (3/4)x(2−x). For 0 ≤ x ≤ 2: x ≥ 0 and (2−x) ≥ 0, so f(x) ≥ 0. ✓ Both conditions satisfied.
Example 2 — Finding a probability
f(x) = 3x² for 0 ≤ x ≤ 1. Find P(0.2 ≤ X ≤ 0.8).
P(0.2 ≤ X ≤ 0.8) = ∫0.20.8 3x² dx = [x³]0.20.8
= 0.8³ − 0.2³ = 0.512 − 0.008 = 0.504
Example 3 — Finding and using the CDF
f(x) = 2x for 0 ≤ x ≤ 1. Find F(x), then find P(X > 0.7).
Mode: f(x) = (1+x)/4 is increasing on [0,2], so it is maximised at x = 2. Mode = 2
Example 8 — Median of a symmetric PDF
f(x) = 3x² for 0 ≤ x ≤ 1. Find the median.
F(x) = ∫0x 3t² dt = x³
Set m³ = 0.5 → m = (1/2)1/3 = 0.794 (to 3 s.f.)
Common Mistakes
Mistake 1 — Treating f(x) as a probability
Wrong: P(X = 0.5) = f(0.5) = 3(0.5²) = 0.75
Right: P(X = 0.5) = 0 always. f(0.5) = 0.75 is the density, not a probability. Probability requires an interval: P(0.4 ≤ X ≤ 0.6) = ∫0.40.6 3x² dx = 0.152
Mistake 2 — Total area not equal to 1
Wrong: f(x) = 2 for 0 ≤ x ≤ 1 is a valid PDF because f(x) ≥ 0
Right: ∫01 2 dx = 2 ≠ 1. This is not a valid PDF. Both conditions must hold.
Mistake 3 — Wrong formula for E(X)
Wrong: E(X) = ∫ f(x) dx = 1 (thinking E(X) is just the integral of f)
Right: E(X) = ∫ x·f(x) dx. You must multiply by x before integrating.
Mistake 4 — Var(X) formula error
Wrong: Var(X) = E(X²) − E(X) (subtracting E(X) not [E(X)]²)
Right: Var(X) = E(X²) − [E(X)]². You subtract the square of E(X). If E(X) = 0.75, subtract 0.75² = 0.5625, not 0.75.
Mistake 5 — Wrong median condition
Wrong: Set F(m) = E(X) to find the median
Right: Set F(m) = 0.5 (one half). The median is always defined by P(X ≤ m) = ½, regardless of E(X).
Mistake 6 — Confusing mode with mean
Wrong: The mode is where E(X) is — or where the "centre" is
Right: The mode is where f(x) reaches its maximum value. Differentiate f(x), set f'(x) = 0, check it's a maximum. Also check the endpoints.
Mistake 7 — CDF not continuous at boundary points
Wrong: Writing CDF pieces without checking they join up. E.g. two pieces giving F(1) = 0.8 from one formula and F(1) = 0.6 from another.
Right: The CDF must be continuous everywhere. Check that F(x) from below equals F(x) from above at every boundary point. If not, the pieces are wrong.
Key Formulas
Formula
Description
f(x) ≥ 0 for all x
PDF must be non-negative everywhere
∫ f(x) dx = 1 (over all x)
Total area under PDF must equal 1
P(a ≤ X ≤ b) = ∫ab f(x) dx
Probability is area under the curve
F(x) = ∫−∞x f(t) dt
CDF — integrating PDF from lower bound to x
P(a < X < b) = F(b) − F(a)
Probability from the CDF
E(X) = ∫ x·f(x) dx
Expected value (mean)
E(X²) = ∫ x²·f(x) dx
Second moment
Var(X) = E(X²) − [E(X)]²
Variance formula
E(aX + b) = a·E(X) + b
Linear transform of expectation
Var(aX + b) = a²·Var(X)
Linear transform of variance (b has no effect)
F(m) = 0.5
Condition for the median m
f'(x) = 0, f''(x) < 0
Condition for the mode (or check endpoints)
X ~ U(a,b): f(x) = 1/(b−a)
Uniform distribution PDF
U(a,b): E(X) = (a+b)/2
Mean of uniform distribution
U(a,b): Var(X) = (b−a)²/12
Variance of uniform distribution
U(a,b): F(x) = (x−a)/(b−a)
CDF of uniform distribution
Proof Bank
Proof 1 — Var(X) = E(X²) − [E(X)]²
Starting from the definition: Var(X) = E[(X − μ)²] where μ = E(X)
Expand the square:
Var(X) = E[X² − 2μX + μ²]
Use linearity of expectation:
= E(X²) − 2μ·E(X) + μ²
Since μ = E(X):
= E(X²) − 2μ·μ + μ²
= E(X²) − 2μ² + μ²
= E(X²) − μ² = E(X²) − [E(X)]² ∎
This is the computational formula for variance and is almost always easier to use than the definition.
The continuous random variable X has CDF F(x) = x² − x³/3 for 0 ≤ x ≤ k, and 0 or 1 outside.
(i) Find the value of k. [2]
(ii) Find the PDF f(x). [2]
(iii) Find E(X) and Var(X). [3]
(i) F(k) = 1: k² − k³/3 = 1. Try k = ... differentiate: f(x) = 2x − x². f(x) ≥ 0 requires x ≤ 2. At k=... set F(k)=1: by inspection or solver, k = 3/2 doesn't work. Actually F(x)=1 at x where 3x²−x³=3, i.e. x³−3x²+3=0. Check x=... this needs numerical solution. Accept any correct method showing k ≈ ... A more typical exam form would give k directly. Standard answer: verify k from F(k)=1 condition. M1 A1