Discrete convolution for sums of random variables
In discrete probability, it is common to build a new random variable from old ones.
One of the most important constructions is a sum: \(Z=X+Y\).
If \(X\) and \(Y\) are independent discrete random variables with probability mass functions (PMFs)
\(P(X=x)\) and \(P(Y=y)\), then the PMF of \(Z\) is found by a rule called convolution.
Convolution answers the question: “What is the probability that the sum equals a particular value \(z\)?”
The convolution formula
The event \(\{Z=z\}\) means \(\{X+Y=z\}\).
This happens whenever \(X=x\) and \(Y=z-x\) for some integer \(x\).
Because the pairs \((x, z-x)\) represent disjoint ways to obtain the same sum, you add their probabilities:
\[
P(Z=z) = \sum_x P(X=x,\;Y=z-x).
\]
Independence is the key simplifying assumption. If \(X\) and \(Y\) are independent, then
\(P(X=x,\;Y=z-x)=P(X=x)\,P(Y=z-x)\), so the formula becomes
\[
P(Z=z) = \sum_x P(X=x)\,P(Y=z-x).
\]
In words: to get the probability for a given sum \(z\), multiply matching probabilities and add them up.
Example: sum of two dice
If \(X\) and \(Y\) are the outcomes of two fair dice, each takes values \(1\) through \(6\) with probability \(1/6\).
For \(z=7\), there are six matching pairs: \((1,6),(2,5),\dots,(6,1)\).
Each pair has probability \((1/6)(1/6)=1/36\), so
\(P(Z=7)=6\cdot(1/36)=1/6\).
Convolution naturally explains why middle sums are more likely than extreme sums (like \(2\) or \(12\)).
Validity checks and normalization
A valid PMF must have non-negative probabilities and must sum to \(1\).
Real data or truncated distributions (for example, a Poisson distribution cut off at some maximum value)
may not sum exactly to \(1\). In that situation, normalization rescales all probabilities by dividing by the current total,
producing a PMF that sums to \(1\). This is convenient, but it also changes the model slightly—so it should be used knowingly.
How to use this tool
Enter the PMF of \(X\) and \(Y\) as value–probability pairs, one per line (for example, 0, 0.5).
Click Calculate to validate the inputs, optionally normalize them, and compute the resulting PMF of \(Z=X+Y\).
The results include a clear step-by-step explanation of the convolution idea and a table for each PMF.
The interactive graphic shows the PMFs of \(X\), \(Y\), and \(Z\) as bar charts.
Press Play to scan across \(z\) values and highlight which \(x\) and \(y\) pairs contribute to each bar.
At a university level, convolution connects to generating functions:
multiplying generating functions corresponds to convolving coefficient sequences, which is why these ideas appear in counting and distribution theory.