Expected value or expectation of a random variable X is defined, if it exists, in a mathematically precise way with respect to a probability space, typically denoted as (Ω,A,P), where Ω is the universe of possibilities, A the set of possible events (which are the possible values of the random variable X) and P a probability measure such that P(Ω)=1.

Latex expected value using mathbb function

To use the latex expected value using mathbb function, you must load amssymb package

\documentclass[12pt]{article}
\usepackage{amssymb}
...
\end{document}

Next, we use \mathbb function.

Here are five examples using LaTeX to write expected value of a random variable X :

\documentclass[12pt]{article}
\usepackage{amssymb}
$$ \mathbb{E}[X] = \sum_{i=1}^{n} x_i \cdot p_i $$

$$ \mathbb{E}[X] = \frac{\displaystyle\sum_{i=1}^{n} x_i \cdot p_i}{\displaystyle\sum_{i=1}^{n} p_i} $$

$$ \mathbb{E}[X] = \int_{-\infty}^{\infty} xf(x) \, dx $$

$$ \mathbb{E}[X] = \frac{1}{n} \sum_{i=1}^{n} x_i $$

$$ \mathbb{E}[X] = \int_{-\infty}^{\infty} x \, dF(x) $$
\end{document}
E[X]=i=1nxipi E[X]=i=1nxipii=1npi E[X]=xf(x)dx E[X]=1ni=1nxi E[X]=xdF(x)