Tutorials › Exam P - Probability › Sums of Identically Distributed Uniform Variables

Exam P · Sums of Independent Variables · Tutorial 815 of 915

Sums of Identically Distributed Uniform Variables

Learn to derive and apply the piecewise density for sums of independent uniform variables on a common interval.

Advanced 10 min read

What You'll Learn

  • Derive the triangular density for the sum of two independent uniforms on the same interval.
  • Identify the support and the change in density at the midpoint.
  • Scale the standard result to a common interval other than zero to one.
  • Derive the piecewise Irwin–Hall density for sums of several standard uniforms.
  • Apply these densities to probabilities while avoiding uniformity and support errors.

Why Sums of Uniform Variables Have Piecewise Densities

A uniform random variable has constant density across its interval, but the sum of two such variables does not. Near the lower end of the possible sum, only a small part of the two-variable range can produce that value. Near the middle, many more pairs can produce it. The resulting density rises and then falls, forming a triangle when the variables are uniform on the same interval.

This tutorial derives that triangular shape and extends the same geometric reasoning to the sum of \(n\) independent uniform variables on a common interval. The extension is called the Irwin–Hall distribution for the sum of \(n\) independent \(U(0,1)\) variables. The central tasks are to identify the support, determine which pieces of the density apply, and use the correct scaling when the common interval is not \(0\) to \(1\).

Model: Unless stated otherwise, \(X_1,\ldots,X_n\) are independent and identically distributed continuous uniform random variables on the same interval. Independence is essential: the convolution and geometric calculations below use the product of the individual densities. If the variables are dependent, their marginal uniform distributions alone do not determine the distribution of their sum.

Two Uniform Variables: The Triangular Density

Begin with independent \(X,Y\sim U(0,1)\), and let \(S=X+Y\). Each variable has density \(1\) on \((0,1)\), so the joint density of \((X,Y)\) is \(1\) on the unit square and \(0\) outside it. The sum can range from \(0\) to \(2\). For a fixed sum \(s\), the possible pairs lie along the line \(x+y=s\). The amount of this line that remains inside the square grows up to \(s=1\), then shrinks.

More formally, the density of a sum of independent continuous variables is obtained by convolution. For \(0<s<2\),

$$ f_S(s)=\int_{-\infty}^{\infty} f_X(x)f_Y(s-x)\,dx. $$

The integrand is \(1\) only when both \(0<x<1\) and \(0<s-x<1\). Thus the integration range is the overlap of \(0<x<1\) and \(s-1<x<s\). For \(0<s<1\), this overlap is \(0<x<s\), with length \(s\). For \(1<s<2\), it is \(s-1<x<1\), with length \(2-s\). Outside \((0,2)\), there is no overlap.

$$ f_S(s)= \begin{cases} s, & 0<s<1,\\ 2-s, & 1\le s<2,\\ 0, & \text{otherwise}. \end{cases} $$

The value at the single joining point \(s=1\), or at either endpoint, does not affect probabilities for a continuous random variable. The density increases from \(0\) to \(1\) on the first interval and decreases from \(1\) to \(0\) on the second. As a check, the area under the density is

$$ \int_0^1 s\,ds+\int_1^2(2-s)\,ds =\frac12+\frac12=1. $$

Worked Example: A Lower-Tail Probability for Two Standard Uniforms

Let \(X\) and \(Y\) be independent \(U(0,1)\) variables. Find \(P(X+Y\le 0.5)\). State the method and avoid treating the sum as uniform.

Method. Set \(S=X+Y\). Since \(0.5\) lies in the rising part of the triangular density, \(f_S(s)=s\) for \(0<s<1\). Therefore,

$$ P(S\le 0.5)=\int_0^{0.5}s\,ds =\left[\frac{s^2}{2}\right]_0^{0.5} =\frac{(0.5)^2}{2} =\frac{0.25}{2} =0.125. $$

The same result follows from geometry: the event is a right triangle in the unit square with legs of length \(0.5\), so its area is \(\frac12(0.5)(0.5)=0.125\). The density integrates to one over its full support, and the event occupies only a small lower corner of the square. Common mistake avoided: the sum is not uniform on \((0,2)\); assuming a constant density would give \(0.25\), which is twice the correct probability.

Scaling to Any Common Interval

If \(X,Y\) are independent \(U(a,b)\) variables, where \(a<b\), write \(L=b-a\). Each variable can be expressed as \(a+L U\), where \(U\sim U(0,1)\). Consequently, \(X+Y=2a+L(U_1+U_2)\), with \(U_1,U_2\) independent \(U(0,1)\). Transforming the standard triangular density gives support from \(2a\) to \(2b\), with its peak at \(a+b\):

