Cumulative distribution function (CDF) explained using normal distribution, showing area under curve to the left of t and relation to PDF

What is a Cumulative Distribution Function (CDF)?

The CDF of a random variable $X$ is defined as the probability that $X$ is less than or equal to a certain value – say, $X \le t$. We write this probability as $F_X(t)$.


For a discrete random variable, we can find this by summing or “accumulating” the probabilities up to $t$. That is, we use the following formula:

$$F_X(t)= \mathbb{P}(X \le t) = \sum_{x \le t} \mathbb{P}(X=x)$$

Notice that the cdf $F_X(t)$ is defined for any value of $t$; not just those in the range of $X$. In general, it looks like a “step function” in the discrete case.


Now suppose that $X$ is continuous. Recall that the PDF of a continuous random variable can be used to find the probability that $X$ lies within an interval.

To do this, we just look at the area under the PDF within that interval.

So, since the CDF of $X$ is the probability it is less than or equal to some number $t$, it will be equal to the area under the PDF to the left of that value $t$.

As above, we write this as $F_X(t) $, defined for any real number $t$.

The CDF can be seen visually as the shaded area to the left of a $x=t$ on the PDF in the slide above.

Since we find areas by integrating, when $X$ is continuous with PDF $f_X(x)$, we can calculate the CDF with an integral:

$$F_X(t) = \int_{-\infty}^{t} f_X(x)dx$$

As with the sum above, notice that if we want to use $x$ as the argument of the PDF in the integral, we need a different letter such as $t$ for the argument of the CDF (and the limits of this integral). But sometimes we instead use $x$ as the argument of the CDF.

Since differentiation “undoes” integration, we also have:

$$ f_X(x) = \frac{dF_X(x)}{dx} $$


To reiterate; the CDF is defined in exactly the same way for any random variable, as $F_X(x) = \mathbb{P}(X \le x) $, but we calculate this probability in different ways in the discrete and continuous cases. Since it is a probability, we also have $ 0 \le F_X(t) \le 1 $ for all $t$.

Background: