Independence is not needed
E[X + Y] = E[X] + E[Y] holds for any two random variables on the same space, however entangled.
The most useful fact in elementary probability. It needs no independence, which lets a complicated count be decomposed into indicators and summed term by term.
Core ideas
Linearity is what makes hard expectations easy: split the variable into simple pieces and add.
E[X + Y] = E[X] + E[Y] holds for any two random variables on the same space, however entangled.
Write a count as a sum of indicators, one per thing being counted. Each indicator's expectation is a probability.
E[XY] = E[X]E[Y] requires independence. Confusing the two rules is the one real trap here.
The material
The theorem, why independence is irrelevant, and four applications.
For random variables X, Y on the same sample space and constants a, b: E[aX + bY] = aE[X] + bE[Y]. No independence assumption is needed.
Summing over outcomes, E[aX + bY] = Σ_s (aX(s) + bY(s))P(s) = a Σ_s X(s)P(s) + b Σ_s Y(s)P(s) = aE[X] + bE[Y].
Nothing about the joint behaviour of X and Y entered, which is exactly why independence is not required.
□
The proof is three lines and the consequence is enormous. E[XY] by contrast genuinely depends on the joint distribution, and the two facts are worth keeping apart deliberately.
E[I_A] = 1 · P(A) + 0 · P(Ā) = P(A).
So if X counts how many of the events A₁, …, A_n occur, then X = I_{A₁} + ⋯ + I_{A_n} and E[X] = Σ P(Aᵢ). The events may overlap, depend on each other, or be governed by anything at all.
X = Σ Iᵢ where Iᵢ indicates heads on flip i. Each has expectation p, so E[X] = np — without computing the binomial distribution (“Bernoulli Trials and the Binomial Distribution”) at all.
X counts the elements left in place. X = Σ Iᵢ where Iᵢ indicates that i is fixed, and P(Iᵢ = 1) = 1/n. So E[X] = n · (1/n) = 1, for every n. The indicators are dependent — knowing n − 1 elements are fixed forces the last — and linearity does not care.
That result is worth pausing on. On average exactly one person gets their own hat back, whether there are 5 people or 5 million. Computing it from the derangement distribution of Combinatorics and Counting would be considerably harder.
There are n distinct coupons, one per box at random. How many boxes to collect them all? Let Xᵢ be the number of boxes bought while holding exactly i − 1 distinct coupons. Then E[Xᵢ] = n/(n − i + 1) (“The Geometric Distribution and Waiting Times” supplies that), so E[total] = n(1 + 1/2 + ⋯ + 1/n) ≈ n ln n. For n = 50 that is about 225 boxes.
Two shuffled decks are dealt face up side by side. The expected number of positions where the cards match is 52 · (1/52) = 1. Same computation as the hat problem, and again the indicators are dependent.
If X and Y are independent then E[XY] = E[X]E[Y]. Without independence this fails: take Y = X with X a fair coin scored 0 or 1, so E[X] = 1/2 and E[XY] = E[X²] = 1/2 ≠ 1/4.
Interactive
Definition first, formula second
Method
Decompose, then add.
Usually one indicator per item, position or event being counted.
For an indicator this is a single probability, and symmetry often makes all the pieces identical.
Linearity holds regardless. This is the step that saves the work.
E[XY] needs independence. If the quantity is a product, this technique does not apply.
Two shuffled decks of n cards, dealt side by side. How many positions match?
The answer is 1 for every n, which connects directly to derangements: the distribution of the number of matches converges to a Poisson distribution with mean 1, and P(no match) → 1/e is exactly the derangement limit.
Compute the expected number of runs of consecutive heads in n fair flips, using one indicator per position for "a run starts here". The answer is (n + 1)/4. Adjacent indicators are dependent — a run cannot start at two consecutive positions — and linearity does not care.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.