The lottery question
If you play the lottery every week for a year, how much can you expect to lose?
The answer is simple: we just multiply. That's linearity of expectation.
Expected value: a quick review
For a discrete random variable with PMF : It's the probability-weighted average — the "center of mass" of the distribution.
For a fair die:
You can never actually roll a 3.5, but over many rolls, your average will converge to it.
The linearity property
For any random variables and (independent or not!) and constants , :
No independence required. This works even when and are heavily dependent.
Try different distributions and scaling constants:
Why is this surprising?
For most operations, dependence matters. The variance of a sum depends on whether and are correlated. But expectation doesn't care.
Consider: = temperature in New York tomorrow, = number of umbrellas sold tomorrow. They're clearly dependent! Yet:
The formula holds without conditions.
See it in action
Run a simulation: X = coin flip (0/1), Y = fair die roll (1–6). Theory predicts E[X] = 0.5, E[Y] = 3.5, E[X+Y] = 4.0. Watch the averages converge:
Scaling and shifting
Linearity includes two sub-rules:
| Rule | Formula | Example |
|---|---|---|
| Scaling | Double all outcomes → double the mean | |
| Shifting | Add 5 to every outcome → add 5 to the mean | |
| Combined | Converting Celsius to Fahrenheit |
A restaurant tip calculation
Your bill is a random variable with . You tip 20%, so your total is .
A preview: this extends to N variables
Linearity generalizes to any number of random variables:
We'll use this for indicator variable problems in the next lesson.
Summary
| Concept | Key Formula |
|---|---|
| Expected value | |
| Linearity (sum) | |
| Linearity (scaled) | |
| Independence? | Not needed for linearity! |
When you see "expected value of a sum," immediately think linearity. Don't try to find the distribution of the sum — just add the expectations.
Test your understanding
What's next
We'll use linearity with indicator variables, a technique that turns hard counting problems into simple sums.