# Logging Experiences

## Some Notes about Expected Values

Posted in Math, Statistics by Sina Iravanian on August 21, 2011

Expected value of a continuous random variable is given by:

$\mathbb{E}[X] = \int_{-\infty}^{+\infty} x\,f(x)\,dx$

where $f$ is the probability density function of the random variable $x$. Now the question is how do we calculate $\mathbb{E}[g(X)]$, e.g., $\mathbb{E}[X^2]$? Do we know $f(g(x))$ for $x \in X$? The answer is that we don’t need to. No matter what we do with $x \in X$, by applying $g$ to it, we have:

$f(g(x)) = f(x)$

therefore:

$\mathbb{E}[g(X)] = \int_{-\infty}^{+\infty} g(x)\,f(x)\,dx$.