Statistics · Unit 2 · Week 5 · Lesson 16 · 12 minute reading

The Long-Run Average Is Not a Promise

Expected value, variance, linear transformations, and why risk needs a spread.

By the end of this lesson, you should be able to

  • Calculate the expectation of a discrete random variable.
  • Compute variance and standard deviation from a distribution.
  • Distinguish variability from the expected value.

You are offered a game. With probability one-half you win 10 dollars; otherwise you lose 8 dollars. Would you play?

The average outcome over many plays is positive. But that does not mean you’ll win one dollar on your next attempt.

Expected value is probability-weighted

For discrete outcomes xix_i with probabilities pip_i,

E[X]=∑ixipi.E[X]=\sum_i x_i p_i.

For this game,

E[X]=10(.5)+(−8)(.5)=1.E[X]=10(.5)+(-8)(.5)=1.

The expected gain is one dollar per play. In a single play the gain is either 10 dollars or a loss of 8 dollars; the expected value is not even a possible outcome.

Variance describes the spread

Expectation alone tells us little about risk. A game that always pays one dollar and a game that pays 1,001 dollars or loses 999 dollars with equal probabilities both have expectation one dollar. Their variability is rather different.

The population variance of a discrete random variable is

Var⁡(X)=E[(X−E[X])2]=∑ipi(xi−μ)2.\operatorname{Var}(X)=E[(X-E[X])^2] =\sum_i p_i(x_i-\mu)^2.

For the first game with mean 11, deviations are 99 and −9-9. Variance is 8181 and standard deviation is 99.

A useful computational shortcut is Var⁡(X)=E[X2]−E[X]2\operatorname{Var}(X)=E[X^2]-E[X]^2.

Units and linear transformations

For constants aa and bb,

E[a+bX]=a+bE[X],Var⁡(a+bX)=b2Var⁡(X).E[a+bX]=a+bE[X],\quad \operatorname{Var}(a+bX)=b^2\operatorname{Var}(X).

Adding ten dollars changes the mean by ten but leaves the spread unchanged. Multiplying dollar amounts by two doubles the standard deviation and quadruples the variance.

If XX and YY are independent, the variance of their sum is the sum of their variances. Without independence, a covariance term is required. Don’t silently assume independence because it makes a formula convenient.

A binomial connection

For X∼Binomial(n,p)X\sim\mathrm{Binomial}(n,p), expectation is npnp and variance is np(1−p)np(1-p), derived from a sum of independent Bernoulli indicators.

Check yourself

  1. If XX equals 0 with probability .75 and 8 with probability .25, find E[X]E[X].
  2. Find the variance and standard deviation of that variable.
  3. If all values are multiplied by three, what happens to the variance?
Worked responses
  1. E[X]=2E[X]=2.

  2. Variance is .75(0−2)2+.25(8−2)2=12.75(0-2)^2+.25(8-2)^2=12, so the standard deviation is 12≈3.464\sqrt{12}\approx3.464.

  3. It is multiplied by 32=93^2=9.

Derive the variance identities

Expanding the centered square gives E[(X−μ)2]=E[X2]−2μE[X]+μ2=E[X2]−μ2E[(X-\mu)^2]=E[X^2]-2\mu E[X]+\mu^2=E[X^2]-\mu^2, assuming the second moment is finite. This identity is algebraically convenient, but direct subtraction of two nearly equal large values can lose floating-point accuracy. Computing centered deviations is often numerically safer.

Linearity of expectation does not require independence: E[X+Y]=E[X]+E[Y]E[X+Y]=E[X]+E[Y] whenever the expectations are defined appropriately. Variance does require attention to dependence:

Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y).\operatorname{Var}(X+Y)=\operatorname{Var}(X)+\operatorname{Var}(Y)+2\operatorname{Cov}(X,Y).

For a difference the covariance term has a minus sign. If Y=XY=X, the sum is 2X2X and its variance is 4Var⁡(X)4\operatorname{Var}(X), not twice the variance. Independence is sufficient for zero covariance when moments exist, but zero covariance need not imply independence. For example, a symmetric variable XX and Y=X2Y=X^2 can have zero covariance despite a deterministic relationship.

A Bernoulli indicator II equals one for success and zero otherwise. Since I2=II^2=I, E[I]=pE[I]=p and Var⁡(I)=p−p2\operatorname{Var}(I)=p-p^2. A binomial count is the sum of nn independent indicators with the same success probability, giving mean npnp and variance np(1−p)np(1-p). For the sample proportion X/nX/n, the variance is p(1−p)/np(1-p)/n. This derivation explains the square-root sample-size denominator in proportion standard errors.

Further problems and solutions

  1. If E[X]=3E[X]=3 and Var⁡(X)=4\operatorname{Var}(X)=4, find the mean and variance of 10−2X10-2X.
  2. If X,YX,Y each have variance 4 and covariance 3, find the variance of their difference.
  3. Why can expected profit alone be insufficient for comparing two investments or games?
Worked further solutions
  1. Mean 44; variance (−2)2(4)=16(-2)^2(4)=16; standard deviation 44.
  2. 4+4−2(3)=24+4-2(3)=2.
  3. Equal means can accompany different tail risks, loss probabilities, and variances. The full distribution and the decision maker’s constraints matter; expectation is one summary.
Your study progress · Optional

Keep your place

Mark this lesson complete after you've read it, attempted its exercises, and explained its central idea in your own words.

Progress is not saved unless you choose to mark the lesson complete.

Saved only in this browser's local storage. No required account, server transmission, or analytics. You can reset your saved progress on the course page. Clearing browser data also clears the record.