Home / AS & A Level Mathematics 9709 / Continuous random variables
Cambridge International AS & A Level Mathematics 9709 · Probability & Statistics 2

Continuous random variables

Probability density functions: their properties, finding unknown constants, probabilities as areas, the mean and variance by integration, and the median and other percentiles found directly from an area, including densities on an infinite domain.

6.3Paper 6: Probability & Statistics 2Free lesson
What the syllabus says

6.3 (Paper 6)

  • understand the concept of a continuous random variable, and recall and use properties of a probability density function
  • use a probability density function to solve problems involving probabilities, and to calculate the mean and variance of a distribution.

Notes and examples

  • For density functions defined over a single interval only; the domain may be infinite, e.g. 3x4 for x⩾1.
  • Including location of the median or other percentiles of a distribution by direct consideration of an area using the density function.
  • Explicit knowledge of the cumulative distribution function is not included.

Quoted from the Cambridge International AS and A Level Mathematics 9709 syllabus (2026-2027 and 2028-2030 editions, which share this content).

Continuous random variables and density functions Paper 6

A continuous random variable can take any value in an interval: a waiting time, a length, a mass. There are infinitely many possible values, so we cannot list probabilities for each one as we do for a discrete variable. Instead the distribution is described by a probability density function (pdf) f(x), and
P(a<X<b)=∫abf(x)dx,
the area under the graph of f between a and b.

A function can be a pdf only if

  • f(x)⩾0 for every x, because an area representing a probability cannot be negative;
  • the total area under the graph is 1: ∫f(x)dx=1 over the whole interval where f is defined.

Outside its stated interval, f(x)=0. Two consequences surprise students. First, P(X=a)=0 for any single value a, because a single value has no width and so no area. So P(X<2) and P(X⩽2) are the same. Second, f(x) itself is not a probability: it is a density, probability per unit of x, and it may be greater than 1 when the interval is short.

In this syllabus a density is defined by one formula over a single interval. The cumulative distribution function is not required: every probability, median and percentile is found directly from an area.

xf(x)0.511.522.530.10.20.30.40.50.60

The density in Worked examples 1 and 2. The shaded area is P(X<1). The curve is symmetrical about x=1.5, which is therefore the mean.

Finding an unknown constant Paper 6

A pdf is often given with an unknown constant, such as f(x)=kx(3−x) for 0⩽x⩽3. Use the total area: set the integral over the whole interval equal to 1 and solve for k. Then check that f(x)⩾0 on the interval, which is why a question may restrict k to be positive.

Papers 1 and 3 techniques apply: expand brackets before integrating, write 1x3 as x−3, and show the limits being substituted. Most pdf questions can be done exactly, with fractions; keep them exact until the final answer.

Worked example 1 Paper 6

The random variable X has pdf f(x)=kx(3−x) for 0⩽x⩽3, and f(x)=0 otherwise. Find (a) the value of k, (b) P(X<1).

  1. (a) ∫03k(3x−x2)dx=k[3x22−x33]03=k(272−9)=9k2.

  2. 9k2=1, so k=29.

  3. (b) P(X<1)=29[3x22−x33]01=29(32−13)=29×76=727.

Answer: (a) k=29 (b) 727

Check yourself Paper 6

The random variable X has pdf f(x)=kx3 for 0⩽x⩽2, and 0 otherwise. Find the value of k.

Answer it in the portal, where your answer is checked as you type →

Densities on an infinite domain Paper 6

The interval may have no upper end. The syllabus example is f(x)=3x4 for x⩾1. The area is an improper integral, found by letting the upper limit tend to infinity:
∫1∞3x−4dx=[−x−3]1∞=0−(−1)=1,
because x−3→0 as x→∞. So it is a valid pdf, and, for example, P(X>2)=[−x−3]2∞=18.

For a mean or variance on an infinite domain the integral must also have a finite value. With f(x)=3x4, ∫1∞x·3x−4dx=32 is finite. A density that falls away too slowly, such as 1x2 for x⩾1, has no finite mean, because ∫1∞1xdx grows without limit.

The mean and variance Paper 6

For a discrete variable, E(X)=∑xp. For a continuous variable, the sum becomes an integral and the probability p becomes f(x)dx:
E(X)=∫xf(x)dx,Var(X)=∫x2f(x)dx−{E(X)}2,
each integral taken over the interval where f is defined. Both formulae are in MF19.

