Skip to content

ProbabilityLesson 3 of 6

The running total, and its slope

CDFs, derivatives, and integrals

A distribution tells you where probability is located. Its cumulative distribution function, or CDF, tells you how much has accumulated up to a chosen value.

FX(x)=Pr(Xx).F_X(x)=\Pr(X\le x).

The capital X is the random variable. The lowercase x is the threshold you choose. For example, FX(2)F_X(2) asks for the chance that X is at most 2.

As you move the threshold to the right, you include more outcomes. So the CDF cannot decrease. Far enough to the left its limit is 0; far enough to the right its limit is 1. For unbounded distributions these are limits, not values reached at a finite endpoint.

For the number of heads in three independent fair coin tosses:

xprobability at xprobability up to x
01/81/8
13/84/8
23/87/8
31/81

Between these values the CDF is flat. At each value it jumps by the probability sitting there. At the jump itself, use the upper value because “at most” includes the endpoint.

For a uniform draw on [−1,1], the CDF is a ramp between the endpoints, with flat sections outside:

FX(x)={0,x<1,(x+1)/2,1x1,1,x>1.F_X(x)=\begin{cases} 0,&x<-1,\\ (x+1)/2,&-1\le x\le1,\\ 1,&x>1. \end{cases}

Inside the interval, x+1 is the length collected so far; divide by the total length 2. At x=0, the CDF is 1/2.

For any distribution,

Pr(a<Xb)=FX(b)FX(a).\Pr(a<X\le b)=F_X(b)-F_X(a).

Subtracting FX(a)F_X(a) removes everything at or below a, including any probability exactly at a.

For the coin count, the chance of one or two heads is FX(2)FX(0)=7/81/8=3/4F_X(2)-F_X(0)=7/8-1/8=3/4. Subtracting FX(1)F_X(1) instead would remove the one-head outcomes too.

For a variable with a density, single points have probability zero, so including or excluding an endpoint does not change the answer. For the uniform draw, Pr(0X1/2)=3/41/2=1/4\Pr(0\le X\le1/2)=3/4-1/2=1/4.

Move from x to x+Δxx+\Delta x, with Δx>0\Delta x>0. The increase in the CDF is the probability collected in that short interval. Divide the increase by its width:

FX(x+Δx)FX(x)Δx.\frac{F_X(x+\Delta x)-F_X(x)}{\Delta x}.

This measures probability per unit of x. Where the CDF is differentiable, the limit as the width approaches zero is its derivative. For the smooth densities used here:

fX(x)=FX(x)=dFXdx.f_X(x)=F_X'(x)=\frac{dF_X}{dx}.

The lowercase f is density; the uppercase F is accumulated probability. A tall density means the total is increasing rapidly. The calculus pages build derivatives and integrals from the beginning.

For our uniform ramp, F rises by 0.05 over a width of 0.1: the slope is 0.5. For a non-flat density, density times a small width is an approximation:

Pr(x<Xx+Δx)fX(x)Δx.\Pr(x<X\le x+\Delta x)\approx f_X(x)\Delta x.

A discrete CDF instead has derivative zero between its jumps and is not differentiable at the jumps. Its ordinary derivative cannot recover the probability mass; use the jump sizes.

Divide an interval into narrow strips. A strip near x has width Δx\Delta x and approximate probability fX(x)Δxf_X(x)\Delta x. Add the strips and take the limit as they become finer. That limiting sum is an integral:

Pr(aXb)=abfX(x)dx.\Pr(a\le X\le b)=\int_a^b f_X(x)\,dx.

The bounds a and b say where to start and stop; dx says that the slices run along the x direction. For a continuous density this area equals FX(b)FX(a)F_X(b)-F_X(a).

This is the useful connection between differentiation and integration: the density gives the rate of increase of the total; integrating the density accumulates the total.

Move the endpoints. The shaded probability appears as an area in the upper graph and an increase in the lower graph.

Compress a distribution into its mean and variance.

Definition

Read the full glossary entry →