S2.2 - Continuous random variables
- Syllabus
- 2019
- Topic
- S2.2
- Level
- A2
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 a, P(X=a)=0. Consequently, endpoint choices do not change a continuous probability:P(a<X<b)=P(a≤X<b)=P(a<X≤b)=P(a≤X≤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.
A probability density function f describes probability through area. It must satisfy f(x)≥0 on its support and have total area 1. For a continuous random variable,P(a<X≤b)=∫abf(x)dx.The height f(x) is not itself the probability P(X=x), which is zero.
F(x0)=P(X≤x0)=∫−∞x0f(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 F is known, interval probabilities are differences:P(a<X≤b)=F(b)−F(a),P(X>b)=1−F(b).
For a simple piecewise polynomial densityf(x)=⎩⎨⎧x,2−x,0,0≤x≤1,1<x≤2,otherwise,both pieces are non-negative and their two triangular areas total 1. Accumulating area from the left givesF(x)=⎩⎨⎧0,x2/2,2x−x2/2−1,1,x<0,0≤x≤1,1<x≤2,x>2.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.
Where the cumulative distribution function is differentiable, its rate of increase is the density:f(x)=dxdF(x).In the other direction, integrating the density from the lower end of the support reconstructs F.
SupposeF(x)=⎩⎨⎧0,x2/4,1,x<0,0≤x<2,x≥2.Differentiating each interval givesf(x)={x/2,0,0<x<2,otherwise.Its integral over 0<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.
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)]2
If f(x)=x/2 for 0<x<2 and is zero otherwise, thenE(X)=∫022x2dx=34,E(X2)=∫022x3dx=2,soVar(X)=2−(34)2=92.The variance is non-negative and has squared units.
For constants a and b, use linear-transformation rules rather than reintegrating:E(aX+b)=aE(X)+b,Var(aX+b)=a2Var(X).A shift changes the mean but not the variance.
Do not calculate variance as ∫(x−E(X))f(x)dx; that integral is zero. Use either ∫(x−E(X))2f(x)dx or the stated E(X2)−[E(X)]2 identity, and distinguish variance from standard deviation.
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) is greatest; compare stationary points and support endpoints |
| lower quartile Q1 | F(Q1)=0.25 |
| median m | F(m)=0.50 |
| upper quartile Q3 | F(Q3)=0.75 |
| interquartile range | Q3−Q1 |
For f(x)=x/2 on 0<x<2, F(x)=x2/4. HenceQ1=1,m=2,Q3=3,and the interquartile range is 3−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.