01 / 21

Continuous
Random Variables

Explore probability density functions, understand how area under a curve represents probability, and master the tools for continuous distributions.

IB Mathematics: Analysis and Approaches

What is a Continuous Random Variable?

A continuous random variable \(X\) can take any value within an interval on the real number line. Unlike discrete variables that take countable values, continuous variables have uncountably many possible outcomes.

Examples
Height, weight, time, temperature: values can be any real number in a range
Key Insight
For any single value \(a\): \(P(X = a) = 0\). Probability is found over intervals

From Histograms to Density Curves

As we collect more data and use narrower bins, a histogram's outline approaches a smooth curve. This limiting curve is the probability density function (pdf).

\(x\)

\(f(x)\)

\(f(x)\)

More data, finer bins

Why Continuous Variables Matter

Continuous random variables model real-world measurements where precision is limited only by our instruments. They form the backbone of statistical inference, quality control, and scientific modelling.

Normal Distribution
Heights, IQ scores, measurement errors: the bell curve is everywhere
Exponential
Waiting times between events: radioactive decay, service queues
Uniform
Random number generators, equally likely outcomes on an interval

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

Visualising \(P(a \leq X \leq b)\)

\(x\)

\(f(x)\)

\(a\)

\(b\)

\(P(a \le X \le b)\)

\(f(x)\)

Discrete vs Continuous

Discrete Continuous
Values Countable (0, 1, 2, ...) Any real number in an interval
Probability model \(P(X = x)\) via pmf \(f(x)\) via pdf
Finding \(P\) Sum: \(\sum P(X = x_i)\) Integral: \(\int_a^b f(x)\,dx\)
\(P(X = a)\) Can be > 0 Always 0
Expected value \(\sum x_i P(X = x_i)\) \(\int_{-\infty}^{\infty} x f(x)\,dx\)

Expected Value and Variance

Expected Value
$$E(X) = \int_{-\infty}^{\infty} x\,f(x)\,dx$$
Variance
$$\text{Var}(X) = \int_{-\infty}^{\infty} (x - \mu)^2 f(x)\,dx$$

How to Work with a PDF

1
Find the constant. Use \(\displaystyle\int_{-\infty}^{\infty} f(x)\,dx = 1\) to determine any unknown parameter (e.g., \(k\)).
2
Check non-negativity. Verify that \(f(x) \geq 0\) over the entire domain.
3
Find probabilities. Integrate \(f(x)\) over the desired interval: \(\displaystyle P(a \leq X \leq b) = \int_a^b f(x)\,dx\).
4
Compute \(E(X)\) and \(\text{Var}(X)\). Use the integral formulas, often with the shortcut \(\text{Var} = E(X^2) - [E(X)]^2\).
5
Find the median. Solve \(\displaystyle\int_{-\infty}^{m} f(x)\,dx = 0.5\) for \(m\).

Example 1: Finding \(k\)

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

\(x\)

\(f(x)\)

\(0\)

\(4\)

\(f(4) = 4k\)

Area = 1

Example 2: Finding Probabilities

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

\(0\)

\(1\)

\(3\)

\(4\)

\(P(1 \le X \le 3)\)

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

Still using \(\displaystyle f(x) = \frac{x}{8}\) for \(0 \leq x \leq 4\). Find the expected value and variance.

1
\(E(X)\): \(\displaystyle\int_0^4 x \cdot \frac{x}{8}\,dx = \frac{1}{8}\left[\frac{x^3}{3}\right]_0^4 = \frac{1}{8}\cdot\frac{64}{3} =\) \(\frac{8}{3}\)
2
\(E(X^2)\): \(\displaystyle\int_0^4 x^2 \cdot \frac{x}{8}\,dx = \frac{1}{8}\left[\frac{x^4}{4}\right]_0^4 = \frac{1}{8}\cdot 64 = 8\)
3
\(\text{Var}(X)\): \(E(X^2) - [E(X)]^2 = 8 - \left(\frac{8}{3}\right)^2 = 8 - \frac{64}{9} =\) \(\frac{8}{9}\)

Finding the Median

For the same pdf \(\displaystyle f(x) = \frac{x}{8}\) on \([0, 4]\), find the median \(m\).

1
Set up the equation: \(\displaystyle\int_0^m \frac{x}{8}\,dx = 0.5\)
2
Integrate: \(\displaystyle\frac{1}{8}\left[\frac{x^2}{2}\right]_0^m = \frac{m^2}{16} = 0.5\)
3
Solve: \(m^2 = 8\), so \(m = 2\sqrt{2} \approx 2.83\)

Handling Piecewise PDFs

Some pdfs are defined in pieces. For example:

\(0\)

\(2\)

\(4\)

\(f(2) = 2c\)

\(cx\)

\(c(4-x)\)

Common Mistakes to Avoid

✕ Treating \(f(x)\) as probability
\(f(x)\) is a density, not a probability. It can exceed 1. Only the integral over an interval gives probability.
✕ Wrong limits of integration
Only integrate where \(f(x) \neq 0\). If \(f(x) = 0\) outside \([0, 4]\), then \(\displaystyle\int_2^6 f(x)\,dx = \int_2^4 f(x)\,dx\).
✕ Forgetting to verify validity
After finding \(k\), check that \(f(x) \geq 0\) everywhere and the total integral is exactly 1.

Summary of Key Formulas

Quantity Formula
Normalisation \(\displaystyle\int_{-\infty}^{\infty} f(x)\,dx = 1\)
Probability \(\displaystyle P(a \leq X \leq b) = \int_a^b f(x)\,dx\)
Expected Value \(\displaystyle E(X) = \int x\,f(x)\,dx\)
Variance \(E(X^2) - [E(X)]^2\)
Median \(\displaystyle\int_{-\infty}^{m} f(x)\,dx = 0.5\)
Mode Value of \(x\) maximising \(f(x)\)

Question 1 of 5

A continuous random variable \(X\) has pdf \(f(x) = kx^2\) for \(0 \leq x \leq 3\) and \(f(x) = 0\) otherwise. What is the value of \(k\)?

Question 2 of 5

If \(\displaystyle f(x) = \frac{3}{8}x^2\) for \(0 \leq x \leq 2\), what is \(P(X \leq 1)\)?

Question 3 of 5

For a continuous random variable with pdf \(f(x)\), which statement is always true?

Question 4 of 5

Given \(\displaystyle f(x) = \frac{x}{8}\) for \(0 \leq x \leq 4\), what is \(E(X)\)?

Question 5 of 5

A pdf is given by \(\displaystyle f(x) = \frac{1}{2}\) for \(0 \leq x \leq 2\). What is \(\text{Var}(X)\)?