Expectation of a function

$E[g(X)] = \sum_x g(x)\,P(X = x)$ weights the values of $g$ by the original probabilities; it equals $g(E[X])$ for a straight line, $E[aX + b] = aE[X] + b$, but not in general.

From Probability.