Random variables · Definition
Expected value
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.
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
- \(X\) takes the values 0, 1 and 2 with probabilities 0.2, 0.5 and 0.3. Compute \(E[X]\).
- A fair die is rolled and \(X\) is the number shown. What is \(E[X]\)?
- \(X\) has density \(f(x)=2x\) on \([0,1]\) and 0 elsewhere. Compute \(E[X]\).
- In a game you win 10 pesos with probability 0.2 and lose 2 with probability 0.8. What is the expected gain, in pesos?
- If \(E[X]=3\), what is \(E[2X+5]\)?
- With \(f(x)=2x\) on \([0,1]\), compute \(E[X^2]\).
- Which statement about \(E[X]\) is correct?
- \(X\) equals \(-1\), 0 or 1 with probabilities \(\tfrac14,\tfrac12,\tfrac14\). Compute \(E[X^2]\).
- Two fair dice are rolled and \(S\) is the sum. Using linearity, what is \(E[S]\)?
- \(X\) has density \(f(x)=\dfrac{1}{\pi(1+x^2)}\) on all of \(\mathbb{R}\). What happens with \(E[X]\)?
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