Tutorials › VEE Mathematical Statistics › Convolution Formula for Sums of Independent Variables

VEE Mathematical Statistics · Sums and Linear Combinations · Tutorial 327 of 880

Convolution Formula for Sums of Independent Variables

Use discrete and continuous convolution to find the distribution of a sum, and recognize the assumptions and common calculation traps.

Intermediate 10 min read

What You'll Learn

  • State the independence and support assumptions behind each convolution formula
  • Derive the mass function of a sum by adding probabilities over all decompositions
  • Derive the density of a sum by transforming the joint density and integrating
  • Compute discrete and continuous sum distributions from their component distributions
  • Check convolution results using support, total probability, and density integration

Why Sums Need a Distribution Calculation

Knowing the separate distributions of two random variables does not by itself specify the distribution of their sum unless we also know how the variables relate. When the variables are independent, the distribution of \(S=X+Y\) can be calculated by combining every possible way that \(X\) and \(Y\) can produce the same sum. This calculation is called convolution.

Convolution is useful whenever a total is built from independent components: for example, a total claim amount from two independent policies, or the total time spent on two independent tasks. The formula differs in appearance for discrete and continuous variables, but the underlying idea is the same: collect all component outcomes that add to the specified total.

Definition: Let \(X\) and \(Y\) be independent random variables and define \(S=X+Y\). If \(X\) and \(Y\) are discrete, write \(p_X(x)=P(X=x)\) and \(p_Y(y)=P(Y=y)\). Then $$ p_S(s)=P(S=s)=\sum_x p_X(x)p_Y(s-x), $$ where the sum includes all possible values of \(X\); terms with \(s-x\) outside the possible values of \(Y\) are zero. If \(X\) and \(Y\) are independent and have densities \(f_X\) and \(f_Y\), then \(S\) has density $$ f_S(s)=\int_{-\infty}^{\infty} f_X(x)f_Y(s-x)\,dx. $$ These formulas require independence. They apply respectively to discrete variables and to variables with densities; a variable that has both point masses and a continuous part needs separate treatment of those parts.

Why the Discrete Formula Works

For a fixed value \(s\), the event \(S=s\) can occur through any pair of values satisfying \(X+Y=s\). In particular, for each possible value \(x\) of \(X\), the only matching value of \(Y\) is \(s-x\). These possibilities for \(X\) are mutually exclusive, so their probabilities add. Independence gives the probability of each pair as the product of its marginal probabilities:

$$ \begin{aligned} P(S=s) &=\sum_x P(X=x,\ Y=s-x)\\ &=\sum_x P(X=x)P(Y=s-x)\\ &=\sum_x p_X(x)p_Y(s-x). \end{aligned} $$

The sum can have more than one nonzero term. A frequent error is to count only one pair that produces \(s\), or to multiply \(p_X(s)\) by \(p_Y(s)\). Neither operation accounts for all the ways the two values can add to \(s\).

Worked Example: Combining Two Discrete Components

A hypothetical insurer models two independent supplementary payments, \(X\) and \(Y\), in units of $100. Suppose \(X=0\) with probability \(0.25\) and \(X=2\) with probability \(0.75\). Suppose \(Y=-1\) with probability \(0.60\) and \(Y=1\) with probability \(0.40\). Find the probability mass function of \(S=X+Y\), and calculate \(P(S\geq 1)\).

Method and assumptions. The variables are discrete and independent, so use the discrete convolution formula. List each pair and its sum; the probability of each pair is the product of its component probabilities.

\(X\)\(Y\)\(S=X+Y\)Pair probability
0-1-1\(0.25(0.60)=0.15\)
011\(0.25(0.40)=0.10\)
2-11\(0.75(0.60)=0.45\)
213\(0.75(0.40)=0.30\)

The distinct sums are \(-1,1,3\). The value \(S=1\) comes from two different pairs, so their probabilities must be added:

$$ \begin{aligned} P(S=-1)&=0.15,\\ P(S=1)&=0.10+0.45=0.55,\\ P(S=3)&=0.30. \end{aligned} $$

Therefore, $$ P(S\geq 1)=P(S=1)+P(S=3)=0.55+0.30=0.85. $$ As a check, the full probability mass function sums to \(0.15+0.55+0.30=1.00\). The common mistake this method avoids is using just one decomposition for \(S=1\), which would miss either the pair \((0,1)\) or the pair \((2,-1)\).

