PMF vs. CDF for discrete random variables
A discrete random variable takes values in a countable set (often integers such as 0, 1, 2, …).
Two core ways to describe its behavior are the probability mass function (PMF) and the
cumulative distribution function (CDF).
The PMF is
\[
p(x)=P(X=x),
\]
which tells you the probability assigned to each individual outcome.
The CDF is
\[
F(x)=P(X\le x),
\]
which accumulates probability up to a threshold. In discrete settings, that accumulation is a sum:
\[
F(x)=\sum_{t\le x} p(t).
\]
Why the CDF looks like “steps”
In a discrete distribution, probability is concentrated at specific points, not spread continuously.
That is why the CDF stays flat between outcomes and then jumps at each value that can occur.
If the possible outcomes are \(x_1<x_2<\cdots\), then the CDF values at those points are
\[
F(x_i)=p(x_1)+p(x_2)+\cdots+p(x_i).
\]
Each bar in the PMF contributes a jump of exactly that bar’s height in the CDF.
Interpreting a CDF is often convenient for probability questions like “What is the chance \(X\) is at most 3?”:
you simply read off \(F(3)\).
Standard discrete distributions
Many applications reuse a few standard models. In a binomial distribution,
\(X\sim\mathrm{Bin}(n,p)\) counts successes in \(n\) independent trials, and
\[
P(X=k)=\binom{n}{k}p^k(1-p)^{n-k}.
\]
In a Poisson distribution, \(X\sim\mathrm{Pois}(\lambda)\) counts events in an interval with average rate \(\lambda\),
and
\[
P(X=k)=e^{-\lambda}\frac{\lambda^k}{k!}.
\]
The geometric distribution models waiting time until the first success, with
\(P(X=k)=(1-p)^{k-1}p\) for \(k\ge 1\) in the common “trial number” definition.
Infinite support and truncation
Some distributions (Poisson and geometric) have infinitely many possible outcomes. Any plot must choose a finite range,
so the tool plots up to a user-selected maximum \(k\). The probability that lies beyond that maximum is called the
tail mass. If the maximum is large enough, the tail mass is tiny and the plotted CDF is close to 1.
If not, the tool reports how much probability is not shown so you can increase the range if needed.
How to use this plotter
You can either (1) choose a standard distribution and set its parameters or (2) enter a custom PMF as pairs \((x,p(x))\).
The calculator sorts outcomes, builds the CDF by cumulative summation, and then plots PMF bars and CDF steps together.
Use hover to read exact values, scroll to zoom, and drag to pan when outcomes get crowded.
Press Play to reveal points in order and visually connect “adding bars” to “stepping up” in the CDF.
As a university extension, the same idea underlies an empirical CDF, which is built from sample data by counting
the fraction of observations at or below each threshold.