Why the Overlap Determines the Density
For two independent uniform random variables, the density of their sum depends on how many pairs of values can produce each possible total. Near the smallest possible sum, there are few such pairs; as the sum increases, the available combinations grow. If one uniform interval is wider than the other, that growth eventually gives way to a range where the overlap stays constant, before it shrinks near the largest possible sum.
The continuous convolution formula turns this picture into a calculation. The most useful geometric quantity is the length of the overlap between one variable’s support and a shifted version of the other’s support. Tracking that length gives the density, including its support, change points, and peak.
Definition and General Overlap Formula
To see the intervals in this expression, fix a possible sum \(s\). If \(X=x\), then \(Y\) must equal \(s-x\). The restriction \(c\le s-x\le d\) is equivalent to \(s-d\le x\le s-c\). Thus the allowed values of \(x\) lie in both \([a,b]\) and \([s-d,s-c]\). Their overlap length is exactly the numerator above.
A uniform density is constant on its support and zero elsewhere. In the convolution integral, the product of the two constant densities is \(1/((b-a)(d-c))\) wherever both support restrictions hold. Integrating that constant over the allowed \(x\)-interval gives the overlap formula.
The Piecewise Shape
It is convenient to shift the variables to start their supports at zero. Let \(p=b-a\), \(q=d-c\), \(U=X-a\), \(V=Y-c\), and \(T=U+V\). Then \(U\sim\operatorname{Unif}(0,p)\), \(V\sim\operatorname{Unif}(0,q)\), and \(S=a+c+T\). The widths \(p\) and \(q\) determine the shape; the locations \(a\) and \(c\) simply shift it.
Suppose first that \(p\le q\). The overlap formula, or equivalently the convolution integral, gives the following result.
The formulas agree at the boundaries. At \(t=p\), both the rising and constant formulas equal \(1/q\); at \(t=q\), the constant and falling formulas also equal \(1/q\). Values assigned at individual boundary points do not affect probabilities, but these matches make the piecewise description continuous.
Deriving the Formula
For \(0\le t\le p+q\), the convolution integral for the sum of the two independent variables is \(f_T(t)=\int_{-\infty}^{\infty} f_U(u)f_V(t-u)\,du\). The integrand is \(1/(pq)\) when \(u\in[0,p]\) and \(t-u\in[0,q]\), and is zero otherwise. The second condition is equivalent to \(u\in[t-q,t]\). Therefore,
This integral is the overlap length divided by \(pq\). Since \(p\le q\), the overlap has three forms:
Here \(t-q\le 0\) and \(t\le p\), so the intersection runs from \(0\) to \(t\). Its length is \(t\), giving \(f_T(t)=t/(pq)\).
Here \(t-q\le 0\) and \(t\ge p\), so \([0,p]\) lies within \([t-q,t]\). The overlap length is \(p\), giving \(f_T(t)=p/(pq)=1/q\).
Here \(t-q\ge 0\) and \(t\ge p\), so the intersection runs from \(t-q\) to \(p\). Its length is \(p-(t-q)=p+q-t\), giving \(f_T(t)=(p+q-t)/(pq)\).
For \(t<0\), the intervals cannot overlap because \([t-q,t]\) lies entirely to the left of zero. For \(t>p+q\), it lies entirely to the right of \([0,p]\). Thus the density vanishes outside \([0,p+q]\), completing the derivation.
If \(q<p\), the same reasoning applies after exchanging the roles of \(U\) and \(V\). Equivalently, let \(m=\min(p,q)\) and \(M=\max(p,q)\). The rising section has width \(m\), the constant section has width \(M-m\), and the falling section has width \(m\). The peak height is \(1/M\).
Worked Examples
Worked Example: A Shifted Trapezoidal Density
Let \(X\sim\operatorname{Unif}(1,4)\) and \(Y\sim\operatorname{Unif}(2,7)\) be independent. Find the density of \(S=X+Y\).
The interval widths are \(p=4-1=3\) and \(q=7-2=5\), and the sum is shifted by \(1+2=3\). The support is \([1+2,4+7]=[3,11]\). For \(T=(X-1)+(Y-2)\), the formula with \(p=3\) and \(q=5\) gives a rising section on \([0,3]\), a constant section on \([3,5]\), and a falling section on \([5,8]\). Shifting by 3 yields
At \(s=6\), the rising expression is \(3/15=1/5\), matching the plateau. At \(s=8\), the falling expression is \(3/15=1/5\), also matching the plateau. The density starts and ends at zero, as required at the support endpoints.
Worked Example: A Shorter First Uniform Interval
Let \(X\sim\operatorname{Unif}(-2,3)\) and \(Y\sim\operatorname{Unif}(1,3)\) be independent. Find the density of \(S=X+Y\), then calculate \(P(S\le 2)\).
The widths are 5 and 2, so the smaller width is \(p=2\) and the larger is \(q=5\). The minimum and maximum possible sums are \(-2+1=-1\) and \(3+3=6\). The change points are \(-1+2=1\) and \(-1+5=4\). The shifted density is therefore
To find \(P(S\le2)\), integrate the rising section from \(-1\) to 1 and the constant section from 1 to 2:
The first area is \(1/5\), the area of a triangle of base 2 and height \(1/5\); the second is another \(1/5\). Their sum is \(2/5\).
Worked Example: Using the Plateau to Find an Interval Probability
Let \(X\sim\operatorname{Unif}(0,4)\) and \(Y\sim\operatorname{Unif}(10,12)\) be independent. Find \(P(12.5\le X+Y\le14.5)\).
The widths are 4 and 2, and the support of \(S=X+Y\) is \([10,16]\). After shifting by 10, the widths are \(p=2\) and \(q=4\). Hence the density rises from 10 to 12, is constant from 12 to 14, and falls from 14 to 16:
The requested probability is the area from 12.5 to 14 plus the area from 14 to 14.5. The first part is a rectangle. The second is a trapezoid whose endpoint heights are \(f_S(14)=1/4\) and \(f_S(14.5)=1.5/8=3/16\):
The density is continuous at 14, and the two areas are \(24/64\) and \(7/64\), respectively, so the stated probability is \(31/64\).
Normalization and Checks
A piecewise expression is not a valid density merely because its formula looks plausible. It must be nonnegative and have total integral one. For \(p\le q\), the rising and falling portions each have triangular area \(\tfrac12 p\cdot(1/q)=p/(2q)\), while the plateau has area \((q-p)/q\). Therefore,
This also covers \(p=q\), when the plateau has width zero. The density is nonnegative throughout its support, equals zero at the two support endpoints, and has peak height \(1/q=1/\max(p,q)\). These provide quick checks on a calculation.
A common mistake is to assume every sum of two uniforms has a triangular density. That is true when the interval widths are equal, but not when they differ: the longer interval produces a constant-density section whose length is the difference between the widths. Another error is to use the sum of the widths as the peak denominator. The peak is \(1/\max(p,q)\), not \(1/(p+q)\), because the maximum overlap length is the shorter width and the product of the original density heights is \(1/(pq)\).
Check Your Understanding
Use the overlap interpretation and the piecewise formula to answer these questions.
- If the interval widths are 2 and 6, what is the height and width of the constant section?
- For independent uniforms on \([3,5]\) and \([-1,4]\), what is the support of their sum and where are the density’s change points?
- Why is the overlap length zero for sums below the sum of the two lower endpoints?
- When the two uniform intervals have the same width, what happens to the constant section?
- State two checks that can help detect an incorrect piecewise density for a sum of independent uniform variables.