Sums, Convolutions, and Order Statistics
Once random variables are defined jointly, the next natural question is what happens when we combine them. Sums of independent random variables produce convolutions. Maxima, minima, and sorted samples produce order statistics. These constructions explain why gamma distributions arise from exponential waiting times, why sums of uniforms have triangular and then smoother densities, and why sorted uniform samples lead to beta distributions.
Figure: A Galton box turns repeated random left-right choices into an approximate bell-shaped distribution. Image: Wikimedia Commons, Marcin Floryan, CC BY-SA 3.0.
MIT 18.440 uses these topics to connect earlier distribution families with joint densities and conditional reasoning. A key theme is that formulas often become simple when one first draws the right region in the plane or cube: the density of integrates over the line , while order statistics integrate over the ways sample points can be arranged.
Definitions
If and are independent continuous random variables with densities and , then the density of is the convolution
The corresponding CDF computation is
For discrete independent variables,
If are sampled and then sorted, the ordered values are called order statistics:
For i.i.d. uniform variables on , has beta distribution with parameters :
Key results
Sums preserve several distribution families:
| Independent summands | Sum distribution | Reason |
|---|---|---|
| Binomial and Binomial | Binomial | combine trials |
| Poisson and Poisson | Poisson | superpose processes |
| Normal and Normal | Normal | transform or bell-curve geometry |
| Gamma and Gamma | Gamma | convolution with common rate |
For independent variables with finite means,
For independent variables with finite variances,
The minimum and maximum of i.i.d. variables can be handled using CDFs. If and the have CDF , then
If , then
These formulas are often easier than starting with densities.
Convolution is best understood as adding up all ways a target sum can occur. In the discrete case, the sum can happen through pairs , so one sums over . In the continuous case, a line has infinitely many points, and the integral accumulates density along the compatible values. The formula
is the continuous version of the same bookkeeping.
Support is often the hardest part of convolution. Before integrating, determine where the summands can live and what range the sum can have. For two uniforms on , the sum ranges over , but the integration length increases on and decreases on . This piecewise behavior is typical when densities have bounded support.
Order statistics are another way of organizing a joint sample. If independent points are sampled from a continuous distribution, ties have probability zero, so sorting creates a unique ordered vector. For uniforms, the event requires sample points below , one point near , and points above . The combinatorial coefficient counts which original sample point lands near and which points lie on each side.
For uniform order statistics, the beta connection is not accidental. The density
contains one factor for each point below and above the observed order statistic. This is the same algebraic shape as a beta posterior after observing successes and failures. In both settings, powers of and record counts.
Sums and order statistics also demonstrate that functions of independent variables need not be independent. The pair may be independent in special normal cases, but not generally. The sorted values of a sample are especially dependent: if the maximum is small, all other order statistics must also be small.
Visual
Region for X+Y <= a in the unit square
y
1 |---------+
| / |
| / |
| / |
0 +--------- x
0 a 1
For 0 <= a <= 1, the area is a triangle with area a^2/2.
The first diagram gives the algebraic route: compute a CDF over a region, then differentiate to get a density. The ASCII square gives the geometric route for the uniform example. Both routes are the same calculation in different language. Geometry is often the fastest way to avoid wrong integration limits, especially when the support is a polygon or simplex.
Order statistics have a similar geometric interpretation in higher-dimensional cubes. For independent uniforms, the unordered sample is uniform on the cube . Sorting folds the cube into congruent regions corresponding to the possible orderings. This symmetry is why factorial factors appear in order-statistic densities.
For repeated sums, direct convolution quickly becomes cumbersome. This is why the course soon moves to moment generating functions and characteristic functions: transforms turn repeated convolution into powers of a single function. The convolution view is still essential, because it explains what those transforms are simplifying and how support constraints enter before algebra begins. Without that geometric understanding, transform answers can become detached from the original random variables. Start with the region, then simplify the algebra carefully afterward.
Worked example 1: sum of two independent uniforms
Problem: Let be independent uniform random variables on . Find the density of .
Method:
- Since , the support of is .
- The convolution is
- The integrand equals exactly when
- The second condition is
- Therefore must lie in
- The length of this interval is the density.
For :
For :
Outside , .
Checked answer: the density integrates to
Worked example 2: maximum of independent uniforms
Problem: Let be independent uniform variables on , and let . Find the CDF, density, and expectation of .
Method:
- For ,
- Independence gives
- Differentiate:
- Compute the expectation:
Checked answer: for , , the mean of one uniform. As grows, approaches , which matches the intuition that the maximum of many uniform samples is near the right endpoint.
Code
import numpy as np
def triangular_sum_density(z):
z = np.asarray(z)
out = np.zeros_like(z, dtype=float)
left = (0 <= z) & (z <= 1)
right = (1 < z) & (z <= 2)
out[left] = z[left]
out[right] = 2 - z[right]
return out
grid = np.linspace(0, 2, 2001)
area = np.trapz(triangular_sum_density(grid), grid)
print("area under triangular density:", area)
def max_uniform_mean(n):
return n / (n + 1)
for n in [1, 2, 10, 100]:
print(n, max_uniform_mean(n))
rng = np.random.default_rng(0)
samples = rng.random((100_000, 10)).max(axis=1)
print("simulated max mean for n=10:", samples.mean())
Common pitfalls
- Forgetting independence in convolution formulas. Without independence, the joint density is not the product of marginals.
- Using the same convolution limits for every value of . Supports change the limits piece by piece.
- Confusing the density of with the CDF of .
- Assuming order statistics are independent. Sorted sample values are strongly dependent.
- Forgetting the combinatorial factor in the density of the th order statistic.