§ 01What Is a Continuous Random Variable?
A continuous random variable can take any value in an interval: not just a countable list of outcomes. Temperature, time, weight and distance are all continuous.
In the discrete world we dealt with probability mass functions that assigned probability to each exact outcome: P(X = 3) = 0.2, for example. The continuous world works differently. Because there are infinitely many possible values in any interval, the probability of landing on any one exact value is zero. What matters instead is the probability of landing inside an interval.
This shift in thinking, from "probability at a point" to "probability over an interval", is the foundational idea of continuous distributions, and it is the integral that does the work.
This might feel odd at first. If every single value has probability zero, how can they all add up to one? The resolution is that uncountably many zeros summed via integration can produce a finite area. Think of it like this: a line segment has zero area, but assembled continuously into a square the area is very real.
§ 02The Probability Density Function (PDF)
The probability density function f(x) of a continuous random variable X encodes how probability is distributed across its range. It is not itself a probability, it is a density, meaning it tells you how much probability is packed into an infinitesimally thin slice around x.
For f(x) to qualify as a valid PDF, it must satisfy two conditions. These are not suggestions: they are the defining properties:
Condition 1 says density cannot be negative: you cannot have negative probability of being near a value. Condition 2 says the total probability must equal 1, the random variable must land somewhere.
Interactive — PDF Shaded Area = P(a ≤ X ≤ b)
Shaded area = P(0.5 ≤ X ≤ 2.0). Drag the sliders to change the interval.
§ 03The Cumulative Distribution Function (CDF)
The cumulative distribution function F(x) gives the probability that X takes a value less than or equal to x. It is the running total of probability from the left tail up to x.
The CDF has three important properties that follow directly from the definition:
The relationship between the PDF and CDF runs both ways. The CDF is the integral of the PDF, and (by the Fundamental Theorem of Calculus) the PDF is the derivative of the CDF:
This is enormously useful. If you are given the CDF and need the PDF, just differentiate. If you have the PDF and need the CDF, integrate. They are two sides of the same coin.
Computing interval probabilities is straightforward with the CDF:
Interactive — CDF grows from 0 to 1
The CDF (teal curve) is the running integral of the PDF (gold curve). It starts at 0 and climbs monotonically to 1.
§ 04The Uniform Distribution — Constant Density
The simplest continuous distribution: every value in an interval [a, b] is equally likely.
If X ~ Uniform(a, b), the random variable is equally likely to fall anywhere between a and b. The PDF is flat (a horizontal line) and outside [a, b] it is zero. Since the total area must equal 1 and the width of the rectangle is b − a, the height must be 1/(b − a).
Worked Examples — Uniform Distribution
A bus arrives at a random time uniformly distributed between 0 and 10 minutes. Find: (a) the PDF, (b) P(3 ≤ X ≤ 7), (c) P(X > 8).
- (a) PDF: X ~ U(0,10), so f(x) = 1/(10−0) = 0.1 for 0 ≤ x ≤ 10, else 0.
- (b) P(3 ≤ X ≤ 7): Area of rectangle with width 4 and height 0.1. = 0.1 × (7 − 3) = 0.1 × 4 = 0.40
- (c) P(X > 8): Width is 10 − 8 = 2. = 0.1 × 2 = 0.20
- Interpretation: there is a 40% chance the bus arrives between minutes 3 and 7, and a 20% chance it is more than 8 minutes late.
For X ~ U(2, 6), find F(x) in general, then find the value m such that P(X ≤ m) = 0.75.
- CDF: F(x) = (x − 2)/(6 − 2) = (x − 2)/4 for 2 ≤ x ≤ 6.
- Find m: Set F(m) = 0.75. (m − 2)/4 = 0.75 m − 2 = 3 ⟹ m = 5
- Check: F(5) = (5−2)/4 = 3/4 = 0.75. ✓
- The value m = 5 is called the 75th percentile (or third quartile) of this distribution.
Is f(x) = 3x² for 0 ≤ x ≤ 1, else 0, a valid PDF?
- Condition 1 (non-negative): On [0,1], x² ≥ 0 so 3x² ≥ 0. ✓
- Condition 2 (integrates to 1): ∫₀¹ 3x² dx = [x³]₀¹ = 1 − 0 = 1 ✓
- Both conditions satisfied, this is a valid PDF. (It is actually the PDF of the distribution Beta(3, 1).)
§ 05The Exponential Distribution — Modelling Wait Times
The exponential distribution models the time until the first occurrence of an event in a Poisson process: radioactive decay, call centre wait times, time between bus arrivals.
If X ~ Exp(λ), then λ is the rate parameter (events per unit time). The distribution has a distinctive shape: it starts at its maximum height and decays exponentially towards zero. Large values are possible but increasingly unlikely.
The mean 1/λ is the expected waiting time. If buses arrive at rate λ = 0.2 per minute, the expected wait is 1/0.2 = 5 minutes.
Interactive — Exponential PDF: vary the rate λ
Higher λ means shorter expected wait, the curve steepens and the mean 1/λ shifts left.
The Memoryless Property
The exponential distribution has a remarkable feature called the memoryless property. It states that the probability of waiting at least s + t more time, given you have already waited s, is the same as the probability of waiting at least t from the beginning:
Intuitively: the distribution has no memory of how long it has already waited. A lightbulb does not "age", if it has survived 1000 hours, the probability it lasts another 100 hours is exactly the same as for a brand new bulb. The exponential distribution is the only continuous distribution with this property.
Worked Examples — Exponential Distribution
The lifetime X of a component follows Exp(λ = 0.5) (rate 0.5 failures per hour). Find: (a) P(X > 3), (b) P(1 ≤ X ≤ 4), (c) the median lifetime.
- (a) P(X > 3): Use the survival function 1 − F(x) = e−λx. P(X > 3) = e−0.5 × 3 = e−1.5 ≈ 0.2231
- (b) P(1 ≤ X ≤ 4): = F(4) − F(1) = (1 − e−2) − (1 − e−0.5) = e−0.5 − e−2 ≈ 0.6065 − 0.1353 = 0.4712
- (c) Median: Find m such that F(m) = 0.5. 1 − e−0.5m = 0.5 ⟹ e−0.5m = 0.5 −0.5m = ln(0.5) ⟹ m = −2 ln(0.5) = 2 ln 2 ≈ 1.386 hours
- Note: the median ≈ 1.386 is less than the mean = 1/0.5 = 2 hours, reflecting the right-skewed shape of the exponential.
A customer's call wait time is Exp(λ = 0.25) minutes. Given that a caller has already waited 4 minutes, what is the probability they wait at least 6 more minutes?
- Using the memoryless property: P(X > 4 + 6 | X > 4) = P(X > 6).
- The conditioning on "already waited 4 minutes" is irrelevant: just compute P(X > 6). P(X > 6) = e−0.25 × 6 = e−1.5 ≈ 0.2231
- There is approximately a 22.3% chance of waiting at least 6 more minutes, regardless of having already waited 4.
- Verify directly: P(X > 10 | X > 4) = P(X > 10)/P(X > 4) = e−2.5/e−1 = e−1.5 ≈ 0.2231. ✓
A machine's time to failure X follows Exp(λ). Engineers require P(X > 100) ≥ 0.95. What is the maximum allowable failure rate λ?
- Set up the inequality: P(X > 100) = e−100λ ≥ 0.95
- Take natural logs (inequality flips since ln is increasing): −100λ ≥ ln(0.95) λ ≤ −ln(0.95)/100 = ln(1/0.95)/100
- Compute: ln(1/0.95) = ln(1.0526) ≈ 0.05129. λ ≤ 0.05129/100 ≈ 0.000513 failures per hour
- The mean time between failures must be at least 1/λ ≈ 1948 hours.
§ 06The Normal Distribution — The Queen of Continuous Distributions
The normal distribution (also called the Gaussian distribution) is by far the most important continuous distribution in statistics. It arises naturally whenever a random variable is the sum of many independent influences, hence its ubiquity in measurement errors, biological measurements, financial returns, and exam scores.
The parameter μ (mu) controls the centre of the bell curve, the peak is directly above x = μ. The parameter σ (sigma, the standard deviation) controls the width: larger σ produces a wider, flatter bell; smaller σ produces a narrower, taller bell.
The standard normal distribution Z ~ N(0, 1) has μ = 0 and σ = 1. Any normal variable can be converted to a standard normal using the z-score transformation:
See the dedicated Normal Distribution page for full coverage including the z-table, 68-95-99.7 rule, and inverse normal calculations.
Heights of adult males follow N(178, 7²) cm. Find P(X > 185).
- Standardise: Z = (185 − 178)/7 = 7/7 = 1.00.
- P(X > 185) = P(Z > 1.00) = 1 − Φ(1.00).
- From z-table: Φ(1.00) ≈ 0.8413.
- P(X > 185) = 1 − 0.8413 = 0.1587.
- About 15.9% of adult males are taller than 185 cm.
§ 07Distribution Comparison — Uniform, Exponential, Normal
| Distribution | PDF f(x) | Support | Mean | Variance | Key Use |
|---|---|---|---|---|---|
| Uniform(a, b) | 1/(b−a) | [a, b] | (a+b)/2 | (b−a)²/12 | Equal likelihood on interval |
| Exponential(λ) | λe−λx | [0, ∞) | 1/λ | 1/λ² | Wait times, lifetimes |
| Normal(μ, σ²) | (1/σ√2π) e−(x−μ)²/2σ² | (−∞, ∞) | μ | σ² | Natural measurements, CLT |
| Beta(α, β) | xα−1(1−x)β−1/B(α,β) | [0, 1] | α/(α+β) | αβ/[(α+β)²(α+β+1)] | Proportions, probabilities |
| Gamma(α, β) | xα−1e−x/β/(βαΓ(α)) | [0, ∞) | αβ | αβ² | Sum of exponentials, reliability |
Given f(x) = 2e−2x for x ≥ 0, find F(x) and hence P(0.5 ≤ X ≤ 1).
- Recognise: this is Exp(λ = 2). Confirm: ∫₀∞ 2e−2x dx = [−e−2x]₀∞ = 0 − (−1) = 1. ✓
- Find F(x) by integrating from 0 to x: F(x) = ∫₀x 2e−2t dt = [−e−2t]₀x = 1 − e−2x
- Compute P(0.5 ≤ X ≤ 1): = F(1) − F(0.5) = (1 − e−2) − (1 − e−1) = e−1 − e−2 ≈ 0.3679 − 0.1353 = 0.2326
Let f(x) = kx(1 − x) for 0 ≤ x ≤ 1. Find k so that f is a valid PDF, then find E[X].
- Integrate and set equal to 1: k ∫₀¹ x(1−x) dx = 1 ∫₀¹ (x − x²) dx = [x²/2 − x³/3]₀¹ = 1/2 − 1/3 = 1/6 k × 1/6 = 1 ⟹ k = 6
- So f(x) = 6x(1−x) on [0,1]. (This is Beta(2,2).)
- Find E[X]: E[X] = ∫₀¹ x · 6x(1−x) dx = 6 ∫₀¹ (x² − x³) dx = 6[x³/3 − x⁴/4]₀¹ = 6(1/3 − 1/4) = 6 × 1/12 = 1/2
- By symmetry of f around x = 0.5, E[X] = 0.5 makes sense. ✓
The CDF of a random variable is F(x) = x³ for 0 ≤ x ≤ 1. Find: (a) the PDF, (b) P(0.2 ≤ X ≤ 0.8), (c) the median.
- (a) PDF: f(x) = F′(x) = 3x² for 0 ≤ x ≤ 1, else 0.
- (b) Probability: P(0.2 ≤ X ≤ 0.8) = F(0.8) − F(0.2) = (0.8)³ − (0.2)³ = 0.512 − 0.008 = 0.504
- (c) Median m: F(m) = 0.5. m³ = 0.5 ⟹ m = (0.5)1/3 = 1/∛2 ≈ 0.7937
§ 08Common Mistakes
§ 09Continue Learning — Related Pages
Continuous distributions connect closely to several other topics. Work through these pages for a complete picture.
§ 10Quiz — Test Your Understanding
10 questions covering PDFs, CDFs, Uniform, Exponential and Normal distributions. Select your answer and get instant feedback.
Which of the following MUST be true for a function f(x) to be a valid PDF?
X ~ Uniform(0, 4). What is P(1 ≤ X ≤ 3)?
If X ~ Exp(λ = 0.5), what is E[X]?
What is the relationship between the CDF F(x) and the PDF f(x)?
For a continuous random variable X, what is P(X = 3.7)?
X ~ Exp(λ = 2). Find P(X > 1) to 4 decimal places.
The memoryless property states that for X ~ Exp(λ):
What is the variance of X ~ Uniform(2, 8)?
f(x) = cx² for 0 ≤ x ≤ 3, else 0 is a valid PDF. What is c?
For a continuous distribution, P(a ≤ X ≤ b) can be computed as:
Complete the quiz to see your score!