Expected value
The expected value of a random quantity is its probability-weighted average:
Linearity of expectation
The expected value of a sum is always the sum of the expected values:
The remarkable thing about this identity is that it holds even when and are dependent — unlike many probability identities, there's no independence requirement at all. This makes it enormously useful for problems that would otherwise require a nightmare of casework.
Indicator variables
An indicator variable equals if event occurs and otherwise. Its expected value is simply the probability of the event:
Combining indicators with linearity is the standard playbook: write the quantity you care about as a sum of indicator variables (one per “could this happen” sub-event), then just add up their individual probabilities — no need to track how the sub-events interact with each other at all.
Worked example
Problem: A random permutation of is chosen. Find the expected number of values that land in their original position (a “fixed point”).
Solution: Let be the indicator that value lands in position . For each , (by symmetry, each position is equally likely to hold value ). The total number of fixed points is, so by linearity:
Notice this didn't require figuring out how likely it is to have exactly 0, 1, 2, or more fixed points — a computation that would otherwise involve derangements and heavy casework.
Practice problems
1.A fair six-sided die is rolled. Find its expected value.
2.Two fair dice are rolled. Using linearity, find the expected value of their sum.
3.10 people randomly select hats from a pile of their own 10 hats. Find the expected number of people who get their own hat back.
4.A coin with is flipped 20 times. Find the expected number of heads.