$$ f_{X+Y}(s)= \begin{cases} \dfrac{s-2a}{(b-a)^2}, & 2a<s<a+b,\\[6pt] \dfrac{2b-s}{(b-a)^2}, & a+b\le s<2b,\\[6pt] 0, & \text{otherwise}. \end{cases} $$

The denominator is \((b-a)^2\), not \(b-a\): the sum's density has units inverse to the sum's measurement scale. One way to verify the formula is to integrate each triangular half. Each half has base \(b-a\) and height \(1/(b-a)\), so each has area \(1/2\); together they have area \(1\).

Worked Example: A Probability on a Shifted and Scaled Interval

A hypothetical model assigns independent uniform values \(X,Y\sim U(2,6)\), measured in thousands of dollars. Find \(P(6<X+Y<9)\). Use the scaled triangular density and check the probability against the support and total area.

Method. Here \(a=2\), \(b=6\), and \(b-a=4\). The sum has support \((4,12)\) and peak at \(a+b=8\). The interval from \(6\) to \(9\) crosses the peak, so split the probability at \(8\):

$$ f_{X+Y}(s)= \begin{cases} \dfrac{s-4}{16}, & 4<s<8,\\[4pt] \dfrac{12-s}{16}, & 8\le s<12. \end{cases} $$

On the rising section,

$$ P(6<X+Y<8) =\int_6^8\frac{s-4}{16}\,ds =\left[\frac{(s-4)^2}{32}\right]_6^8 =\frac{16-4}{32} =\frac{12}{32} =\frac38. $$

On the falling section,

$$ P(8\le X+Y<9) =\int_8^9\frac{12-s}{16}\,ds =\left[-\frac{(12-s)^2}{32}\right]_8^9 =\frac{16-9}{32} =\frac7{32}. $$

The two pieces give \(\frac38+\frac7{32}=\frac{12}{32}+\frac7{32}=\frac{19}{32}=0.59375\), or \(0.5938\) to four decimal places. This is between \(0\) and \(1\), and the interval is inside the support \((4,12)\). Common mistake avoided: applying the standard \(U(0,1)\) density without shifting and scaling would put the support in the wrong place and use the wrong density height.

Several Standard Uniforms: The Irwin–Hall Density

For \(n\) independent \(U(0,1)\) variables, define \(T_n=X_1+\cdots+X_n\). Its support is \((0,n)\). The density is polynomial on each interval between successive integers, because as the possible sum increases past an integer, additional parts of the unit cube become available.

A useful derivation starts with the cumulative distribution function. In the nonnegative orthant, the region \(x_1+\cdots+x_n\le t\) has volume \(t^n/n!\) for \(t>0\). To restrict this region to the unit cube, exclude points for which one or more coordinates exceed \(1\). If a specified set of \(k\) coordinates exceeds \(1\), subtract \(1\) from each of those coordinates. The remaining region has volume \((t-k)^n/n!\) when \(t>k\), and has zero volume when \(t\le k\). Inclusion-exclusion over the choices of coordinates therefore gives the CDF below. Here \((z)_+=\max(z,0)\).

$$ F_{T_n}(t)=\frac{1}{n!}\sum_{k=0}^{n}(-1)^k\binom{n}{k}(t-k)_+^n. $$

This volume argument uses independence and the fact that the joint density is \(1\) throughout the unit cube. Differentiating on each open interval between integers gives the density. Terms with \(k>t\) are zero, so for \(0<t<n\),

$$ f_{T_n}(t)=\frac{1}{(n-1)!} \sum_{k=0}^{\lfloor t\rfloor}(-1)^k\binom{n}{k}(t-k)^{n-1}. $$

At an integer boundary, a newly included term is zero at the instant it enters, so the expression gives the same continuous density there for \(n\ge2\). Outside the support the density is zero. This is a piecewise-polynomial formula, not a single polynomial across the whole support. For example, when \(n=3\), it becomes

$$ f_{T_3}(t)= \begin{cases} \dfrac{t^2}{2}, & 0<t<1,\\[4pt] \dfrac{-2t^2+6t-3}{2}, & 1\le t<2,\\[4pt] \dfrac{(3-t)^2}{2}, & 2\le t<3,\\[4pt] 0, & \text{otherwise}. \end{cases} $$

The middle expression comes directly from \(\frac12[t^2-3(t-1)^2]\); the last comes from \(\frac12[t^2-3(t-1)^2+3(t-2)^2]\). The density is symmetric about \(1.5\), as expected because replacing each \(X_i\) by \(1-X_i\) changes the sum to \(3-T_3\).

