MathsFurther Statistics 2 › Continuous random variables: density and distribution functions

Continuous random variables: density and distribution functions

When a variable can take any value in a range, no single value has a probability. Areas do instead, and the function whose areas they are is the density.

Builds on The normal distribution and Definite integrals and areas.

IN THIS TOPIC

  • Check that a proposed density is valid and use it to find probabilities.
  • Move between the density and the cumulative distribution function in both directions.
  • Use the distribution function to find the median and other percentiles.

COMMON MISCONCEPTION

For a continuous random variable, P(X = 1.5) is the height of the density at 1.5.

Areas, not heights

A probability density function f(x) is never a probability. It is non-negative, its total area is 1, and probabilities are the areas beneath it:

P(a<Xb)=abf(x)dx\text{P}(a < X \le b) = \text{∫}_{a}^{b} \text{f}(x) \, dxNOT IN THE BOOKLET — LEARN IT

What the booklet prints is the cumulative version, F(x₀) = P(X ≤ x₀) as the integral of f from the bottom of the range up to x₀. This two-limit form is not on the page, so hold on to the idea that probability is area. The area over a single point is zero, so P(X = c) = 0 for every c: the height f(c) is not a probability. A density may even exceed 1, as it does on a short interval, and nothing is wrong when it does. One useful consequence: the inequality signs stop mattering for a continuous variable, which is a genuine simplification after all the care discrete distributions demand.

The density f(x) = 3x²/8 on 0 to 2: probability is the area under it, and the shaded strip is P(1 < X ≤ 1.5)areaf(x) = 3x²/820P(1 < X ≤ 1.5) = 0.297
FIG. 1A density curve with the strip beneath it shaded: the area of the strip is the probability, and the whole area is 1.

WORKED EXAMPLE

Checking a density and using it

f(x) = 3x²/8 for 0 ≤ x ≤ 2 and zero elsewhere. Verify it is a density and find P(1 < X ≤ 1.5).

It is non-negative on the interval. Its integral is [x³/8] from 0 to 2 = 8/8 = 1, so it is valid.

P(1 < X ≤ 1.5) = [x³/8] from 1 to 1.5 = 3.375/8 − 1/8 = 0.297 to three decimal places.

The distribution function

The cumulative distribution function collects everything to the left, so F(x0) = P(X ≤ x0), the integral of f from the lower end up to x0. It climbs from 0 to 1 and never falls. Differentiating undoes the integration:

f(x)=dF(x)dx\text{f}(x) = \frac{d\text{F}(x)}{dx}NOT IN THE BOOKLET — LEARN IT

The booklet defines F as an integral of f but never states the reverse, so learn that differentiating the distribution function returns the density. F is the better tool for reading probabilities off, since P(a < X ≤ b) is just F(b) − F(a). f is the better tool for describing shape. Percentiles come from F, with the median m solving F(m) = 0.5 and the lower quartile solving F(q) = 0.25. Piecewise definitions need every branch stated, including the 0 below the range and the 1 above it.

The distribution function F(x) = x³/8 climbing from 0 to 1, with its gradient at each point equal to the density1median 1.5870.5F(x) = x³/8the gradient of F is the density f
FIG. 2The distribution function climbing from 0 to 1, with the median read off at height 0.5 and the density appearing as its gradient.

GUIDED PRACTICE

From density to median

For f(x) = 3x²/8 on 0 ≤ x ≤ 2, write down F(x) in full and find the median.

Show the working

Integrating from 0: F(x) = x³/8 on the interval. In full, F(x) = 0 for x < 0, x³/8 for 0 ≤ x ≤ 2, and 1 for x > 2.

The median solves m³/8 = 0.5, so m³ = 4 and m = 1.587 to three decimal places.

Checking: F(1.587) = 3.998/8 ≈ 0.5, and the value sits inside the range as it must.

ASSESSMENT FOCUS

  • Verify a density by checking both conditions, non-negative and total area exactly 1.
  • Write a piecewise F(x) with every branch, including the flat 0 and the flat 1.
  • Read probabilities from F by subtraction. Going back to the integral wastes time you will want later.
  • For a percentile, set F equal to the proportion and solve, then check the root lies in range.
  • When f is defined in pieces, build F piece by piece and make the branches agree where they meet.

CHECK YOURSELF

f(x) = kx for 0 ≤ x ≤ 4 and zero elsewhere. Find k and F(x) on the interval.

Show a hint

Total area 1 fixes k, then integrate from the lower end.

Show the answer

The area is k[x²/2] from 0 to 4 = 8k, so k = 1/8. Then F(x) = x²/16 on 0 ≤ x ≤ 4, with F = 0 below and F = 1 above.

For a continuous variable, probability is area under the density: P(a < X ≤ b) is the integral of f from a to b, and P(X = c) = 0.

F is the integral of f from the lower end, climbing from 0 to 1; differentiating F gives f back, and F(m) = 0.5 gives the median.

WORKBOOK

Printable practice for this topic: original exam-style questions with room to work, and a fully worked answer book. Free to use; please do not redistribute or sell.

6 questions on this topicAnswer them one at a time and mark yourself against the worked answer.Practise this topic

Or read them with their worked answers on the continuous random variables: density and distribution functions questions page.

CHECK YOUR PROGRESS

Rate how confident you feel with each objective for this lesson. Ratings are saved in this browser, on this device, unless you sign in.

  • Check that a proposed density is valid and use it to find probabilities.
  • Move between the density and the cumulative distribution function in both directions.
  • Use the distribution function to find the median and other percentiles.

Open the full revision checklist to see every objective in the course in one place.