In the
Example 3.3.6, we used
Definition 3.3.1 to compute the expected value
\(\mathbb{E}(X)\) of the random variable
\(X\) that was defined to be the sum of the results when rolling two fair and independent dice. This was a painful way to compute
\(\mathbb{E}(X)\text{,}\) because we added all
\(36\) entries in the matrix. There is a slightly easier way to determine
\(\mathbb{E}(X)\text{:}\) By looking at the matrix, we see that the value
\(4\) occurs three times. Thus, the event “
\(X=4\)” has size
\(3\text{,}\) i.e., if we consider the subset of the sample space
\(S\) that corresponds to this event, then this subset has size
\(3\text{.}\) Similarly, the event “
\(X=7\)” has size
\(6\text{,}\) because the value
\(7\) occurs
\(6\) times in the matrix. The table below lists the sizes of all non-empty events, together with their probabilities.
\begin{equation*}
\begin{array}{|c|c|c|} \hline
\text{event} & \text{size of event} & \text{probability} \\
\hline
\hline
X=2 & 1 & 1/36 \\
X=3 & 2 & 2/36 \\
X=4 & 3 & 3/36 \\
X=5 & 4 & 4/36 \\
X=6 & 5 & 5/36 \\
X=7 & 6 & 6/36 \\
X=8 & 5 & 5/36 \\
X=9 & 4 & 4/36 \\
X=10 & 3 & 3/36 \\
X=11 & 2 & 2/36 \\
X=12 & 1 & 1/36 \\
\hline
\end{array}
\end{equation*}
Based on this, we get
\begin{equation*}
\begin{array}{rl}
\mathbb{E}(X) & = 2 \cdot \frac{1}{36} +
3 \cdot \frac{2}{36} +
4 \cdot \frac{3}{36} +
5 \cdot \frac{4}{36} +
6 \cdot \frac{5}{36} +
7 \cdot \frac{6}{36} + \\
& 8 \cdot \frac{5}{36} +
9 \cdot \frac{4}{36} +
10 \cdot \frac{3}{36} +
11 \cdot \frac{2}{36} +
12 \cdot \frac{1}{36} \\
& = 7 .
\end{array}
\end{equation*}
Even though this is still quite painful, less computation is needed. What we have done is the following: In the definition of \(\mathbb{E}(X)\text{,}\) i.e.,
\begin{equation*}
\mathbb{E}(X)
= \sum_{(i,j) \in S} X(i,j) \cdot P(i,j) ,
\end{equation*}
we rearranged the terms in the summation. That is, instead of taking the sum over all elements \((i,j)\) in \(S\text{,}\) we
grouped together all outcomes \((i,j)\) for which \(X(i,j) = i+j\) has the same value, say, \(k\text{,}\)
multiplied this common value \(k\) by the probability that \(X\) is equal to \(k\text{,}\)
and took the sum of the resulting products over all possible values of \(k\text{.}\)
This resulted in
\begin{equation*}
\mathbb{E}(X) = \sum_{k=2}^{12} k \cdot P(X=k) .
\end{equation*}
The following theorem states that this can be done for any random variable.