01 / 21

Continuous
Random Variables

Master probability density functions, compute probabilities as areas under curves, and apply expected value and variance for continuous distributions.

IB Math AI HL

What Is a Continuous Random Variable?

A continuous random variable \(X\) can take any value within an interval (or the entire real line). Unlike discrete variables that jump between isolated values, continuous variables flow smoothly: think of height, time, or temperature.

Discrete vs Continuous: A Visual

Discrete 1 2 3 4 P Continuous
\(P(a < X < b)\)
a b
\(f(x)\)

Why Does \(P(X = a) = 0\)?

A single point has zero width. Since probability equals area, and the area of a line segment with zero width is zero, any single value has probability zero.

This is a key conceptual shift from discrete probability. We never ask "What is the probability of exactly 3.7?" but rather "What is the probability between 3.5 and 4.0?"

The Probability Density Function

A function \(f(x)\) is a probability density function (pdf) for a continuous random variable \(X\) if it satisfies two conditions:

1
Non-negativity: \(f(x) \geq 0\) for all \(x\)
2
Total area equals 1: \(\displaystyle\int_{-\infty}^{\infty} f(x)\,dx = 1\)

Computing Probability from a PDF

\(f(x)\)
\(x\)
a b Area

Expected Value and Variance

Expected Value
$$E(X) = \int_{-\infty}^{\infty} x \cdot f(x)\,dx$$
The "balance point" of the distribution: a weighted average where \(f(x)\) acts as the weight.
Variance
$$\text{Var}(X) = \int_{-\infty}^{\infty} (x - \mu)^2 f(x)\,dx$$
Equivalently: \(\text{Var}(X) = E(X^2) - [E(X)]^2\), which is often easier to compute.

PDF vs CDF: Key Distinction

PDF: \(f(x)\) CDF: \(F(x)\)
Definition Density at point \(x\) \(F(x) = P(X \leq x)\)
Output range \(f(x) \geq 0\) (can exceed 1) \(0 \leq F(x) \leq 1\)
Gives probability? Not directly: need to integrate Yes: \(F(b) - F(a)\)
Relationship \(f(x) = F'(x)\) \(F(x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt\)
Shape Can be any non-negative curve Always non-decreasing, 0 to 1

How to Apply: Step-by-Step

1
Identify the pdf \(f(x)\) and the interval where it is defined (its domain).
2
Check validity: verify \(f(x) \geq 0\) and \(\displaystyle\int f(x)\,dx = 1\) over the domain. Use this to find unknown constants.
3
Find probability: integrate \(f(x)\) over the desired interval: \(P(a \leq X \leq b) = \displaystyle\int_a^b f(x)\,dx\).
4
Compute \(E(X)\) and \(\text{Var}(X)\): use the integral formulas or the shortcut \(\text{Var}(X) = E(X^2) - \mu^2\).

Example 1: Finding \(k\)

A continuous random variable \(X\) has pdf $$f(x) = kx, \quad 0 \leq x \leq 4$$ and \(f(x) = 0\) otherwise. Find the value of \(k\).

\(f(x)\)
\(x\)
0 4 Area = 1
\(f(x) = kx\)

Example 2: Finding \(P(1 \leq X \leq 3)\)

Using \(f(x) = \frac{1}{8}x\) for \(0 \leq x \leq 4\), find \(P(1 \leq X \leq 3)\).

\(f(x)\)
\(x\)
0 1 3 4 Area = ?

Example 3: \(E(X)\) and \(\text{Var}(X)\)

For \(f(x) = \frac{1}{8}x\), \(0 \leq x \leq 4\), find the expected value and variance.

Example 4: Piecewise PDF

Given the pdf: $$f(x) = \begin{cases} cx^2 & 0 \leq x \leq 3 \\ 0 & \text{otherwise} \end{cases}$$ Find \(c\), then compute \(P(X > 2)\).

Mode and Median of a PDF

Mode
The value of \(x\) where \(f(x)\) is maximum. Find by setting \(f'(x) = 0\) or inspecting the graph.
Median
The value \(m\) where half the area lies on each side: $$\int_{-\infty}^{m} f(x)\,dx = \frac{1}{2}$$

Common Mistakes to Avoid

✕ Treating \(f(x)\) as probability
\(f(x)\) is a density, not a probability. It can exceed 1. Only the integral (area) gives probability.
✕ Forgetting the total area condition
When finding a constant \(k\), you must set \(\displaystyle\int f(x)\,dx = 1\) over the entire domain, not just part of it.
✕ Wrong limits of integration
Always integrate within the domain of \(f(x)\). If \(f(x) = 0\) outside \([0,4]\), then \(P(X > 3) = \displaystyle\int_3^4 f(x)\,dx\), not \(\displaystyle\int_3^{\infty} f(x)\,dx\).

Summary: Key Formulas

Quantity Formula
Validity \(\displaystyle\int_{-\infty}^{\infty} f(x)\,dx = 1\), \(f(x) \geq 0\)
Probability \(P(a \leq X \leq b) = \displaystyle\int_a^b f(x)\,dx\)
Expected value \(E(X) = \displaystyle\int x\,f(x)\,dx\)
Variance \(\text{Var}(X) = E(X^2) - [E(X)]^2\)
CDF \(F(x) = \displaystyle\int_{-\infty}^{x} f(t)\,dt\)
Median \(\displaystyle\int_{-\infty}^{m} f(x)\,dx = \frac{1}{2}\)

Question 1 of 5

If \(f(x) = kx^2\) for \(0 \leq x \leq 2\) and \(f(x) = 0\) otherwise, what is the value of \(k\)?

Question 2 of 5

For the pdf \(f(x) = \frac{1}{8}x\) on \([0, 4]\), what is \(P(X > 2)\)?

Question 3 of 5

Which of the following is true about a probability density function \(f(x)\)?

Question 4 of 5

For a continuous random variable with pdf \(f(x) = \frac{3}{8}x^2\) on \([0,2]\), what is \(E(X)\)?

Question 5 of 5

The median \(m\) of a continuous random variable satisfies: