Tutorials › VEE Mathematical Statistics › Deriving Linearity of Expectation

VEE Mathematical Statistics · Expectation and Variability · Tutorial 63 of 880

Deriving Linearity of Expectation

Learn why expectations add, how to derive the rule in discrete and continuous settings, and when a joint distribution is needed.

Beginner 10 min read

What You'll Learn

  • Derive linearity of expectation by expanding discrete sums and continuous integrals.
  • State the integrability conditions needed for the rule.
  • Calculate the expectation of a sum from component expectations without assuming independence.
  • Use a joint distribution to calculate the expectation of a sum directly.
  • Recognize why linearity does not imply that the distribution of a sum is determined by its marginals.

Why Expectations Add

Many quantities of interest are totals: a combined claim amount, the total weight of several components, or the sum of measurements from multiple sources. To find the expected total, it is useful to know whether the expectation of a sum can be computed from the expectations of its parts. The answer is yes, subject to the existence of those expectations, and independence is not required.

This rule is called linearity of expectation. It is a basic calculation principle aligned with the SOA VEE Mathematical Statistics syllabus. It applies to discrete and continuous random variables, and it remains valid when the variables are dependent.

Definition: If \(X\) and \(Y\) have finite expectations, then \[ E[X+Y]=E[X]+E[Y]. \] More generally, if \(X_1,\ldots,X_n\) have finite expectations and \(c_1,\ldots,c_n\) are fixed real numbers, then \[ E\left[\sum_{j=1}^{n}c_jX_j\right]=\sum_{j=1}^{n}c_jE[X_j]. \] No independence assumption is needed. For a discrete variable, finite expectation means the corresponding expected absolute value is finite; for a continuous variable, it means the integral of the absolute value against its density is finite.

The condition on expectations matters: the rule is stated here for variables whose expectations are defined as finite values. In the finite-support examples below, this condition is automatically satisfied. In a continuous model, the relevant integrals must exist and be finite.

Derivation for Discrete Random Variables

Suppose \(X\) and \(Y\) are discrete random variables with a joint probability mass function \(p_{X,Y}(x,y)=P(X=x,Y=y)\). Assume their expected absolute values are finite. The expectation of a function of a discrete pair is found by weighting each function value by its joint probability. Applying that definition to the sum gives

$$ E[X+Y] =\sum_x\sum_y (x+y)p_{X,Y}(x,y). $$

Because \(x+y\) is the sum of two terms, distribute it across the summation:

$$ \begin{aligned} E[X+Y] &=\sum_x\sum_y xp_{X,Y}(x,y) +\sum_x\sum_y yp_{X,Y}(x,y)\\ &=\sum_x x\left(\sum_y p_{X,Y}(x,y)\right) +\sum_y y\left(\sum_x p_{X,Y}(x,y)\right)\\ &=\sum_x xP(X=x)+\sum_y yP(Y=y)\\ &=E[X]+E[Y]. \end{aligned} $$

The expressions in parentheses are the marginal probabilities of \(X\) and \(Y\). The proof only uses the joint probabilities summing to their marginals; it does not factor the joint probabilities into products. That factorization would require independence, and it is not needed for this result.

Worked Example: Adding Expectations from Discrete Marginals

A hypothetical package contains two components with weights \(A\) and \(B\), measured in grams. The marginal distributions are \(P(A=2)=0.4000\), \(P(A=7)=0.6000\), \(P(B=1)=0.2500\), and \(P(B=5)=0.7500\). The dependence between the component weights is unspecified. Find the expected total weight.

Method. Use linearity with the two marginal expectations. The marginal distributions are enough to find the expectation of the sum; the joint distribution and any independence assumption are unnecessary.

First calculate the expectation of \(A\):

$$ E[A]=2(0.4000)+7(0.6000)=0.8000+4.2000=5.0000\text{ grams}. $$

Next calculate the expectation of \(B\):

$$ E[B]=1(0.2500)+5(0.7500)=0.2500+3.7500=4.0000\text{ grams}. $$

Therefore,

$$ E[A+B]=E[A]+E[B]=5.0000+4.0000=9.0000\text{ grams}. $$

The answer is \(9\) grams. As a check, the expected total is the sum of the two component means. The dependence could change the probabilities of particular total weights, but it cannot change this expected total when the marginals are fixed.

