# Expectation (math)

The mathematical expectation of a continuously distributed random variable X with probability density function f(x) is

$\mbox{E}[X] =\int\limits_{-\infty}^\infty x f(x)dx.$

The expectation is also known as the mean of X.

The expectation with respect to some function g(X) where X is distributed according to f(x) is

$\mbox{E}[g(X)] =\int\limits_{-\infty}^\infty g(x) f(x)dx.$

For a discretely distributed random variable X with probability mass function pk it is

 E[X] = ∑ pkxk. k