We start by playing a game in which a counter is 6 moved forward one, two or four places according to whether the scores on the two dice rolled differ by three or more, by one or two, or are equal. Here is a random variable, M, the number of places moved, which can take the values 1, 2 or 4.
Play the game at least 20 times and evaluate from the 2 games the average (mean) number of moves per game.
Now we consider the problem theoretically.
The probabilities of each of these values occurring can be calculated from the diagram opposite. Check for yourself that the probabilities are in fact,
P(M = 1) = =
P(M = 2) = =
P(M = 4) = =
In the long run you would expect to move one square of the times, two squares on of the goes and four squares on . So if you play the game 36 times you will expect to average a total of
| 1 × 12 + 2 × 18 + 4 × 6 | = 12 + 36 + 24 |
| = 72 moves |
If you divide by 36 to get the mean number of moves per game the equation becomes
=
which you can write as
1 × + 2 × + 4 × = 2
So
mean = 1 × P(M = 1) + 2 × P(M = 2) + 4 × P(M = 4) = 2
Using the summation symbol, ∑ , the last equation can then be shortened to
mean = \sum_{\text{all } m}^{\ } m × P(M = m)
where m = 1, 2, 4 are the possible values taken by M.
The quantity 2 is the mean or expectation or expected value of the random variable M, written E(M) , in the example above.
In general, for a discrete random variable X, which can take specific values of x, the expected value (mean) of the random variable is defined by
where the summation over 'all x' means all values of x for which the random variable X has a non-zero probability.
Worked Examples
When throwing a normal die, let X be the random variable defined by
X = the square of the score shown on the die.
What is the expectation of X?
The possible values of X are
| 1, | 22, | 32, | 42, | 52 | and 62 | |
| ⇒ | 1, | 4, | 9, | 16, | 25 | and 36 |
Each one has a probability of of occurring, so
| E(X) | = 1 × + 4 × + 9 × + 16 × + 25 × + 36 × |
| = × 91 | |
| = 15 |
Finally in this section, an alternative definition of a random variable will be developed.
In the previous example, we can find the value of \sum_{\text{all }x}^{\ } P(X = x).
| \sum_{\text{all }x}^{\ } P(X = x) | = P(X = 1) + P(x = 4) + P(X = 9) + P(X = 16) + P(X = 25) + P(X = 36) |
| = + + + + + | |
| = 1 |
If the summation is over all possible values of x, the summation must add up to one.
So an alternative way of defining a discrete random variable is to impose the
condition
