Why Convolution Is Needed
When two quantities are added, knowing the distribution of each one separately does not by itself give the density of their sum. The value of a sum \(S=X+Y\) can arise from many pairs: a large value of \(X\) with a small value of \(Y\), or the reverse. For independent continuous variables, convolution accounts for all such pairs by integrating their density contributions.
The method is especially useful when a total is formed from separate random components, such as hypothetical independent service times or losses. The key tasks are to identify the densities, use independence correctly, and integrate over values that can contribute to the specified sum. This tutorial develops the formula and applies it to exponential and uniform models.
The formula assumes independence and continuous distributions with densities. It does not say that the sum has a density equal to the product of the two densities, nor does it apply in this product form when \(X\) and \(Y\) are dependent. If the variables are dependent and have a joint density, the corresponding formula uses that joint density instead.
Why the Convolution Formula Holds
A short change-of-variables argument explains the integral. Start with the joint density of \((X,Y)\). Independence gives \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\). Transform from \((X,Y)\) to \((X,S)\), where \(S=X+Y\). The inverse transformation is \(x=x\), \(y=s-x\), and its Jacobian has absolute value 1.
Consequently, the joint density of \((X,S)\) is \(f_X(x)f_Y(s-x)\). To obtain the density of \(S\) alone, integrate out \(x\). This gives the convolution integral. The integration adds the contributions from every possible value of \(X\) that can pair with \(Y=s-X\) to make the specified sum \(s\).
In an actual calculation, the integral is usually shortened by noting where both densities are nonzero. That step is essential: integrating over values that cannot occur adds nothing, while omitting values that can occur gives an incorrect density. The examples below determine the contributing range directly from the stated distributions.
Convolving Exponential Densities
For an exponential random variable with rate \(\lambda>0\), the density is \(f(x)=\lambda e^{-\lambda x}\) for \(x\geq 0\), and zero otherwise. The rate is stated explicitly because it determines both the coefficient and the exponential term.
Worked Example: Sum of Two Exponential Service Times
In a hypothetical system, two independent service stages have durations \(X\sim\operatorname{Exp}(2)\) and \(Y\sim\operatorname{Exp}(1)\), where rates are measured per hour. Find the density of the total duration \(S=X+Y\), and calculate \(P(S\leq 1)\). The service durations are continuous, independent, and nonnegative.
Method. Use the continuous convolution formula. Since both durations are nonnegative, for a fixed \(s>0\), \(x\) must range from \(0\) to \(s\), so that both \(x\geq0\) and \(s-x\geq0\).
The densities are \(f_X(x)=2e^{-2x}\) for \(x\geq0\) and \(f_Y(y)=e^{-y}\) for \(y\geq0\). Therefore, for \(s>0\),
For \(s\leq0\), the density is zero because a sum of nonnegative durations cannot be negative. Thus \(f_S(s)=2e^{-s}-2e^{-2s}\) for \(s>0\), and \(f_S(s)=0\) otherwise.
To calculate the probability, integrate the density from 0 to 1:
The probability is \(0.3996\) to four decimal places. As a check on the density, its integral over the positive half-line is \(2-1=1\). A common mistake is to use the rate 2 for both stages because it appears in the first density; the second stage has rate 1, and its density must remain \(e^{-y}\).
Convolving Uniform Densities
A uniform density is constant over its interval and zero elsewhere. When the intervals have different lengths, the convolution need not rise and fall symmetrically around the midpoint of the sum’s support. The density at a given sum is proportional to the length of the interval of component values that can produce that sum.
Worked Example: Sum of Uniform Inspection Times
Two independent inspection times, measured in hours, are modeled hypothetically by \(X\sim\operatorname{Uniform}(0,2)\) and \(Y\sim\operatorname{Uniform}(0,3)\). Find the density of \(S=X+Y\), then calculate \(P(S\leq2)\). Both variables have continuous uniform distributions and are independent.
Method. Each density is constant on its interval: \(f_X(x)=1/2\) for \(0\leq x\leq2\), and \(f_Y(y)=1/3\) for \(0\leq y\leq3\). Their product is \(1/6\) wherever both density factors are nonzero. For a fixed \(s\), the possible \(x\)-values must satisfy \(0\leq x\leq2\) and \(0\leq s-x\leq3\). The density is therefore \(1/6\) multiplied by the length of the allowable \(x\)-interval.
For \(0<s<2\), the allowable interval is \(0\leq x\leq s\), of length \(s\), so \(f_S(s)=s/6\). For \(2\leq s\leq3\), the interval is \(0\leq x\leq2\), of length 2, so \(f_S(s)=2/6=1/3\). For \(3<s<5\), it is \(s-3\leq x\leq2\), of length \(5-s\), so \(f_S(s)=(5-s)/6\). Outside the sum’s possible range from 0 to 5, the density is zero. In full,
The requested probability uses the first piece of the density:
As a check, the total integral is \(1/3+1/3+1/3=1\): the increasing part, the constant part, and the decreasing part each integrate to \(1/3\). A common mistake is to assume the density is triangular throughout because both variables are uniform. Here the shorter interval produces a constant middle section.
Combining an Exponential and a Uniform Variable
The same integral applies when the component distributions have different shapes. In particular, a uniform variable restricts which values can be contributed by that component, while the exponential density continues to decrease as its argument increases.
Worked Example: Exponential Waiting Time Plus a Uniform Delay
A hypothetical total delay is \(S=X+U\), where \(X\sim\operatorname{Exp}(1)\) hours and \(U\sim\operatorname{Uniform}(0,1)\) hour are independent. Find \(f_S(s)\) and calculate \(P(S>1.5)\). Both models are continuous; the exponential rate is 1 per hour.
Method. The component densities are \(f_X(x)=e^{-x}\) for \(x\geq0\), and \(f_U(u)=1\) for \(0\leq u\leq1\). Use \(u\) as the integration variable. A contributing value must have \(0\leq u\leq1\) and \(s-u\geq0\).
When \(0<s<1\), these restrictions give \(0\leq u\leq s\). When \(s\geq1\), they give \(0\leq u\leq1\). Thus
The density is zero for \(s\leq0\). The two formulas agree at \(s=1\): \(1-e^{-1}=(e-1)e^{-1}\). To find the requested tail probability, use the second density because \(1.5>1\):
The result is \(0.3834\) to four decimal places. A useful check is that the density integrates to 1: the integral from 0 to 1 is \(e^{-1}\), and the integral from 1 to infinity is \(1-e^{-1}\). The common mistake avoided here is integrating over the entire uniform interval \(0\leq u\leq1\) when \(s<1\); values \(u>s\) would require a negative exponential argument \(s-u\), which is impossible for this nonnegative \(X\).
Checks and Common Exam Traps
Convolution is a calculation, but it is also a model check: the resulting density must be nonnegative and integrate to 1. These checks often reveal a wrong coefficient, a missing interval, or an incorrect integral limit before the result is used in a probability calculation.
- Multiplying densities instead of integrating. The product \(f_X(x)f_Y(s-x)\) is an integrand, not the density of the sum. The integral accumulates contributions across possible component values.
- Using the product formula without independence. Independence is what gives \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\). Without it, this substitution is unjustified.
- Confusing a density with a probability. A density value such as \(f_S(1)=0.5\) is not \(P(S=1)\). For a continuous variable, probabilities are obtained by integrating the density over an interval.
- Forgetting the zero-density regions. The integrand contributes only where both component densities are nonzero. In the exponential-plus-uniform example, the valid integration interval changes at \(s=1\).
- Skipping the total-area check. The integral of a valid density over its full range must equal 1. If it does not, revisit the algebra and the ranges used.
Check Your Understanding
For each problem, state the relevant convolution method and check that the requested value follows from the specified distributions.
- Independent hypothetical component times satisfy \(X\sim\operatorname{Exp}(2)\) and \(Y\sim\operatorname{Exp}(4)\), with rates per hour. Find the density of \(S=X+Y\) for \(s>0\). (Answer: \(f_S(s)=4(e^{-2s}-e^{-4s})\), \(s>0\); zero otherwise.)
- Independent variables satisfy \(X\sim\operatorname{Uniform}(0,4)\) and \(Y\sim\operatorname{Uniform}(0,1)\). Find the density \(f_{X+Y}(3.5)\). (Answer: \(0.25\).)
- Let \(X\sim\operatorname{Exp}(2)\) and \(U\sim\operatorname{Uniform}(0,2)\) be independent, with the exponential rate measured per hour. Find the density of \(X+U\) at \(s=1\). (Answer: \((1-e^{-2})/2\approx0.4323\).)
- Two independent hypothetical waiting times each have distribution \(\operatorname{Exp}(1)\). Find the probability that their sum is at most 2. (Answer: \(1-3e^{-2}\approx0.5940\).)
- Independent \(U_1,U_2\sim\operatorname{Uniform}(0,1)\) represent two delays. Find \(P(0.5<U_1+U_2\leq1.5)\). (Answer: \(0.75\).)