From PMF to CDF
The probability mass function (PMF) tells you how much probability sits at each value of a discrete random variable. The cumulative distribution function (CDF) tells you, for each $x$, the total probability of being $\leq x$. They carry the same information; the CDF is just the running sum of the PMF.
Below, you can build your own PMF by editing the $(x, p)$ table. The slider sweeps a “current $x$” across the axis: PMF lollipops at $x \leq$ current $x$ turn blue, and their masses sum exactly to the height of the CDF curve at that $x$.
Interactive
| $x$ | $p$ |
|---|
What it shows
The CDF is a step function: flat between the PMF’s mass points, jumping straight up by $p_i$ at each $x = x_i$ where the PMF carries mass. Slide the current $x$ across some $x_i$ and the CDF jumps while one more PMF lollipop turns blue — the same probability mass, viewed two ways.
Convention: this CDF is right-continuous. At each $x = x_i$, $F(x_i) = P(X \leq x_i)$ already includes the jump.
The next demo will replace the discrete spikes with a smooth density (PDF). The construction is the same idea, but the running sum becomes a running integral, and the CDF turns from a staircase into a continuous curve.
