Definition 11.8 (Mean). For a random variable X with pmf/pdf f(x), the expected value (mean), written E(X) or μ, is
E(X)=⎩⎨⎧x∑xf(x)∫−∞∞xf(x)dxif X is discreteif X is continuous.
E(X) need not itself be a value X can take (e.g. the mean number of heads in 2 tosses is 1, but the mean of 3 coins' tails-count can be a fraction). It is best interpreted as the long-run average value of X over many independent repetitions of the underlying experiment.
Theorem 11.3 (expectation of a function of X, without proof). For any function g(X) of the random variable X,