The definition of a random variable's mean can be generalised:
Definition
The expected value of a function \(g(X)\) of a discrete random variable, \(X\), is defined to be
\[ E\big[g(X)\big] = \sum_{\text{all } x} {g(x) \times p(x)} \]As with the definition of the variable's mean, this definition 'weights' the possible values, g(x), with their probabilities of arising.
The following two results make it easier to evaluate expected values.
Linear function of a random variable
If \(X\) is a discrete random variable and \(a\) and \(b\) are constants,
\[ E\big[a + b \times X\big] \;\;=\;\; a + b \times E[X] \]Sum of two functions of X
If \(X\) is a discrete random variable and \(g(X)\) and \(h(X)\) are functions of it,
\[ E\big[g(X) + h(X)\big] \;\;=\;\; E\big[g(X)\big] + E\big[h(X)\big] \](Both proved in full version)