Why the Continuous Formula Works

For continuous variables, a single point such as \(S=s\) has probability zero, so we calculate a density instead of adding point probabilities. A short change-of-variables argument gives the formula. Assume \(X\) and \(Y\) are independent and have densities. Transform the pair \((X,Y)\) to \((X,S)\), where \(S=X+Y\). The inverse transformation is \(x=x\), \(y=s-x\), and its Jacobian determinant has absolute value \(1\). Consequently the joint density of \(X\) and \(S\) is \(f_X(x)f_Y(s-x)\); integrating out \(x\) gives the marginal density of \(S\):

$$ \begin{aligned} f_{X,S}(x,s)&=f_{X,Y}(x,s-x)\cdot 1\\ &=f_X(x)f_Y(s-x),\\ f_S(s)&=\int_{-\infty}^{\infty}f_{X,S}(x,s)\,dx =\int_{-\infty}^{\infty}f_X(x)f_Y(s-x)\,dx. \end{aligned} $$

The factorization in the second line is exactly where independence is used. Without independence, the joint density need not equal the product of the marginal densities, and this convolution formula cannot be used as written. The integral may be taken over the whole real line because densities are zero outside their supports; in a calculation, it is often simpler to integrate only where both factors are nonzero.

Worked Example: Convolving Two Exponential Densities

Let \(X\) and \(Y\) be independent, with \(X\) having an exponential distribution of rate \(1\) and \(Y\) an exponential distribution of rate \(2\). Thus \(f_X(x)=e^{-x}\) for \(x>0\), \(f_Y(y)=2e^{-2y}\) for \(y>0\), and each density is zero otherwise. Find the density of \(S=X+Y\), then calculate \(P(S\leq\ln 2)\).

Method and assumptions. Both variables have densities and are independent, so use continuous convolution. Since both variables are positive, a sum \(s\) is possible only for \(s>0\). For such an \(s\), both \(x>0\) and \(s-x>0\) require \(0<x<s\).

$$ \begin{aligned} f_S(s) &=\int_0^s e^{-x}\,2e^{-2(s-x)}\,dx\\ &=2e^{-2s}\int_0^s e^x\,dx\\ &=2e^{-2s}(e^s-1)\\ &=2(e^{-s}-e^{-2s}),\qquad s>0. \end{aligned} $$

For \(s\leq 0\), the density is zero. To obtain the requested probability, integrate the density from \(0\) to \(\ln 2\):

$$ \begin{aligned} P(S\leq\ln 2) &=\int_0^{\ln 2}2(e^{-s}-e^{-2s})\,ds\\ &=\left[-2e^{-s}+e^{-2s}\right]_0^{\ln 2}\\ &=(-1+\tfrac14)-(-2+1)\\ &=0.25. \end{aligned} $$

Thus the density is \(2(e^{-s}-e^{-2s})\) for \(s>0\), and the requested probability is \(0.2500\) to four decimal places. As a check, the cumulative distribution function for \(s>0\) is \(1-2e^{-s}+e^{-2s}\), which at \(s=\ln 2\) is \(1-1+\tfrac14=0.25\). A common mistake is to integrate the density but mis-evaluate the exponential terms at the endpoint; here \(e^{-\ln 2}=1/2\) and \(e^{-2\ln 2}=1/4\).

Using Supports to Set Up the Integral

A continuous convolution is often easiest when its integration interval is identified before the integrand is simplified. For a given \(s\), the integrand is nonzero only when \(x\) is in the support of \(X\) and \(s-x\) is in the support of \(Y\). The intersection of those conditions determines the actual limits. This is not a new probability rule; it is a way to apply the formula without integrating regions where the integrand is zero.

Worked Example: Sum of Two Uniform Variables

Let \(X\) and \(Y\) be independent, with \(X\) uniform on \((0,1)\) and \(Y\) uniform on \((0,2)\). Find the density of \(S=X+Y\) and calculate \(P(S\leq 1)\).

Method and assumptions. The densities are \(f_X(x)=1\) for \(0<x<1\) and \(f_Y(y)=1/2\) for \(0<y<2\), and zero otherwise. In the convolution integrand, both factors are nonzero when \(0<x<1\) and \(0<s-x<2\). The latter condition is equivalent to \(s-2<x<s\). Thus the integration interval is the intersection of \((0,1)\) and \((s-2,s)\).

