Probability density and cumulative distribution functions

Probability density and cumulative distribution functions

Spec 2.1–2 · Edexcel A-Level Further Maths: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • A probability density function f(x)≥0\mathrm{f}(x)\geq0 has total area 11; probabilities are areas under it.
  • For a continuous variable P(X=a)=0\mathrm{P}(X=a)=0, so << and ≤\leq give the same answer.
  • The cumulative distribution function is F(x0)=P(X≤x0)=∫−∞x0f(x) dx\mathrm{F}(x_0)=\mathrm{P}(X\leq x_0)=\int_{-\infty}^{x_0}\mathrm{f}(x)\,\mathrm{d}x.
  • P(a<X≤b)=F(b)−F(a)\mathrm{P}(a<X\leq b)=\mathrm{F}(b)-\mathrm{F}(a) and P(X>a)=1−F(a)\mathrm{P}(X>a)=1-\mathrm{F}(a).
  • f(x)=dFdx\mathrm{f}(x)=\frac{\mathrm{d}\mathrm{F}}{\mathrm{d}x}; state each function on every part of its range.

Continuous variables and the pdf

A pdf is a non-negative function whose area between two values is a probability, with total area 11.

A continuous random variable can take any value in an interval. Its probabilities are areas under its probability density function (pdf) f(x)\mathrm{f}(x).

A pdf must satisfy f(x)≥0\mathrm{f}(x)\geq0 and ∫−∞∞f(x) dx=1\int_{-\infty}^{\infty}\mathrm{f}(x)\,\mathrm{d}x=1. It may be piecewise, with different expressions on different intervals.

A histogram with narrow class widths and frequency density on the vertical axis approaches the shape of the pdf.

f(x)\mathrm{f}(x) is a density, not a probability, and can exceed 1.

0.511.522.533.540.20.40.60.811.21.4xy(3, 1)f(x) = x²/9
The pdf f(x) = x²/9 on 0 ≤ x ≤ 3; the shaded area is 1.

Worked example

f(x)=kx2\mathrm{f}(x)=kx^2 on 0≤x≤30\leq x\leq3. Find kk.

f(x)=kx\mathrm{f}(x)=kx on 0≤x≤20\leq x\leq2. What is kk?

Probabilities from the pdf

Integrate the pdf between the two values, splitting at each boundary for a piecewise pdf.

P(a<X≤b)=∫abf(x) dx\mathrm{P}(a<X\leq b)=\int_a^b\mathrm{f}(x)\,\mathrm{d}x.

For a continuous variable P(X=a)=0\mathrm{P}(X=a)=0, so << and ≤\leq give the same answer.

For a piecewise pdf, split the integral at each boundary and use the correct expression in each part. Sketch the pdf first and mark where each piece starts and ends.

0.20.40.60.811.21.41.61.820.20.40.60.811.2xf(x)f(x) = x/2
Illustrative pdf f(x) = x/2 on [0, 2]: the shaded area is P(0.5 < X ≤ 1.5) = 0.5.
  • P(a<X≤b)\mathrm{P}(a<X\leq b)∫abf(x) dx\displaystyle\int_a^b\mathrm{f}(x)\,\mathrm{d}x

Worked example

f(x)=x6\mathrm{f}(x)=\frac x6 on 0≤x≤20\leq x\leq2 and 13\frac13 on 2<x≤42<x\leq4. Find P(1<X<3)\mathrm{P}(1<X<3).

For a continuous variable, what is P(X=2)\mathrm{P}(X=2)?

The cumulative distribution function

The cdf F(x)\mathrm{F}(x) is the probability that XX is at most xx, found by integrating the pdf.

The cumulative distribution function (cdf) is F(x0)=P(X≤x0)=∫−∞x0f(x) dx\mathrm{F}(x_0)=\mathrm{P}(X\leq x_0)=\int_{-\infty}^{x_0}\mathrm{f}(x)\,\mathrm{d}x.

Integrate the pdf from the lower end of the range up to xx, using a dummy variable tt inside the integral.

State F\mathrm{F} for every region: F(x)=0\mathrm{F}(x)=0 below the range and F(x)=1\mathrm{F}(x)=1 above it. Forgetting this loses marks.

For a piecewise pdf, the cdf in later pieces must include the accumulated probability from earlier pieces.

