Course contentsShow
← Machine Learning and Deep Learning
Lesson 61 of 3,5381. Mathematical Foundations for Machine LearningFree lesson

Cumulative Distribution Functions

Define CDFs and use them to compute probabilities for any random variable type.

Cumulative Distribution Functions

What you'll learn: How to measure the probability that a random variable falls at or below a specific value using CDFs.

What Is a CDF?

A Cumulative Distribution Function (CDF) tells you the probability that a random variable X takes on a value less than or equal to some number x. In mathematical notation:

F(x) = P(X ≤ x)

Think of it like filling a bucket: as x increases, you're accumulating more and more probability until you reach 1.0 (certainty) when all possible outcomes are included.

Why CDFs Matter

Unlike PMFs (discrete only) or PDFs (continuous only), CDFs work for any type of random variable—discrete, continuous, or mixed. This universality makes them incredibly useful in machine learning for:

  • Computing probabilities over intervals: P(a < X ≤ b) = F(b) - F(a)
  • Comparing distributions visually
  • Generating random samples (inverse transform sampling)

Key Properties

  1. Always non-decreasing: As x grows, accumulated probability never shrinks
  2. Ranges from 0 to 1: F(-∞) = 0 and F(∞) = 1
  3. Right-continuous: No sudden jumps upward at any point

Intuitive Example

Imagine measuring heights of students. The CDF at 170 cm answers: "What fraction of students are 170 cm tall or shorter?" If F(170) = 0.6, then 60% of students fall at or below that height.

For a coin flip (discrete): F(0 heads) = 0.5, F(1 head) = 1.0—you accumulate probabilities as you move through possible values.

Key Takeaway: The CDF F(x) = P(X ≤ x) accumulates probability from left to right and works universally for computing probabilities across all random variable types.