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
- Always non-decreasing: As x grows, accumulated probability never shrinks
- Ranges from 0 to 1: F(-∞) = 0 and F(∞) = 1
- 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.