Skip to main content
AMC 12 only

Expected Value & Linearity

Linearity of expectation is the single most powerful shortcut in this entire curriculum — it works even when the underlying events aren't independent.

Expected value

The expected value of a random quantity XX is its probability-weighted average:

E[X]=ixiP(X=xi)E[X] = \sum_i x_i \, P(X=x_i)

Linearity of expectation

The expected value of a sum is always the sum of the expected values:

E[X+Y]=E[X]+E[Y]E[X+Y] = E[X] + E[Y]

The remarkable thing about this identity is that it holds even when XX and YYare 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 IAI_A equals 11 if event AA occurs and00 otherwise. Its expected value is simply the probability of the event:

E[IA]=P(A)E[I_A] = P(A)

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 1,2,,51, 2, \ldots, 5 is chosen. Find the expected number of values that land in their original position (a “fixed point”).

Solution: Let IkI_k be the indicator that value kk lands in position kk. For each kk, P(Ik=1)=15P(I_k=1) = \tfrac15 (by symmetry, each position is equally likely to hold value kk). The total number of fixed points isX=I1+I2+I3+I4+I5X = I_1+I_2+I_3+I_4+I_5, so by linearity:

E[X]=E[I1]++E[I5]=5×15=1E[X] = E[I_1]+\cdots+E[I_5] = 5 \times \dfrac15 = 1

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 P(heads)=0.3P(\text{heads})=0.3 is flipped 20 times. Find the expected number of heads.