Derivation for Continuous Random Variables

For continuous random variables with joint density \(f_{X,Y}(x,y)\), assume \(E[|X|]\) and \(E[|Y|]\) are finite. The expectation of the sum is the double integral of \(x+y\) against the joint density. Splitting the integrand and using the marginal densities gives

$$ \begin{aligned} E[X+Y] &=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} (x+y)f_{X,Y}(x,y)\,dy\,dx\\ &=\int_{-\infty}^{\infty}x f_X(x)\,dx +\int_{-\infty}^{\infty}y f_Y(y)\,dy\\ &=E[X]+E[Y]. \end{aligned} $$

Here \(f_X(x)=\int_{-\infty}^{\infty}f_{X,Y}(x,y)\,dy\) and \(f_Y(y)=\int_{-\infty}^{\infty}f_{X,Y}(x,y)\,dx\). The finite-absolute-expectation condition justifies splitting and rearranging the integrals. As in the discrete derivation, no independence condition appears.

Worked Example: A Dependent Continuous Pair

Let \(X\) and \(Y\) have joint density \(f_{X,Y}(x,y)=2\) when \(0<y<x<1\), and \(f_{X,Y}(x,y)=0\) elsewhere. Find \(E[X+Y]\) directly from the joint density, then check the result using the marginal expectations.

Method. The support is triangular, so integrate over \(0<x<1\) and \(0<y<x\). First verify that the stated function is a probability density:

$$ \int_0^1\int_0^x 2\,dy\,dx =\int_0^1 2x\,dx =\left[x^2\right]_0^1=1. $$

Now calculate the expectation of the sum:

$$ \begin{aligned} E[X+Y] &=\int_0^1\int_0^x (x+y)2\,dy\,dx\\ &=\int_0^1 2\left(xy+\frac{y^2}{2}\right)\bigg|_{y=0}^{y=x}\,dx\\ &=\int_0^1 2\left(x^2+\frac{x^2}{2}\right)\,dx\\ &=\int_0^1 3x^2\,dx =\left[x^3\right]_0^1=1. \end{aligned} $$

For a check, the marginal density of \(X\) is \(f_X(x)=\int_0^x2\,dy=2x\) for \(0<x<1\). Thus

$$ E[X]=\int_0^1 x(2x)\,dx=2\int_0^1x^2\,dx=\frac{2}{3}. $$

The marginal density of \(Y\) is \(f_Y(y)=\int_y^1 2\,dx=2(1-y)\) for \(0<y<1\). Therefore,

$$ E[Y]=\int_0^1 y\,2(1-y)\,dy =2\left(\frac{1}{2}-\frac{1}{3}\right) =\frac{1}{3}. $$

The marginal check gives \(E[X]+E[Y]=\frac{2}{3}+\frac{1}{3}=1\), matching the direct joint-density calculation. The variables are dependent: their support restricts \(Y\) to values below \(X\). The agreement illustrates that dependence does not invalidate linearity.

Using a Joint Distribution for a Discrete Sum

A joint distribution is useful when the problem asks for the distribution of the sum itself, or when it asks for a direct expectation calculation from joint outcomes. For the expectation alone, either sum the joint values or find the two marginal expectations and add them. These methods must agree.

Worked Example: Checking a Sum Against a Joint Probability Table

A discrete pair \((X,Y)\) has joint probabilities \(P(X=0,Y=2)=0.3000\), \(P(X=0,Y=4)=0.2000\), \(P(X=3,Y=2)=0.1000\), and \(P(X=3,Y=4)=0.4000\). Find \(E[X+Y]\) directly and verify it using the marginals.

Method. First check that the joint probabilities sum to one:

$$ 0.3000+0.2000+0.1000+0.4000=1.0000. $$

The four possible sums are \(2\), \(4\), \(5\), and \(7\), respectively. Weight each sum by its joint probability:

$$ \begin{aligned} E[X+Y] &=2(0.3000)+4(0.2000)+5(0.1000)+7(0.4000)\\ &=0.6000+0.8000+0.5000+2.8000\\ &=4.7000. \end{aligned} $$

For the marginal check, \(P(X=0)=0.3000+0.2000=0.5000\) and \(P(X=3)=0.1000+0.4000=0.5000\), so

