Why Expectations of Totals and Differences Matter
Many chance questions concern a total or a net amount built from several random quantities. A daily total might combine work completed on several tasks, while a net balance might subtract expenses from income. Even if the component quantities tend to vary together, their expected total or difference can often be found from their separate expected values.
The key point is that dependence between random variables does not prevent expectations from adding or subtracting. Dependence matters for other questions, such as the full probability distribution of a total. This tutorial focuses on the expected value itself.
For finite-valued variables, the required expectations are automatically finite. For variables with infinitely many possible values, a sufficient condition is \(E(|X|)<\infty\) and \(E(|Y|)<\infty\). This condition ensures that the expectations of \(X\), \(Y\), \(X+Y\), and \(X-Y\) are well-defined and finite.
Deriving the Rules From a Joint Probability Table
The joint probability mass function of \(X\) and \(Y\) assigns a probability \(p_{X,Y}(x,y)=P(X=x,Y=y)\) to each possible pair of values. Its probabilities sum to 1. The marginal probability mass function of \(X\) is found by adding the joint probabilities over all possible values of \(Y\); the marginal for \(Y\) is found by adding over possible values of \(X\).
By the definition of expected value, the expectation of a function of two discrete random variables is found by weighting each value of that function by the probability of its corresponding pair. In particular, the value of \(X+Y\) at the pair \((x,y)\) is \(x+y\). Therefore,
The third line follows because summing \(p_{X,Y}(x,y)\) over all \(y\) gives \(P(X=x)\), and summing over all \(x\) gives \(P(Y=y)\). The same reasoning for the value \(x-y\) gives the difference rule:
These calculations use the joint probabilities, but they do not require the joint probability mass function to factor into the product of the marginals. Such a factorization is the condition for independence. The derivation works for any joint distribution for which the expectations exist.
Define \(X\) and \(Y\) as variables from the same probability experiment, and make clear what their units represent.
Finite-valued variables have finite expectations. For infinite supports, ensure the variables have finite absolute expectations.
For a total, use \(E(X+Y)=E(X)+E(Y)\). For a net amount, use \(E(X-Y)=E(X)-E(Y)\).
Find the component expectations, combine them with the correct sign, and state the result in context and in units.
Worked Examples
Worked Example: Adding and Subtracting Dependent Variables
Suppose two discrete variables \(X\) and \(Y\) have the joint probability mass function below. Find \(E(X+Y)\) and \(E(X-Y)\). The entries are hypothetical probabilities.
| \(Y=1\) | \(Y=3\) | |
|---|---|---|
| \(X=0\) | 0.10 | 0.40 |
| \(X=2\) | 0.40 | 0.10 |
The four probabilities sum to \(0.10+0.40+0.40+0.10=1.00\). The marginal probabilities for \(X\) are \(P(X=0)=0.50\) and \(P(X=2)=0.50\). Thus,
The marginal probabilities for \(Y\) are \(P(Y=1)=0.50\) and \(P(Y=3)=0.50\), so
The expectation rules now give
The variables are dependent: for instance, \(P(X=0,Y=1)=0.10\), whereas \(P(X=0)P(Y=1)=(0.50)(0.50)=0.25\). The different joint and product probabilities show that independence does not hold. Nevertheless, the expectation rules apply.
As a check, directly weight the possible sums by their joint probabilities: \(1(0.10)+3(0.40)+3(0.40)+5(0.10)=3.00\). For the difference, the corresponding calculation is \((-1)(0.10)+(-3)(0.40)+(1)(0.40)+(-1)(0.10)=-1.00\). Both direct calculations agree with the results from the marginal expectations.
Worked Example: Expected Net Number of Tickets
Consider a hypothetical event day. Let \(X\) be the number of tickets sold, and let \(Y\) be the number of tickets refunded. Both are measured in tickets, and the net number retained is \(X-Y\). The marginal distributions are given below. Ticket sales and refunds may be related.
| \(x\) | \(P(X=x)\) |
|---|---|
| 0 | 0.20 |
| 1 | 0.50 |
| 2 | 0.30 |
| \(y\) | \(P(Y=y)\) |
|---|---|
| 0 | 0.70 |
| 1 | 0.30 |
First, calculate each expected value from its marginal distribution:
Therefore,
The expected net number retained is 0.80 tickets per event day under this hypothetical model. No joint probabilities were needed. Refunds might tend to occur on days with more sales, but that dependence does not change the expected difference. The expected value is an average over repetitions of the modeled event, not a claim that the net count on any particular day must be 0.80.
Worked Example: Expected Total From Three Dependent Indicators
Three hypothetical sensors each produce an alert or no alert during a monitoring period. Let \(I_1\), \(I_2\), and \(I_3\) equal 1 when the corresponding sensor alerts and 0 otherwise. Suppose their alert probabilities are \(0.20\), \(0.35\), and \(0.50\). The sensors may be dependent. Find the expected total number of alerts, \(T=I_1+I_2+I_3\).
For an indicator variable, its expected value equals its probability of being 1: \(E(I_i)=(1)P(I_i=1)+(0)P(I_i=0)=P(I_i=1)\). Hence \(E(I_1)=0.20\), \(E(I_2)=0.35\), and \(E(I_3)=0.50\). Applying the sum rule twice,
Thus, the expected total is 1.05 alerts per monitoring period. This calculation does not determine the probabilities of getting 0, 1, 2, or 3 alerts. Those probabilities depend on how the sensors’ outcomes occur together; the expected total does not require that information.
What the Rules Do—and Do Not—Tell You
The rules are useful when the component variables are easier to summarize than their combined variable. If \(X\) and \(Y\) have known marginal distributions, their expectations can be calculated separately and then added or subtracted. A joint probability table is not needed for this purpose, even though it would be needed to describe how pairs of outcomes occur together.
The expected value is a single summary of a random variable’s probability-weighted average. Knowing \(E(X+Y)\) does not reveal the possible values of \(X+Y\), their probabilities, or how much the total varies. In particular, do not confuse finding the expectation of a sum with finding its full distribution.
Units also provide a useful check. If \(X\) and \(Y\) are both amounts of money, then \(X-Y\) is a meaningful net amount in money. If they measure different things, such as distance and time, the numerical subtraction may not represent a meaningful quantity even though a formal difference of random variables can be defined mathematically. The context must support the operation.
Common Mistake
Wrong reasoning: “The two variables might be dependent, so I cannot add their expected values.” This confuses the expectation rule with rules for other features of a sum. Dependence does not invalidate the equality \(E(X+Y)=E(X)+E(Y)\); the joint-probability derivation shows that the equality holds for any dependence structure when the expectations exist.
Correction: For an expected sum or difference, calculate the component expectations and combine them with the appropriate sign. Do not assume independence, and do not infer the distribution or variability of the combined variable from its expectation alone.
Check Your Understanding
Use the definitions and rules in this tutorial to answer the following questions.
- In one sentence, state the condition on independence for the sum and difference expectation rules to hold.
- Suppose \(E(X)=4.2\) units and \(E(Y)=1.7\) units. Find \(E(X+Y)\) and \(E(X-Y)\), and give the units.
- Why does a joint probability table allow the sum rule to be derived even when \(X\) and \(Y\) are dependent?
- Three indicators have probabilities of equaling 1 of \(0.10\), \(0.40\), and \(0.60\). Find the expected sum of the indicators. Is independence needed?
- Does knowing \(E(X+Y)\) determine the probability distribution of \(X+Y\)? Explain briefly.