Course contentsShow
← Computer Science
Lesson 123 of 2,8723. Probability for Computer ScienceFree lesson

Cumulative Distribution Functions (CDF)

Introduce CDF as P(X ≤ x); relate CDF to PMF for discrete variables; understand monotonicity.

Cumulative Distribution Functions (CDF)

You'll learn how the CDF accumulates probabilities up to a given value, building directly on the PMF.

What Is a CDF?

While the PMF tells you the probability that a discrete random variable equals exactly one value, the Cumulative Distribution Function (CDF) tells you the probability that the variable is at most that value. Mathematically:

F(x) = P(X ≤ x)

Think of it like a running total: the CDF at any point x is the sum of all probabilities from the smallest possible value up to and including x.

From PMF to CDF

For a discrete random variable, the CDF is built by adding up PMF values:

F(x) = Σ p(k) for all k where k ≤ x

Example: Suppose you roll a fair die (X = outcome).

  • PMF: p(1) = p(2) = ... = p(6) = 1/6
  • CDF:
    • F(1) = P(X ≤ 1) = 1/6
    • F(2) = P(X ≤ 2) = 1/6 + 1/6 = 2/6
    • F(3) = P(X ≤ 3) = 3/6
    • F(6) = P(X ≤ 6) = 6/6 = 1

Monotonicity: Always Rising

The CDF has a crucial property: it never decreases. As x increases, F(x) either stays the same or goes up, because you're always adding more probability (or zero). It starts at 0 (impossible to be less than the minimum) and reaches 1 (certainty you're at most the maximum).

Why It Matters

CDFs answer "less than or equal to" questions directly—essential for understanding distributions, setting thresholds, and analyzing algorithms with probabilistic behavior.

Key Takeaway: The CDF F(x) = P(X ≤ x) accumulates PMF probabilities from left to right, creating a monotonically increasing function that rises from 0 to 1.