Tutorials › Probability Theory (Graduate) › Computing Sum Distributions from Joint Laws

Product Measures and Fubini · Tutorial 202 of 946

Computing Sum Distributions from Joint Laws

Learn how half-plane probabilities and diagonal density sections turn a joint law into the distribution of the sum.

Intermediate 10 min read

What You'll Learn

  • Express the distribution function of a sum as the joint-law measure of a half-plane.
  • Write the half-plane integral explicitly when the joint law has a density.
  • Derive the density of a sum by integrating the joint density along diagonal sections.
  • Identify when a sum has no density, even though its distribution function is readily computed.
  • Calculate sum distributions for continuous and discrete joint laws.

From a Joint Law to the Law of a Sum

Knowing the joint law of two random variables gives a direct way to study many functions of them. For their sum, the key geometric fact is simple: the event that the sum is at most \(t\) corresponds to the half-plane below the line \(x+y=t\). If the joint law has a density, the density of the sum is obtained from sections along those diagonal lines.

These calculations work whether or not the two variables are independent. Independence can simplify the joint law in particular examples, but the starting point is always the joint law itself.

Definition: Let \(X\) and \(Y\) be real-valued random variables, and write \(S=X+Y\). Their joint law is the probability measure \(\mu_{X,Y}\) on \(\mathbb R^2\) defined by \(\mu_{X,Y}(B)=\mathbb P((X,Y)\in B)\) for every Borel set \(B\subseteq\mathbb R^2\). The distribution function of \(S\) is \(F_S(t)=\mathbb P(S\le t)\), for \(t\in\mathbb R\).

The line \(x+y=t\) is the boundary of the half-plane \(x+y\le t\). Thus, for any joint law, the distribution function is the joint-law measure of that half-plane. If the joint law has a density, this probability can be written as an integral over the half-plane. If it does not, the measure formulation still applies.

The Half-Plane Formula

Theorem: For any real-valued random variables \(X\) and \(Y\), with joint law \(\mu_{X,Y}\), the distribution function of \(S=X+Y\) satisfies $$ F_S(t)=\mu_{X,Y}\bigl(\{(x,y)\in\mathbb R^2:x+y\le t\}\bigr),\qquad t\in\mathbb R. $$ If \(\mu_{X,Y}\) has a density \(f_{X,Y}\) with respect to two-dimensional Lebesgue measure, then $$ F_S(t)=\int_{\mathbb R}\int_{-\infty}^{t-x} f_{X,Y}(x,y)\,dy\,dx. $$

Proof. By the definition of the joint law, the probability that \((X,Y)\) belongs to a Borel set \(B\) equals \(\mu_{X,Y}(B)\). Taking \(B=\{(x,y):x+y\le t\}\), the event \((X,Y)\in B\) is exactly the event \(X+Y\le t\). This proves the measure formula. If the joint law has density \(f_{X,Y}\), its measure of \(B\) is the integral of that density over \(B\). At each fixed \(x\), the condition \(x+y\le t\) is equivalent to \(y\le t-x\); integrating these vertical sections gives the stated iterated integral. The integrand is nonnegative, so Tonelli's theorem justifies the iterated integral. \(\square\)

The half-plane description includes any probability mass on its boundary. That detail matters for joint laws that may assign positive probability to a line. When the joint law has a density with respect to area, every line has joint probability zero, so changing the boundary convention does not change the integral.

Worked Example: A Sum of Two Uniform Variables

Suppose the joint density is \(f_{X,Y}(x,y)=1\) on the square \(0\le x\le1,\ 0\le y\le1\), and is zero elsewhere. To compute the density of the sum, consider the line \(x+y=t\). Its contribution is the integral of the joint density over those \(x\) for which both \(x\) and \(t-x\) lie in \([0,1]\). Equivalently,

$$ g(t)=\int_{\max(0,t-1)}^{\min(1,t)}1\,dx,\qquad 0<t<2. $$

