.

# Expected Value

The expected value of r.v. $X$, usually written as $E\left(X\right)$, is defined as

$E\left(X\right)=\sum_{x\in\mathbf{R}}x\,f_{X}\left(x\right)$ if $X$ is discrete.

$E\left(X\right)=\int_{-\infty}^{+\infty}t\,f_{X}\left(t\right)dt$ if $X$ is continuous.

In general, suppose we would like to calculate $E\left(g\left(X\right)\right)$ where $g\left(\cdot\right)$ is a function. Then we would obtain

$E\left(g\left(X\right)\right)=\sum_{x\in\mathbf{R}}g\left(x\right)\,f_{X}\left(x\right)$ if $X$ is discrete.

$E\left(g\left(X\right)\right)=\int_{-\infty}^{+\infty}g\left(t\right)\,f_{X}\left(t\right)dt$ if $X$ is continuous.

## Existence of the Expected Value

Unlike in the discrete case, it is possible to obtain $E\left(X\right)=\infty$ in the continuous case. This is surprising if we think of expectations as averages, because no average of finite numbers turns out to be infinite. However, this is not assured in the case where $X$ is continuous. To see this, notice that we already know that some integrals yield infinity rather than a real number.

For example, $\int_{1}^{\infty}\frac{1}{x}dx=\infty$. The reason is that, while $\frac{1}{x}$ is decreasing when $x\gt 1$, it approximates the x-axis ‘too slowly’, such that the area underneath grows fast enough so its sum is infinite.

Suppose instead that r.v. $X$ has pdf $\frac{1}{x^{2}}$, defined in domain $\left[1,\infty\right]$. We can show that this function is indeed a pdf, since $\int_{1}^{\infty}\frac{1}{x^{2}}dx=1$, and the function is positive over its domain. In this case, $E\left(X\right)=\int_{1}^{\infty}x\frac{1}{x^{2}}dx=\int_{1}^{\infty}\frac{1}{x}dx=\infty$; We have discovered a r.v. that does not have an expected value (i.e., it’s infinite). Intuitively, the expected value exists as long as the pdf approaches zero fast enough.

You will usually read the statement “if $\int_{-\infty}^{+\infty}\left|t\right|\,f_{X}\left(t\right)dt=\infty$, then $E\left(X\right)$ does not exist”, and may wonder about the absolute value. This is just a compact way to write the non-existence of the expected value. To see this, first suppose $X$ were always positive. In this case, the absolute value would be redundant, but the statement would remain correct. If $X$ were always negative and with $E\left[X\right]=-\infty$, then the statement would still apply, because $E\left[\left|X\right|\right]=\infty$ remains true. Finally, suppose $X$ spans $\left(-\infty,\infty\right)$ and $\int_{-\infty}^{0}\left|t\right|\,f_{X}\left(t\right)dt=-\infty$ and $\int_{0}^{\infty}\left|t\right|\,f_{X}\left(t\right)dt=+\infty$. Then, the expectation of $X$ does not exist, as it is indeterminate, but the statement $\int_{-\infty}^{+\infty}\left|t\right|\,f_{X}\left(t\right)dt=\infty$ still holds.

So, $\int_{-\infty}^{+\infty}\left|t\right|\,f_{X}\left(t\right)dt=\infty$ is an efficient way to summarize the cases that may lead a r.v. to not have an expectation.

## Alternative notation

You may sometimes see the statement $E\left(X\right)=\int_{-\infty}^{+\infty}t dF_{X}\left(t\right)$ instead. This notation usually refers to the Lebesgue integral, where $F_{X}\left(t\right)$ refers to a 'measure.' We do not cover the distinction here here. Notice that if we are ok canceling differentials (we'll avoid the long technicalities), we can obtain $\int_{-\infty}^{+\infty}\left|t\right|dF_{X}\left(t\right)=\int_{-\infty}^{+\infty}\left|t\right|dF_{X}\frac{dt}{dt}=\int_{-\infty}^{+\infty}\left|t\right|\frac{dF_{X}\left(t\right)}{dt}dt$, and finally by noting that $\frac{dF_{X}\left(t\right)}{dt}=f_{X}\left(t\right)$, we obtain the familiar expression $\int_{-\infty}^{+\infty}t\,f_{X}\left(t\right)dt$.

## Basic properties of expectations

• Linearity: $E\left(ag\left(X\right)+bh\left(X\right)\right)=aE\left(g\left(X\right)\right)+bE\left(h\left(X\right)\right)$
• Order-preserving: $g\left(X\right)\leq h\left(X\right),\,\forall x\in\mathbb{R}\Rightarrow E\left(g\left(X\right)\right)\leq E\left(h\left(X\right)\right)$ (and equality holds if $g\left(X\right)=h\left(X\right)$)