Two checks catch most slips. The mean must lie inside the interval, and a variance must be positive. If the graph of f is symmetrical about x=c, then E(X)=c with no integration needed; a question may say "write down" the mean in such a case. Do not forget to subtract {E(X)}2: ∫x2f(x)dx alone is E(X2), not the variance.

Worked example 2 Paper 6

For the random variable X of Worked example 1, with f(x)=29x(3−x) for 0⩽x⩽3, find E(X) and Var(X).

  1. E(X)=29∫03(3x2−x3)dx=29[x3−x44]03=29(27−814)=29×274=32, as the symmetry predicts.

  2. E(X2)=29∫03(3x3−x4)dx=29[3x44−x55]03=29(2434−2435)=2710.

  3. Var(X)=2710−(32)2=2710−94=920.

Answer: E(X)=32, Var(X)=920

Check yourself Paper 6

The random variable X has pdf f(x)=3x2 for 0⩽x⩽1, and 0 otherwise. Find E(X).

Answer it in the portal, where your answer is checked as you type →

The median and other percentiles Paper 6

The median m splits the area in half: it is the value with
∫amf(x)dx=12,
where a is the lower end of the interval. In the same way, the lower quartile has area 14 to its left, the upper quartile 34, and the 90th percentile 0.9. Integrate from the lower end to the unknown value, set the result equal to the area you want, and solve.

The equation is often a quadratic or a cubic. It usually has more than one solution, and only one lies inside the interval: give that one, and say why the others are rejected. For a symmetrical density the median equals the mean. When the median is greater than the mean, the distribution has a longer tail to the left (negative skew); when it is less, the tail is to the right.

Worked example 3 (exam style) Paper 6

The time, T hours, that a machine runs before it needs adjusting has pdf f(t)=kt for 0⩽t⩽6, and f(t)=0 otherwise. (a) Show that k=118. (b) Find P(T>4). (c) Find E(T). (d) Find the median of T, and comment on its position compared with the mean.

  1. (a) ∫06ktdt=k[t22]06=18k=1, so k=118.

  2. (b) P(T>4)=∫46t18dt=[t236]46=1−1636=59.

  3. (c) E(T)=∫06t218dt=[t354]06=4.

  4. (d) ∫0mt18dt=m236=12, so m2=18 and m=18=4.24 (3 s.f.). The negative root is outside the interval.

  5. The median 4.24 is greater than the mean 4: the density rises to the right, so there is a long tail of small values (negative skew).

Answer: (b) 59 (c) 4 (d) 4.24

Check yourself Paper 6

The random variable X has pdf f(x)=2x for 0⩽x⩽1, and 0 otherwise. Find the median of X.

Answer it in the portal, where your answer is checked as you type →

Check yourself Paper 6

Which of these functions is a valid probability density function on 0⩽x⩽2 (and 0 elsewhere)?

Answer it in the portal, where your answer is checked as you type →

Key points

  • A pdf satisfies f(x)⩾0 and has total area 1; use the total area to find an unknown constant.

  • P(a<X<b)=∫abf(x)dx, and P(X=a)=0, so < and ⩽ give the same probability.

  • E(X)=∫xf(x)dx and Var(X)=∫x2f(x)dx−{E(X)}2.

  • A symmetrical density has its mean (and median) at the line of symmetry.

  • Median: solve ∫amf(x)dx=12 and keep the root inside the interval. Other percentiles use other areas.

  • On an infinite domain, an integral to ∞ uses the limit of x−n as x→∞, which is 0 for n>0.

Where marks are lost Paper 6

  • Forgetting to subtract {E(X)}2, so giving E(X2) as the variance.

  • Integrating over the wrong limits, or using the whole interval when only part is wanted.

  • Treating f(a) as the probability P(X=a).

  • Keeping a root of the median equation that lies outside the interval, or not saying why it is rejected.

  • Slips with negative powers on an infinite domain: ∫x−3dx=−12x−2.

  • Rounding fractions early instead of keeping exact values until the end.

Related AS & A Level Mathematics 9709 lessons

All AS & A Level Mathematics 9709 lessons →

An original lesson written to the Cambridge International AS & A Level Mathematics 9709 syllabus (2026 to 2027 and 2028 to 2030). The worked examples and questions are our own, not Cambridge questions. Back to every AS & A Level Mathematics 9709 lesson.