For \(n\) independent \(U(a,b)\) variables, let \(L=b-a\). Their sum is \(na+LT_n\), so the corresponding density is \(f_{T_n}((s-na)/L)/L\), on \(na<s<nb\). The factor \(1/L\) is the density adjustment for the change of scale.

Worked Example: A Probability for Three Standard Uniforms

Let \(X_1,X_2,X_3\) be independent \(U(0,1)\) variables and \(T=X_1+X_2+X_3\). Find \(P(1.5<T<2.5)\). Use the CDF formula, show each piece, and avoid applying a single polynomial beyond its interval.

Method. For \(1<t<2\), the CDF has the terms \(k=0,1\):

$$ F_T(t)=\frac{t^3-3(t-1)^3}{6}. $$

Thus,

$$ F_T(1.5) =\frac{(1.5)^3-3(0.5)^3}{6} =\frac{3.375-0.375}{6} =\frac36 =\frac12. $$

For \(2<t<3\), the \(k=2\) term must also be included:

$$ F_T(t)=\frac{t^3-3(t-1)^3+3(t-2)^3}{6}. $$

Therefore,

$$ F_T(2.5) =\frac{(2.5)^3-3(1.5)^3+3(0.5)^3}{6} =\frac{15.625-10.125+0.375}{6} =\frac{5.875}{6} =\frac{47}{48}. $$

Subtracting the two CDF values gives

$$ P(1.5<T<2.5)=\frac{47}{48}-\frac12 =\frac{23}{48} =0.479166\ldots $$

The probability is \(0.4792\) to four decimal places. The interval lies inside the support \((0,3)\), and the result is consistent with symmetry about \(1.5\): the probability from \(1.5\) to \(2.5\) equals the probability from \(0.5\) to \(1.5\). Common mistake avoided: using the \(1<t<2\) CDF expression at \(t=2.5\) omits the inclusion-exclusion term for two coordinates exceeding \(1\).

Common Exam Traps and a Reliable Procedure

The main challenge is not integration itself; it is choosing the correct region or formula before integrating. A sum of uniforms is not uniform merely because each summand is uniform. Also, the density changes at the midpoint for two variables, and at integer thresholds for the standard sum of several variables. A formula from one piece must not be extended beyond that piece.

1
State the model and support.
Confirm that the variables are independent and share the stated uniform interval. For \(n\) variables on \((a,b)\), the sum lies between \(na\) and \(nb\).
2
Transform to the standard interval if useful.
For a common interval \((a,b)\), subtract \(a\) from each variable and divide by \(b-a\). Track the resulting sum and density scale.
3
Select the correct piece.
For two variables, split at the midpoint. For \(n\) standard uniforms, split at integer values and include every term whose threshold has been passed.
4
Compute and check.
Integrate the relevant density or subtract CDF values. Verify that the event lies in the support and that the final probability is between zero and one.

When using the geometric argument for two variables, the density at a sum \(s\) is the length of the allowed overlap in the convolution integral, multiplied by the product of the individual densities. The overlap length is not the same for every \(s\). For more variables, the inclusion-exclusion formula accounts for the cube boundaries that create the successive polynomial pieces.

Key takeaway: Two independent uniforms on a common interval have a triangular sum density. For more independent standard uniforms, the sum has the piecewise Irwin–Hall density. In either case, locate the support and the relevant piece before calculating a probability.

Check Your Understanding

For each problem, identify the applicable support and density piece before calculating.

  1. Let \(X,Y\) be independent \(U(0,1)\) variables. Find \(P(X+Y>1.4)\). (Answer: \(0.1800\))
  2. Let \(X,Y\) be independent \(U(10,14)\) variables. Find the density of \(X+Y\) at \(25\). (Answer: \(3/16=0.1875\))
  3. Let \(X_1,X_2,X_3\) be independent \(U(0,1)\) variables. Find \(P(0.5<X_1+X_2+X_3<1.5)\). (Answer: \(23/48=0.4792\), to four decimal places)
  4. Let \(X_1,\ldots,X_4\) be independent \(U(0,1)\) variables. Find the density of their sum at \(1.5\). (Answer: \(23/48=0.4792\), to four decimal places)
  5. Let \(X_1,X_2,X_3\) be independent \(U(-1,1)\) variables. Find \(P(-1<X_1+X_2+X_3<1)\). (Answer: \(2/3=0.6667\), to four decimal places)
Clinical Biostats