Probability · Varsity Maths

Continuous Probability
Distributions

PDFs, CDFs, the Uniform, Exponential and Normal distributions, with interactive diagrams, 10 worked examples and a quiz.

Share this page

§ 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.

Key distinction For a continuous random variable X, P(X = a) = 0 for any single value a. Only intervals carry positive probability. We always write P(a ≤ X ≤ b) — never "equals a specific value."

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.

Definition — PDF
P(a ≤ X ≤ b) = ∫ab f(x) dx

For f(x) to qualify as a valid PDF, it must satisfy two conditions. These are not suggestions: they are the defining properties:

Two Conditions for a Valid PDF
1.   f(x) ≥ 0   for all x 2.   ∫−∞ f(x) dx = 1

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.

Important: f(x) can exceed 1 Because f(x) is a density, not a probability, it is perfectly legal for f(x) to be greater than 1. The Uniform(0, 0.5) distribution has f(x) = 2 on its support. What must equal 1 is the total area under f, not the height.

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.

Definition — CDF
F(x) = P(X ≤ x) = ∫−∞x f(t) dt

The CDF has three important properties that follow directly from the definition:

Properties of the CDF
1.   0 ≤ F(x) ≤ 1   for all x 2.   F is non-decreasing 3.   limx→−∞ F(x) = 0,   limx→∞ F(x) = 1

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:

FTC Relationship
f(x) = F′(x) = d/dx [F(x)]

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:

Interval Probability via CDF
P(a ≤ X ≤ b) = F(b) − F(a)

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).

Uniform(a, b) — PDF, CDF, Mean and Variance
f(x) = 1/(b−a)   for a ≤ x ≤ b,   else 0 F(x) = (x−a)/(b−a)   for a ≤ x ≤ b E[X] = (a+b)/2     Var(X) = (b−a)²/12
Why is the variance (b−a)²/12? The variance of U(a,b) is derived by computing E[X²] − (E[X])². You integrate x² × 1/(b−a) from a to b, subtract the square of the mean. The factor of 12 in the denominator is a fixed arithmetic consequence — it is not an approximation.

Worked Examples — Uniform Distribution

Example 1 — Basic PDF and Probability

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).

  1. (a) PDF: X ~ U(0,10), so f(x) = 1/(10−0) = 0.1 for 0 ≤ x ≤ 10, else 0.
  2. (b) P(3 ≤ X ≤ 7): Area of rectangle with width 4 and height 0.1. = 0.1 × (7 − 3) = 0.1 × 4 = 0.40
  3. (c) P(X > 8): Width is 10 − 8 = 2. = 0.1 × 2 = 0.20
  4. 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.
Example 2 — CDF and Inverse CDF

For X ~ U(2, 6), find F(x) in general, then find the value m such that P(X ≤ m) = 0.75.

  1. CDF: F(x) = (x − 2)/(6 − 2) = (x − 2)/4 for 2 ≤ x ≤ 6.
  2. Find m: Set F(m) = 0.75. (m − 2)/4 = 0.75 m − 2 = 3    ⟹    m = 5
  3. Check: F(5) = (5−2)/4 = 3/4 = 0.75. ✓
  4. The value m = 5 is called the 75th percentile (or third quartile) of this distribution.
Example 3 — Verifying a PDF is Valid

Is f(x) = 3x² for 0 ≤ x ≤ 1, else 0, a valid PDF?

  1. Condition 1 (non-negative): On [0,1], x² ≥ 0 so 3x² ≥ 0. ✓
  2. Condition 2 (integrates to 1): ∫₀¹ 3x² dx = [x³]₀¹ = 1 − 0 = 1 ✓
  3. 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.

Exponential(λ) — PDF, CDF, Mean and Variance
f(x) = λe−λx   for x ≥ 0    (else 0) F(x) = 1 − e−λx   for x ≥ 0 E[X] = 1/λ       Var(X) = 1/λ²

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:

Memoryless Property
P(X > s + t | X > s) = P(X > t)

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.

Common mistake — confusing λ and 1/λ Some textbooks parameterise by the mean β = 1/λ instead of the rate. Always check: is your parameter the rate (high number = fast events, short waits) or the mean (high number = slow events, long waits)? The two parameterisations give different PDFs: f(x) = λe−λx vs f(x) = (1/β)e−x/β.

Worked Examples — Exponential Distribution

