The expectation or expected value of a random variable $X$ is its probability-weighted average value.

For a discrete random variable:

$$ \Bbb E[X]=\Sigma_x x\Bbb P(X=x) $$

For a continuous random variable with density $f_X$:

$$ \Bbb E[X]=\int^\infin_{-\infin} x f_x(x) dx $$

More generally, for a function $g$:

$$ \Bbb E[g(X)]=\Sigma_x g(x)\Bbb P(X=x) $$

and

$$ \Bbb E[g(X)]=\int^\infin_{-\infin} g(x) f_x(x) dx $$