There is no single convention. Modern probability texts favour \mathbb{E}; statistics texts often use an upright E via \operatorname. The bracket style varies too: E[X], E(X) and E X all appear. Pick one and keep it.
All ways to write it
| Command | Use | Package | Copy |
|---|---|---|---|
\mathbb{E}[X] | blackboard E | amssymb | |
\operatorname{E}[X] | upright E | none | |
E[X] | plain italic E, common in older texts | none | |
\mathrm{Var}(X) | variance | none | |
\operatorname{Cov}(X, Y) | covariance | none | |
\mathbb{P}(A) | probability, same style | none |
Commands marked with a package need that \usepackage line in a LaTeX document.
Example
\mathbb{E}[X] = \sum_{x} x \, P(X = x), \qquad \operatorname{Var}(X) = \mathbb{E}[X^2] - \mathbb{E}[X]^2Expectation of a discrete variable and the variance identity.
Questions
How do I get a bold or upright E without amssymb?
\operatorname{E} gives an upright roman E in any setup, including KaTeX.
Related symbols
- Real numbers ℝ
\mathbb{R} - Summation ∑
\sum_{i=1}^{n} - Integral ∫
\int_{a}^{b} f(x)\,dx
Using expectation in Confluence
Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type \mathbb{E}[X] and it renders inline or as a block, with a live preview while you edit. Every command on this page renders there without extra packages.