Expectation of a Function of a Random Variable

Theorem

Discrete Given a discrete RV XX with range X\mathscr{X} and pmf pp, and given g:R→Rg:\mathbb{R}\to\mathbb{R}, then E[g(X)]=∑x∈Xg(x) p(x)E[g(X)]=\sum_{x\in\mathscr{X}}g(x)\ p(x)Continuous Given a continuous RV XX with range X\mathscr{X} and pdf ff, and given g:R→Rg:\mathbb{R}\to\mathbb{R}, then E[g(X)]=∫Xg(x)f(x) dxE[g(X)]=\int_{\mathscr{X}} g(x)f(x) \ dx only if:E[∣g(X)∣]=∫∣g(x)∣f(x) dx<∞E[|g(X)|]=\int|g(x)|f(x) \ dx<\infty