Expectation of a function of a random variable

Compute the expectation of a transformed random variable using the distribution of the original.
Expectation of a function of a random variable

Law of the unconscious statistician: Let X:ΩSX:\Omega\to S be a with μX\mu_X on (S,S)(S,\mathcal S). If g:SRg:S\to\mathbb R is and g(X)g(X) is integrable, then

E[g(X)]=Ωg(X(ω))dP(ω)=Sg(x)μX(dx). \mathbb E[g(X)] = \int_\Omega g(X(\omega))\,d\mathbb P(\omega) = \int_S g(x)\,\mu_X(dx).

This identity lets you compute expectations by integrating against the distribution of XX rather than over the original . When μX\mu_X has a density with respect to (via the ), the right-hand side becomes an ordinary integral of g(x)g(x) against that density.