For \(0<t\le1\), the limits are \(0\) and \(t\), so \(g(t)=t\). For \(1<t<2\), the limits are \(t-1\) and \(1\), so \(g(t)=2-t\). Outside \([0,2]\), the line does not meet the interior of the square and the density is zero. Thus one version of the density is

$$ g(t)= \begin{cases} t,&0<t\le1,\\ 2-t,&1<t<2,\\ 0,&\text{otherwise}. \end{cases} $$

The half-plane integral gives the distribution function. For \(0\le t\le1\), the region \(x+y\le t\) inside the square is a right triangle with legs of length \(t\), hence \(F_S(t)=t^2/2\). For \(1<t\le2\), it is easier to subtract the upper-right triangle, whose legs have length \(2-t\), from the square. Therefore \(F_S(t)=1-(2-t)^2/2\). Including the values outside the support,

$$ F_S(t)= \begin{cases} 0,&t<0,\\ t^2/2,&0\le t\le1,\\ 1-(2-t)^2/2,&1<t\le2,\\ 1,&t>2. \end{cases} $$

For example, at \(t=1\) both formulas give \(1/2\); at \(t=2\) the second gives \(1\). The density also integrates to one: the two triangular areas are \(1/2\) and \(1/2\).

Diagonal Sections and the Density of the Sum

A diagonal section at level \(t\) consists of points \((x,y)\) satisfying \(y=t-x\). Integrating a joint density along this section produces the density of the sum. The precise result is an almost-everywhere statement: density values on a Lebesgue-null set can be changed without changing the probability law.

Theorem: Suppose \((X,Y)\) has a joint density \(f_{X,Y}\) with respect to two-dimensional Lebesgue measure. Then \(S=X+Y\) has a density, and a version of it is $$ g(t)=\int_{\mathbb R} f_{X,Y}(x,t-x)\,dx $$ for Lebesgue-almost every \(t\in\mathbb R\). The integral is allowed to be infinite on a null set; its values there may be assigned arbitrarily when choosing a density version.

Proof. Let \(A\subseteq\mathbb R\) be any Borel set. The probability that \(S\) belongs to \(A\) is

$$ \mathbb P(S\in A) =\int_{\mathbb R^2}\mathbf{1}_A(x+y)f_{X,Y}(x,y)\,dx\,dy. $$

Use the change of variables \(t=x+y\), leaving \(x\) unchanged. The inverse map is \((x,t)\mapsto(x,t-x)\), and its Jacobian determinant has absolute value \(1\). The change-of-variables formula therefore gives

$$ \mathbb P(S\in A) =\int_{\mathbb R}\int_{\mathbb R} \mathbf{1}_A(t)f_{X,Y}(x,t-x)\,dx\,dt. $$

The integrand is nonnegative, so Tonelli's theorem permits exchanging the integrals. The result is

$$ \mathbb P(S\in A) =\int_A\left(\int_{\mathbb R} f_{X,Y}(x,t-x)\,dx\right)dt. $$

This expresses the law of \(S\) as integration against the nonnegative function \(g(t)=\int_{\mathbb R}f_{X,Y}(x,t-x)\,dx\). Taking \(A=\mathbb R\) shows that the integral of \(g\) is one. Thus \(g\) is a density of \(S\), with any infinite values on a null set harmless to the integral. \(\square\)

The formula is sometimes called a convolution formula when the joint density factors into marginal densities. Its validity here does not require that factorization: it follows from the joint density and a change of coordinates. In a calculation, the support of the joint density determines the range of \(x\) that contributes to each diagonal section.

Worked Example: Sum of Two Exponential Variables

Suppose the joint density is \(f_{X,Y}(x,y)=e^{-(x+y)}\) when \(x\ge0\) and \(y\ge0\), and zero otherwise. On the section \(y=t-x\), both coordinates are nonnegative precisely when \(0\le x\le t\), provided \(t\ge0\). Therefore,

