Before the method: the idea behind it

When the outcomes cannot be listed

A die shows 1, 2, 3, 4, 5 or 6. But a person’s height could be 170 cm, or 170.3, or 170.28419, and between any two possible heights lie infinitely many more. You cannot list them, so you cannot give each one a probability. This lesson replaces the probability table with something that can handle a continuum, and the tool that makes it work is integration.

From bars to a curve

Start with real data: the heights of 2000 people, grouped into bars.

With wide bars the histogram is chunky and tells you little about the shape. Narrow the bars and the outline gets smoother and more detailed. Keep going, letting the bar width shrink towards zero, and the outline settles into a smooth curve.

Drag the slider to narrow the bars and watch it happen.

heights of 2000 people 150 175 200 cm
Number of bars: 8

Slide right to narrow the bars. The jagged outline becomes a smooth curve.

That limiting curve is a probability density function, written f(x). It is the continuous replacement for the probability table, and it does the same job in a different way.

Here is the part that catches everyone out: f(x) is not a probability. The height of the curve can exceed 1, which no probability ever could. What carries the probability is the area under the curve, exactly as the area of each histogram bar represented the proportion of people in that group.

Probability is area

To find the probability that X falls between two values, integrate the density function between them.

f(x) = x/8 on 0 ≤ x ≤ 4 0 4
Interval: 1.00 to 3.00
P(a < X < b) = shaded area: 0.500

Drag the two sliders. The shaded area is the probability, and it is always between 0 and 1.

Set the two sliders to the same value and the area collapses to zero. That is not a glitch: the probability that a continuous variable takes any single exact value is zero. Nobody is exactly 170.000000… cm tall. Only intervals have positive probability.

A useful consequence: with continuous variables it makes no difference whether an inequality is strict, so P(X < 2) and P(X ≤ 2) are the same number. That is emphatically not true for discrete variables, where P(X ≤ 2) includes P(X = 2).

Two conditions define a valid density function, and both are checked constantly in exam questions.

\[ f(x)\ge0 \text{ for all } x, \qquad \int_{-\infty}^{\infty}f(x)\,dx=1, \qquad P(a\le X\le b)=\int_a^b f(x)\,dx \]

The middle condition is the continuous version of “probabilities sum to 1”, with the sum replaced by an integral. When a question gives you a density function containing an unknown constant, this condition is almost always how you find it.

Centre and spread, with integrals

Every formula from the discrete lesson carries over, with sums becoming integrals.

For a discrete variable you multiplied each value by its probability and added. For a continuous one you multiply x by the density and integrate. The structure is identical; only the machinery changes.

QuantityDiscreteContinuous
Total probability\(\sum P(X=x)=1\)\(\int f(x)\,dx=1\)
Mean\(\sum xP(X=x)\)\(\int x\,f(x)\,dx\)
E(X²)\(\sum x^2P(X=x)\)\(\int x^2 f(x)\,dx\)
Variance\(E(X^2)-[E(X)]^2\)\(E(X^2)-[E(X)]^2\)

The variance formula is unchanged, because once you have E(X) and E(X²) the rest is the same arithmetic. The linear rules survive too: E(aX + b) = aE(X) + b and Var(aX + b) = a²Var(X), for exactly the same reasons as before.

The mean is still the balance point of the distribution, but now it balances a shape rather than a set of weights. For a density skewed to the right, the mean sits to the right of the peak, dragged that way by the long tail.

Where this shows up in real life

Waiting times and reliability

How long until the next bus, the next earthquake, or the next component failure are all continuous variables. Engineers integrate density functions to find the probability a part survives its warranty period, which sets both the warranty length and its price.

Everything measured rather than counted

Heights, weights, temperatures, reaction times, rainfall. Any quantity you measure rather than count is continuous, which is why this framework underlies most of applied statistics, including the normal distribution in the next lesson.

What to reach for

The question asks for…Use
an unknown constant in f(x)Set the total area to 1 and solve
a probabilityIntegrate f(x) between the two values
the mean∫ x f(x) dx over the whole domain
the variance or standard deviation∫ x² f(x) dx, then subtract the mean squared
the median or a percentileSet the accumulated area to 0.5 or the stated proportion, then solve
whether a function is a valid densityCheck it is never negative and its total area is 1

Next: the working method, twenty practice questions, ten harder ones, and the ClassPad guide.