The support of the sum is \(0<s<3\). For \(0<s<1\), the intersection is \((0,s)\), giving

$$ f_S(s)=\int_0^s 1\cdot\frac12\,dx=\frac{s}{2},\qquad 0<s<1. $$

For \(1\leq s<2\), the intersection is \((0,1)\), so

$$ f_S(s)=\int_0^1 1\cdot\frac12\,dx=\frac12,\qquad 1\leq s<2. $$

For \(2\leq s<3\), the intersection is \((s-2,1)\). Therefore,

$$ f_S(s)=\int_{s-2}^1 1\cdot\frac12\,dx=\frac{3-s}{2},\qquad 2\leq s<3. $$

The density is zero outside \(0<s<3\). Because \(S\leq1\) lies in the first part of the density, $$ P(S\leq1)=\int_0^1\frac{s}{2}\,ds=\left[\frac{s^2}{4}\right]_0^1=0.25. $$ To check the piecewise density, its total integral is \(1/4+1/2+1/4=1\): the three parts integrate respectively to \(1/4\), \(1/2\), and \(1/4\). The common mistake avoided here is using the full support \((0,3)\) as the integration interval for every \(s\); the allowable \(x\)-values change with \(s\).

Checks and Common Exam Traps

Convolution calculations are easier to audit if the result is checked against the model before moving on. For discrete variables, the possible sums must come from adding values in the two supports, and all resulting probabilities must add to one. For continuous variables, the density must be nonnegative, vanish outside the possible range of the sum, and integrate to one.

1
Confirm the assumptions.
Identify whether the variables are discrete or have densities, and verify that independence is given or otherwise justified.
2
List the ways to make a sum.
For a discrete value \(s\), include every pair \(x,s-x\). For a density at \(s\), retain every \(x\) for which both component densities are nonzero.
3
Apply convolution and check.
Multiply the component probabilities or densities, then sum or integrate. Check the support and total probability or total density area.
  • Multiplying matching marginal probabilities is not convolution. The probability of a sum collects all pairs whose values add to the target.
  • Independence matters. A covariance of zero alone does not establish independence, so it does not justify replacing a joint probability or density by a product.
  • Support determines the limits. In a continuous problem, the integration range depends on the target value \(s\), even though the convolution formula is written over the whole real line.
  • Do not confuse a density value with a probability. For continuous \(S\), \(f_S(s)\) is a density; probabilities come from integrating the density over an interval.
Key takeaway: For independent summands, the distribution of their total is obtained by combining every compatible pair of component values. Discrete convolution sums the products of matching probabilities; continuous convolution integrates the products of matching densities.

Check Your Understanding

Use the stated independence assumptions and check each result against the possible sums or support.

  1. Independent discrete variables have \(P(X=-1)=0.4\), \(P(X=1)=0.6\), \(P(Y=0)=0.5\), and \(P(Y=3)=0.5\). Find the mass function of \(S=X+Y\). (Answer: \(P(S=-1)=0.20,\ P(S=1)=0.30,\ P(S=2)=0.20,\ P(S=4)=0.30\).)
  2. Independent variables are each uniform on \((0,1)\). Use convolution to find \(f_{X+Y}(s)\). (Answer: \(f_{X+Y}(s)=s\) for \(0<s<1\), \(f_{X+Y}(s)=2-s\) for \(1\leq s<2\), and \(0\) otherwise.)
  3. Independent variables have densities \(f_X(x)=3e^{-3x}\) for \(x>0\) and \(f_Y(y)=e^{-y}\) for \(y>0\), each zero otherwise. Find the density of \(S=X+Y\). (Answer: \(f_S(s)=\frac{3}{2}(e^{-s}-e^{-3s})\) for \(s>0\), and \(0\) otherwise.)
  4. For the variables in Question 3, calculate \(P(S\leq\ln 2)\). (Answer: \(0.3125\).)
  5. Suppose \(X\) and \(Y\) have densities but are dependent. Is \(\int_{-\infty}^{\infty}f_X(x)f_Y(s-x)\,dx\) necessarily the density of \(X+Y\)? (Answer: No; without independence the joint density need not factor into the product of the marginal densities.)
Clinical Biostats