Random variables · Definition

Expected value

probabilityrandom variables

Before you start you need to know

It condenses the center of a random variable into one number, the value around which its outcomes settle in the long run.

Definition

The expectation \(E[X]\) of a random variable \(X\) is the average of its possible values, each weighted by its probability.

\[\begin{aligned}E[X]&=\sum_x x\,p(x)\\ E[X]&=\int_{-\infty}^{\infty}x\,f(x)\,dx\end{aligned}\]

The idea is a weighted average: each value counts as much as it is likely. For a discrete variable you add \(\sum_x x\,p(x)\); for a continuous one the sum becomes an integral, \(\int x f(x)\,dx\). For a fair die, \(E[X]=\tfrac16(1+\cdots+6)=3.5\), a value the die never shows: the expectation need not be a possible outcome.

Its empirical meaning is the law of large numbers: if you repeat the experiment many times, the average of the results approaches \(E[X]\). That is why it is the fair price of a game: if you win 10 with probability 0.2 and lose 2 with probability 0.8, the expected gain is \(10(0.2)-2(0.8)=0.4\).

Two properties make it very useful. It is linear: \(E[aX+b]=aE[X]+b\) and \(E[X+Y]=E[X]+E[Y]\), even when \(X\) and \(Y\) depend on each other. And for a function of \(X\) you do not need its distribution: \(E[g(X)]=\sum g(x)p(x)\) or \(\int g(x)f(x)\,dx\). Beware: in general \(E[X^2]\neq(E[X])^2\).

The expectation exists only if the sum or integral converges absolutely. The Cauchy density, \(\tfrac{1}{\pi(1+x^2)}\), is symmetric and still has no expectation. What comes next, the variance, measures how far values stray from this center.

Think about it

A game pays 3 pesos with probability \(\tfrac13\) and nothing otherwise. What is a fair price to play?

The expected gain is \(3\cdot\tfrac13=1\) peso; that is the fair price.

Why does \(E[X+Y]=E[X]+E[Y]\) not require independence?

Because it only uses linearity of the sum and the integral, not how \(X\) and \(Y\) are related.

Exercises 10

References

  • Joseph K. Blitzstein, Jessica Hwang, Introduction to Probability, 2nd edition, CRC Press, 2019. §4.1
  • Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. §4.3
  • Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying Ye, Probabilidad y estadística para ingeniería y ciencias, 9.ª edición, Pearson, 2012. §4.1