The Linearilty Property
Expectation preserves linearity. For any random variables X and Y, and constants a and b:
E[aX+b]=aE[X]+b
E[X+Y]=E[X]+E[Y]
E[aX+bY]=aE[X]+bE[Y]
Crucially: X and Y need NOT be independent. Linearity holds regardless of dependence.
Proof for Constants
E[aX+b]=∑x(ax+b)p(x)=a∑xxp(x)+b∑xp(x)=aE[X]+b⋅1=aE[X]+b
Proof for Sum of Two Variables
For discrete X and Y:
E[X+Y]=∑x∑y(x+y)p(x,y)=∑x∑yxp(x,y)+∑x∑yyp(x,y)
=∑xx∑yp(x,y)+∑yy∑xp(x,y)=∑xxpX(x)+∑yypY(y)=E[X]+E[Y]
Why This Matters
Linearity is perhaps the most useful property of expectation. Many problems that would otherwise be intractable become straightforward.
Roll a fair die. Let Y=3X+1.
We could compute E[Y] directly: values are {4,7,10,13,16,19} with equal probability, giving E[Y]=64+7+10+13+16+19=669=11.5.
But using linearity:
E[Y]=E[3X+1]=3E[X]+1=3(3.5)+1=11.5
Indicator Trick
Many problems become easy by expressing the quantity of interest as a sum of indicators.
Example: Matching Problem
n people throw hats into a pile, then each picks one randomly. Expected number who get their own hat?
Let Ii = indicator that person i gets their own hat. Then:
X=∑i=1nIi
is the number of matches.
E[Ii]=P(person i gets own hat)=n1
By linearity:
E[X]=∑i=1nE[Ii]=n⋅n1=1
Regardless of n, the expected number of matches is 1.
Example: Expected Number of Aces
Draw 5 cards from a standard deck. Expected number of aces?
Let Ii = indicator that card i is an ace.
E[Ii]=P(card i is ace)=524=131
E[number of aces]=∑i=15E[Ii]=5⋅131=135
Example: Email Spam
100 emails, each independently has probability 0.4 of being spam. Expected number of spam emails?
Let Ii indicate email i is spam.
E[Ii]=0.4
E[spam count]=100×0.4=40
Linearity Extends to n Variables
By induction:
E[∑i=1nXi]=∑i=1nE[Xi]
Regardless of dependence among the Xi.
Caution: Products and Functions
Linearity does NOT extend to products:
E[XY]=E[X]E[Y] in general
Equality holds if X and Y are independent.
Linearity does NOT extend to arbitrary functions:
E[g(X)]=g(E[X]) in general
Counterexample: E[X2]=E[X]2 for a die roll.
Application: Sums of Identical Distributions
If X1,X2,…,Xn are i.i.d. with mean μ:
E[X1+X2+⋯+Xn]=nμ
This is the foundation of the Law of Large Numbers.
Probabilistic Method
Linearity enables the probabilistic method: to prove existence of an object with property P, show E[X]>0 for some non-negative random variable X, where X>0 implies property P. Then there must exist some outcome with X>0.
Summary
| Property | Formula |
|---|
| Scaling and shift | E[aX+b]=aE[X]+b |
| Additivity | E[X+Y]=E[X]+E[Y] |
| General | E[∑iXi]=∑iE[Xi] |
| No independence needed | Holds for dependent variables |