Continuous random variables
| English | Chinese | Pinyin |
|---|---|---|
| continuous random variable | 连续型随机变量 | lián xù xíng suí jī biàn liàng |
| probability density function | 概率密度函数 | gài lǜ mì dù hán shù |
| area | 面积 | miàn jī |
| cumulative distribution function | 累积分布函数 | lěi jī fēn bù hán shù |
The curve that tells probabilities
- A continuous random variable 连续型随机变量 can take any value in a range — like the exact time a bus arrives, or the precise height of a person.
- Unlike discrete variables, you can't list probabilities for each value. Instead, a probability density function 概率密度函数 (pdf) describes the shape, and probabilities are areas 面积 under the curve.
The probability density function
- A continuous random variable can take any value in a range, described by a probability density function $f(x)$:
Worked example. $f(x) = \dfrac{x}{8}$ for $0 \leq x \leq 4$, zero otherwise. Check: $\int_0^4 \dfrac{x}{8}\,dx = \left[\dfrac{x^2}{16}\right]_0^4 = \dfrac{16}{16} = 1$. ✓
$f(x)$ is NOT a probability. The value of $f(x)$ at a point can be greater than 1. Only the area under the curve between two points gives a probability.

For a continuous variable, probability is the area under the density f(x)
Area = probability
P(a < X < b) = ∫ f(x) dx
For a continuous variable, probability is the area under the density curve between two values.
A probability density function must satisfy ∫f(x)dx over all x equals what value?
The total area under a pdf is always 1.
The value of f(x) at a point is the probability that X equals that value.
f(x) is a density, not a probability. Only the area under f gives a probability. f(x) can even exceed 1.
For f(x) = x/8 on 0 ≤ x ≤ 4, verify ∫₀⁴ (x/8) dx = [x²/16]₀⁴. What is the result?
[x²/16]₀⁴ = 16/16 − 0 = 1. The total area is 1, confirming it is a valid pdf.
Finding probabilities
- A probability is an area under $f$: $P(a < X < b) = \displaystyle\int_a^b f(x)\,dx$.

Probabilities are areas under f(x); the total area over all x must equal 1.
For a continuous variable, P(a < X < b) is the area under f(x) between a and b.
Probabilities for a continuous variable are areas under the density function.
Finding the mean and variance
- The mean is $E(X) = \displaystyle\int_{-\infty}^{\infty} x\,f(x)\,dx$.
- The variance is $\text{Var}(X) = E(X^2) - (E(X))^2$, where $E(X^2) = \displaystyle\int_{-\infty}^{\infty} x^2\,f(x)\,dx$.
For f(x) = ½x on 0 ≤ x ≤ 2, E(X) = ∫₀² x(½x) dx = [x³/6]₀². What is E(X)? (≈, 2 dp)
E(X) = ∫₀² ½x² dx = [x³/6]₀² = 8/6 = 4/3 ≈ 1.33.
The cumulative distribution function 累积分布函数
- The cdf $F(x) = P(X \leq x) = \displaystyle\int_{-\infty}^x f(t)\,dt$.
- $F(x)$ is the area under $f$ up to $x$. It always increases from 0 to 1.
- Use the density function to find the median and other percentiles.
The cumulative distribution function F(x) gives:
F(x) = P(X ≤ x) = the area under f up to x.
You've got it
- a pdf has $f(x) \geq 0$ and total area $\int f = 1$
- a probability is the area under $f$ between the limits
- the mean $E(X) = \int x\,f(x)\,dx$