Example 4 — Computing Probabilities

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.

  1. (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
  2. (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
  3. (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
  4. Note: the median ≈ 1.386 is less than the mean = 1/0.5 = 2 hours, reflecting the right-skewed shape of the exponential.
Example 5 — Memoryless Property in Action

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?

  1. Using the memoryless property: P(X > 4 + 6 | X > 4) = P(X > 6).
  2. 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
  3. There is approximately a 22.3% chance of waiting at least 6 more minutes, regardless of having already waited 4.
  4. Verify directly: P(X > 10 | X > 4) = P(X > 10)/P(X > 4) = e−2.5/e−1 = e−1.5 ≈ 0.2231. ✓
Example 6 — Finding the Rate from a Given Probability

A machine's time to failure X follows Exp(λ). Engineers require P(X > 100) ≥ 0.95. What is the maximum allowable failure rate λ?

  1. Set up the inequality: P(X > 100) = e−100λ ≥ 0.95
  2. Take natural logs (inequality flips since ln is increasing): −100λ ≥ ln(0.95) λ ≤ −ln(0.95)/100 = ln(1/0.95)/100
  3. Compute: ln(1/0.95) = ln(1.0526) ≈ 0.05129. λ ≤ 0.05129/100 ≈ 0.000513 failures per hour
  4. 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.

Normal(μ, σ²) — PDF
f(x) = (1 / (σ√(2π))) · exp(−(x−μ)² / (2σ²))

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:

Standardisation
Z = (X − μ) / σ

See the dedicated Normal Distribution page for full coverage including the z-table, 68-95-99.7 rule, and inverse normal calculations.

Example 7 — Standardising and Reading a Z-Table

Heights of adult males follow N(178, 7²) cm. Find P(X > 185).

  1. Standardise: Z = (185 − 178)/7 = 7/7 = 1.00.
  2. P(X > 185) = P(Z > 1.00) = 1 − Φ(1.00).
  3. From z-table: Φ(1.00) ≈ 0.8413.
  4. P(X > 185) = 1 − 0.8413 = 0.1587.
  5. 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
Example 8 — Deriving a CDF from a PDF

Given f(x) = 2e−2x for x ≥ 0, find F(x) and hence P(0.5 ≤ X ≤ 1).

  1. Recognise: this is Exp(λ = 2). Confirm: ∫₀ 2e−2x dx = [−e−2x]₀ = 0 − (−1) = 1. ✓
  2. Find F(x) by integrating from 0 to x: F(x) = ∫₀x 2e−2t dt = [−e−2t]₀x = 1 − e−2x
  3. 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
Example 9 — Finding the Constant k

Let f(x) = kx(1 − x) for 0 ≤ x ≤ 1. Find k so that f is a valid PDF, then find E[X].

  1. 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
  2. So f(x) = 6x(1−x) on [0,1]. (This is Beta(2,2).)
  3. 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
  4. By symmetry of f around x = 0.5, E[X] = 0.5 makes sense. ✓
Example 10 — Mixed Problem: CDF → PDF → Probability

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.

  1. (a) PDF: f(x) = F′(x) = 3x² for 0 ≤ x ≤ 1, else 0.
  2. (b) Probability: P(0.2 ≤ X ≤ 0.8) = F(0.8) − F(0.2) = (0.8)³ − (0.2)³ = 0.512 − 0.008 = 0.504
  3. (c) Median m: F(m) = 0.5. m³ = 0.5  ⟹  m = (0.5)1/3 = 1/∛2 ≈ 0.7937

§ 08Common Mistakes

Mistake 1 — Treating f(x) as a probability Writing P(X = 2) = f(2) = 0.5 is wrong. f(x) is a density; probabilities require integration over an interval. P(X = 2) = 0 always, for any continuous variable.
Mistake 2 — Forgetting to check PDF validity Before computing anything, always verify: (1) f(x) ≥ 0 everywhere, and (2) ∫f(x)dx = 1. Many exam questions give invalid PDFs as distractors.
Mistake 3 — Confusing the exponential rate and mean If X ~ Exp(λ = 2), the mean is 1/2 = 0.5, NOT 2. The rate and mean are reciprocals. Higher λ = faster events = shorter average wait.
Mistake 4 — Using strict vs non-strict inequalities For continuous variables, P(X ≤ a) = P(X < a) = F(a). The endpoints make no difference. So P(1 ≤ X ≤ 3) = P(1 < X < 3) = F(3) − F(1). This is never true for discrete distributions.

§ 10Quiz — Test Your Understanding

10 questions covering PDFs, CDFs, Uniform, Exponential and Normal distributions. Select your answer and get instant feedback.

Score: 0 / 0
Question 1 of 10

Which of the following MUST be true for a function f(x) to be a valid PDF?

Question 2 of 10

X ~ Uniform(0, 4). What is P(1 ≤ X ≤ 3)?

Question 3 of 10

If X ~ Exp(λ = 0.5), what is E[X]?

Question 4 of 10

What is the relationship between the CDF F(x) and the PDF f(x)?

Question 5 of 10

For a continuous random variable X, what is P(X = 3.7)?

Question 6 of 10

X ~ Exp(λ = 2). Find P(X > 1) to 4 decimal places.

Question 7 of 10

The memoryless property states that for X ~ Exp(λ):

Question 8 of 10

What is the variance of X ~ Uniform(2, 8)?

Question 9 of 10

f(x) = cx² for 0 ≤ x ≤ 3, else 0 is a valid PDF. What is c?

Question 10 of 10

For a continuous distribution, P(a ≤ X ≤ b) can be computed as:

0/10

Complete the quiz to see your score!

Cookie Settings