$$ E[X]=0(0.5000)+3(0.5000)=1.5000. $$

Also, \(P(Y=2)=0.3000+0.1000=0.4000\) and \(P(Y=4)=0.2000+0.4000=0.6000\), giving

$$ E[Y]=2(0.4000)+4(0.6000)=0.8000+2.4000=3.2000. $$

Thus \(E[X]+E[Y]=1.5000+3.2000=4.7000\), in agreement with the direct calculation. This agreement is also an arithmetic check on the joint-table calculation.

What Linearity Does—and Does Not—Tell You

Linearity answers a question about the mean of a sum. It does not say that the distribution of \(X+Y\) can be determined from the two marginal distributions alone. The dependence between the variables can affect which pairs of values occur together and therefore can affect the probabilities of particular totals. To find those probabilities in general, the joint distribution is needed.

This distinction is especially useful in actuarial applications. For example, the expected combined amount from two hypothetical sources can be found by adding their expected amounts even if the amounts are dependent. But estimating the chance that the combined amount exceeds a threshold generally requires more information about their joint behavior.

Theorem: If \(X_1,\ldots,X_n\) have finite expectations, then the expectation of their sum is the sum of their expectations: \[ E[X_1+\cdots+X_n]=E[X_1]+\cdots+E[X_n]. \] More generally, fixed coefficients can be included term by term. Independence is not a condition for either statement.

Common Mistakes and Exam Traps

  • Assuming independence is required. It is not. Linearity follows by splitting the sum or integral for the expectation. Independence is relevant to other questions about joint behavior, not to this identity.
  • Multiplying expectations instead of adding them. For the joint-table example, \(E[X]E[Y]=1.5000(3.2000)=4.8000\), which is not \(E[X+Y]\). The correct calculation is \(1.5000+3.2000=4.7000\).
  • Using a marginal probability as though it were a joint probability. To calculate \(E[X+Y]\) directly from a joint table, each sum must be weighted by the probability of its \((X,Y)\) pair. The sum of the table entries should be checked first.
  • Thinking the marginals determine every property of the sum. Marginal expectations determine \(E[X+Y]\), but not generally the distribution of \(X+Y\). A direct probability calculation for a threshold event may need the joint distribution.
  • Ignoring whether expectations exist. The finite-expectation condition is part of the result as stated here. In continuous problems, check that the relevant absolute integrals are finite before rearranging them.

A reliable exam approach is to identify whether the question asks for an expectation or for a probability or distribution of a sum. For an expectation, calculate each component mean and add. For a distributional question, examine the information about how the variables occur together and use the joint model when required.

Check Your Understanding

For each problem, identify whether marginal information is enough for the requested expectation, and use the appropriate calculation.

  1. A hypothetical two-part device has component measurements \(A=-1\) with probability \(0.2500\) and \(A=2\) with probability \(0.7500\); \(B=0\) with probability \(0.6000\) and \(B=4\) with probability \(0.4000\). Their dependence is unspecified. Find the expected total \(A+B\). (Answer: \(2.8500\))
  2. A discrete pair has joint probabilities \(P(X=1,Y=0)=0.1000\), \(P(X=1,Y=2)=0.3000\), \(P(X=3,Y=0)=0.2000\), and \(P(X=3,Y=2)=0.4000\). Find \(E[X+Y]\) directly and check by adding the marginal expectations. (Answer: \(3.6000\))
  3. Let \(X\) have the uniform distribution on \((-1,1)\), and let \(Y\) have the uniform distribution on \((0,2)\). Their dependence is unspecified. Find \(E[X+Y]\). (Answer: \(1\))
  4. A pair has joint density \(f_{X,Y}(x,y)=2\) for \(0<y<x<1\), and zero elsewhere. Verify the density is normalized and calculate \(E[X+Y]\). (Answer: The density integrates to \(1\), and \(E[X+Y]=1\))
  5. For the joint table in Question 2, a candidate calculates \(E[X]E[Y]\) to find \(E[X+Y]\). State the value of that product and give the correct expected sum. (Answer: \(E[X]E[Y]=2.2(1.4)=3.0800\); the correct expected sum is \(3.6000\))
Clinical Biostats