Expectation is a simple measure to calculate the
average value taken by a random variable.
Suppose the outcome of an experiment is the random variable . If the experiment is repeated, we observe outcomes . The mean observed value of is
Let be the number of times that is observed in the experiments. Then
We motivated probability with the notion (as yet unproved) that
as . If this holds then
This motivates the following definition:
The expected value or expectation of a discrete random variable is
An equivalent expression of the expectation that can be useful if the pmf of a random variable is not known is the following:
The equivalence between these two expressions can be shown using the way the pmf is defined, and is left as an exercise.
Recall the gambling exercise above, where the random variable , profit, is defined by
from the throw of a fair die. The induced sample space for is . The pmf of is , , . Find the expected profit, using both definitions above.
Using the first definition:
Using the second definition:
Both give the same result of
Find the expected number of heads in tosses of a fair coin.
Note , which may seem surprising. The expected value of a random variable is not the value that you expect to obtain.
A similar calculation gives the expected number of tails is . This accords with intuition: we expect on average the same number of heads and tails for a fair coin.
Find the expected value of the score on a die.
From equi-probability . Let represent the score, so that
Suppose is an event. The indicator function of is the function such that if , and otherwise. Since is a real-valued function on , it is a random variable. What is its expected value?
First find the pmf of .
Therefore
If is any real valued function, then is a function from , so is also a random variable. We can therefore work out its expected value:
Using the second definition of expectation:
where the last line follows from the definition of a pmf.
We have proved the following:
The expected value of a function of a discrete random variable is
If for , find .
The function here is So
Find if and .
Expectation obeys two important rules of linearity. For arbitrary functions and , and constant :
A special case is that .
These results can be verified using the definition of the expectation of a function. We show how to obtain the first identity; the others are obtained similarly.
Find if it is known that and .
Therefore