0.511.522.533.540.20.40.60.811.2xy(0, 0)(3, 1)F(x) = x³/27
F(x) = x³/27 rises from 0 at x = 0 to 1 at x = 3.
  • Cumulative distribution functionF(x0)=P(X≤x0)\mathrm{F}(x_0)=\mathrm{P}(X\leq x_0)

f(x)=x2\mathrm{f}(x)=\frac{x}{2} on 0≤x≤20\leq x\leq2. What is F(x)\mathrm{F}(x) on that interval?

Using the cdf

Subtract values of F\mathrm{F} for an interval, and solve F(q)=p\mathrm{F}(q)=p for a quantile.

Since F\mathrm{F} accumulates probability, P(a<X≤b)=F(b)−F(a)\mathrm{P}(a<X\leq b)=\mathrm{F}(b)-\mathrm{F}(a) and P(X>a)=1−F(a)\mathrm{P}(X>a)=1-\mathrm{F}(a).

A cdf is non-decreasing and runs from 0 to 1, and it is continuous for a continuous variable.

To solve P(X≤q)=p\mathrm{P}(X\leq q)=p, set F(q)=p\mathrm{F}(q)=p and solve for qq. Check that F\mathrm{F} equals 1 at the top of the range; if it does not, an integration error has occurred.

0.20.40.60.811.21.41.61.820.20.40.60.81xF(x)F(0.5) = 0.0625F(1.5) = 0.5625F(2) = 1F(x) = x²/4
The cdf F(x) = x²/4 on [0, 2] rises from 0 to 1: P(0.5 < X ≤ 1.5) = F(1.5) − F(0.5) = 0.5.
  • P(a<X≤b)\mathrm{P}(a<X\leq b)F(b)−F(a)\mathrm{F}(b)-\mathrm{F}(a)
  • P(X>a)\mathrm{P}(X>a)1−F(a)1-\mathrm{F}(a)
  • P(X≤q)=p\mathrm{P}(X\leq q)=psolve F(q)=p\mathrm{F}(q)=p

Worked example

F(x)=x−12\mathrm{F}(x)=\frac{\sqrt x-1}{2} on 1≤x≤91\leq x\leq9. Find P(X>4)\mathrm{P}(X>4) and the value qq with F(q)=0.75\mathrm{F}(q)=0.75.

F(2)=0.3\mathrm{F}(2)=0.3 and F(5)=0.8\mathrm{F}(5)=0.8. What is P(2<X≤5)\mathrm{P}(2<X\leq5)?

Linking f and F

Integrating f\mathrm{f} gives F\mathrm{F}, and differentiating F\mathrm{F} gives f\mathrm{f}.

The pdf and cdf are linked by calculus: f(x)=dF(x)dx\mathrm{f}(x)=\frac{\mathrm{d}\mathrm{F}(x)}{\mathrm{d}x}.

Use this when a question gives F\mathrm{F} and asks for f\mathrm{f}, remembering to state the range of xx for which each expression holds.

Differentiating across a boundary is a common error: state f\mathrm{f} separately on each piece, and f=0\mathrm{f}=0 outside the range.

0.20.40.60.811.21.41.61.820.20.40.60.81xf, FF(1) = 0.25f(1) = 0.5F(x) = x²/4f(x) = x/2
f is the gradient of F: at x = 1, F has gradient 0.5 = f(1).
  • f(x)\mathrm{f}(x)dF(x)dx\dfrac{\mathrm{d}\mathrm{F}(x)}{\mathrm{d}x}
  • F(x)\mathrm{F}(x)∫−∞xf(t) dt\displaystyle\int_{-\infty}^{x}\mathrm{f}(t)\,\mathrm{d}t

Worked example

F(x)=x2−18\mathrm{F}(x)=\frac{x^2-1}{8} on 1≤x≤31\leq x\leq3. Find f(x)\mathrm{f}(x).

F(x)=x327\mathrm{F}(x)=\frac{x^3}{27} on 0≤x≤30\leq x\leq3. What is f(x)\mathrm{f}(x)?

Try an exam question

The continuous random variable XX has probability density function f(x)=kx\mathrm{f}(x)=kx for 0≤x≤40\leq x\leq4, and 00 otherwise. Find kk, the cumulative distribution function F(x)\mathrm{F}(x), and P(1<X<3)\mathrm{P}(1<X<3).

[5 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find the value of kk.

1 mark, marked against the mark scheme

Revision notes