S2.2 - Continuous random variables

Syllabus
2019
Topic
S2.2
Level
A2

Learning objectives

Understand a continuous random variable

A continuous random variable can take any real value in an interval, so it models a measurement rather than a count. Waiting time, mass and length are typical examples; the number of calls is discrete even when calls arrive through time.

Probability is assigned to intervals, not isolated values. For every particular number aa, P(X=a)=0P(X=a)=0. Consequently, endpoint choices do not change a continuous probability:P(a<X<b)=P(aX<b)=P(a<Xb)=P(aXb).P(a<X<b)=P(a\le X<b)=P(a<X\le b)=P(a\le X\le b).

This does not say that observing a particular rounded value is impossible. A recorded value such as 2.3 seconds represents a measurement interval determined by the instrument's precision; the exact mathematical point still has probability zero.

Do not list a probability for each possible value as for a discrete distribution, and do not infer that every variable written with decimals is continuous. The random mechanism—measurement across a continuum versus counting separate outcomes—decides the model.

Use density and cumulative distribution functions

A probability density function ff describes probability through area. It must satisfy f(x)0f(x)\ge0 on its support and have total area 1. For a continuous random variable,P(a<Xb)=abf(x)dx.P(a<X\le b)=\int_a^b f(x)\,dx.The height f(x)f(x) is not itself the probability P(X=x)P(X=x), which is zero.

F(x0)=P(Xx0)=x0f(t)dtF(x_0)=P(X\le x_0)=\int_{-\infty}^{x_0} f(t)\,dt

A cumulative distribution function is non-decreasing, remains between 0 and 1, and runs from 0 below the support to 1 above it. Once FF is known, interval probabilities are differences:P(a<Xb)=F(b)F(a),P(X>b)=1F(b).P(a<X\le b)=F(b)-F(a),\qquad P(X>b)=1-F(b).

For a simple piecewise polynomial densityf(x)={x,0x1,2x,1<x2,0,otherwise,f(x)=\begin{cases}x,&0\le x\le1,\\2-x,&1<x\le2,\\0,&\text{otherwise},\end{cases}both pieces are non-negative and their two triangular areas total 1. Accumulating area from the left givesF(x)={0,x<0,x2/2,0x1,2xx2/21,1<x2,1,x>2.F(x)=\begin{cases}0,&x<0,\\x^2/2,&0\le x\le1,\\2x-x^2/2-1,&1<x\le2,\\1,&x>2.\end{cases}The second middle expression starts with the area already accumulated up to 1; integrating that piece as though the accumulation restarted at zero would make the CDF jump or finish at the wrong value.

For every piecewise model, check non-negativity, total area 1, matching CDF values at internal boundaries, and final value 1. Conditional probabilities still use the ordinary ratio of events, with each probability found from density areas or CDF differences.

Move between a CDF and a density

Where the cumulative distribution function is differentiable, its rate of increase is the density:f(x)=dF(x)dx.f(x)=\frac{dF(x)}{dx}.In the other direction, integrating the density from the lower end of the support reconstructs FF.

SupposeF(x)={0,x<0,x2/4,0x<2,1,x2.F(x)=\begin{cases}0,&x<0,\\x^2/4,&0\le x<2,\\1,&x\ge2.\end{cases}Differentiating each interval givesf(x)={x/2,0<x<2,0,otherwise.f(x)=\begin{cases}x/2,&0<x<2,\\0,&\text{otherwise}.\end{cases}Its integral over 0<x<20<x<2 is 1, so the result is a valid density.

Because a CDF cannot decrease, a candidate derivative must not be negative. Corners at piece boundaries may make the derivative undefined at isolated points, but changing a density at finitely many individual points changes no continuous probability.

Differentiate the CDF piece by piece and include zero outside the support. Do not differentiate the constants 0 and 1 into extra support, and do not treat a jump as acceptable here: a continuous random variable has a continuous CDF.

Calculate continuous means and variances

For a continuous random variable, moments are density-weighted integrals across the whole support. Split the integral wherever the density formula changes.

E(X)=xf(x)dx,E(X2)=x2f(x)dx,Var(X)=E(X2)[E(X)]2E(X)=\int_{-\infty}^{\infty}x f(x)\,dx,\qquad E(X^2)=\int_{-\infty}^{\infty}x^2 f(x)\,dx,\qquad \operatorname{Var}(X)=E(X^2)-[E(X)]^2

If f(x)=x/2f(x)=x/2 for 0<x<20<x<2 and is zero otherwise, thenE(X)=02x22dx=43,E(X)=\int_0^2\frac{x^2}{2}\,dx=\frac43,E(X2)=02x32dx=2,E(X^2)=\int_0^2\frac{x^3}{2}\,dx=2,soVar(X)=2(43)2=29.\operatorname{Var}(X)=2-\left(\frac43\right)^2=\frac29.The variance is non-negative and has squared units.

For constants aa and bb, use linear-transformation rules rather than reintegrating:E(aX+b)=aE(X)+b,Var(aX+b)=a2Var(X).E(aX+b)=aE(X)+b,\qquad \operatorname{Var}(aX+b)=a^2\operatorname{Var}(X).A shift changes the mean but not the variance.

Do not calculate variance as (xE(X))f(x)dx\int(x-E(X))f(x)\,dx; that integral is zero. Use either (xE(X))2f(x)dx\int(x-E(X))^2f(x)\,dx or the stated E(X2)[E(X)]2E(X^2)-[E(X)]^2 identity, and distinguish variance from standard deviation.

Find mode, median and quartiles

Mode, median and quartiles describe different features of a continuous distribution. The mode is located from density height; the median and quartiles are located from cumulative probability.

Measure Continuous-distribution condition
mode value where f(x)f(x) is greatest; compare stationary points and support endpoints
lower quartile Q1Q_1 F(Q1)=0.25F(Q_1)=0.25
median mm F(m)=0.50F(m)=0.50
upper quartile Q3Q_3 F(Q3)=0.75F(Q_3)=0.75
interquartile range Q3Q1Q_3-Q_1

For f(x)=x/2f(x)=x/2 on 0<x<20<x<2, F(x)=x2/4F(x)=x^2/4. HenceQ1=1,m=2,Q3=3,Q_1=1,\qquad m=\sqrt2,\qquad Q_3=\sqrt3,and the interquartile range is 31\sqrt3-1. Since the density increases throughout its support, its greatest height is at the upper endpoint, so the modal location is 2.

First decide which piece of a piecewise CDF contains 0.25, 0.5 or 0.75, then solve only within that piece and check the answer lies in its interval. For a mode, differentiating the density can locate interior candidates, but endpoints and any corners must also be compared.

Do not set the density equal to 0.5 to find the median, and do not assume the mean, median and mode coincide. That only happens for particular distribution shapes.