$$ g(t)=\int_0^t e^{-(x+t-x)}\,dx =\int_0^t e^{-t}\,dx =t e^{-t},\qquad t\ge0. $$

For \(t<0\), there are no points with nonnegative coordinates whose sum is \(t\), so \(g(t)=0\). The distribution function follows by integrating this density:

$$ F_S(t)= \begin{cases} 0,&t<0,\\ \displaystyle\int_0^t u e^{-u}\,du =1-(1+t)e^{-t},&t\ge0. \end{cases} $$

To check the integral, an antiderivative of \(u e^{-u}\) is \(-(u+1)e^{-u}\). Substitution at \(u=t\) and \(u=0\) gives \(1-(t+1)e^{-t}\). As \(t\) tends to infinity this tends to \(1\), consistent with a probability distribution.

When the Sum Does Not Have a Density

The half-plane formula applies to every joint law, but the diagonal density formula requires a joint density with respect to area. A sum can have atoms even when the half-plane calculation is straightforward. The following finite example makes the distinction explicit.

Worked Example: A Discrete Joint Law

Let the joint law put probability \(0.2\) at \((0,0)\), probability \(0.3\) at \((0,2)\), and probability \(0.5\) at \((1,0)\). These probabilities are nonnegative and sum to one. The corresponding values of \(S=X+Y\) are \(0\), \(2\), and \(1\), respectively. Thus

$$ \mathbb P(S=0)=0.2,\qquad \mathbb P(S=1)=0.5,\qquad \mathbb P(S=2)=0.3. $$

The half-plane \(x+y\le t\) contains none of these points when \(t<0\), only \((0,0)\) when \(0\le t<1\), the points \((0,0)\) and \((1,0)\) when \(1\le t<2\), and all three points when \(t\ge2\). Consequently,

$$ F_S(t)= \begin{cases} 0,&t<0,\\ 0.2,&0\le t<1,\\ 0.7,&1\le t<2,\\ 1,&t\ge2. \end{cases} $$

This distribution has positive mass at three individual values, so it cannot have a density with respect to Lebesgue measure on \(\mathbb R\). In particular, a density formula obtained by integrating a two-dimensional density cannot be applied: this joint law has no such density.

Reading the Geometry Correctly

There are two related but distinct geometric operations. The distribution function accumulates joint probability over a two-dimensional half-plane. The density, when obtained from a joint density, integrates along a one-dimensional diagonal section. Confusing these operations can lead to an incorrect answer: a line has zero area, so integrating a planar density over the line itself does not give the density of the sum. The diagonal-section formula comes instead from changing coordinates and then integrating out the remaining coordinate.

Another common error is to use the diagonal formula without checking the support. In the uniform-square example, the section \(y=t-x\) contributes only over a finite interval of \(x\), and that interval changes at \(t=1\). In the exponential example, the support restricts \(x\) to \([0,t]\). Identifying these limits is part of the calculation, not an optional simplification.

Finally, a joint density guarantees that the sum has a density by the theorem, but the converse need not hold: a joint law without a two-dimensional density can still induce a sum with a density. The general half-plane formula remains the reliable starting point in either case. It records the full distribution, including any jumps or other behavior that a density alone would fail to capture.

Check Your Understanding

Use the half-plane and diagonal-section viewpoints to answer these questions.

  1. For a general joint law \(\mu_{X,Y}\), which subset of \(\mathbb R^2\) has measure \(F_{X+Y}(t)\)?
  2. If a joint density is supported on a region \(D\), how does \(D\) determine the integration limits in the diagonal-section formula?
  3. Why does a joint density imply that the sum has a density, and which change of variables proves it?
  4. In the uniform-square example, why does the formula for the density change at \(t=1\)?
  5. Can the half-plane formula be used when the joint law is discrete? Can the diagonal density formula be used for that same law?
Clinical Biostats