Skip to content

LOTUS

Theorem

Let gg be a Borel-measurable real function (preimages of Borel sets are Borel sets), so that g(X)g(X) is a random variable. If E∣g(X)∣<∞\mathbb{E}|g(X)|<\infty, the law of the unconscious statistician (LOTUS) gives

E[g(X)]=∑xg(x)pX(x)for discrete X,E[g(X)]=∫Rg(x)fX(x) dxwhen X has a density.\begin{aligned} \mathbb{E}[g(X)]&=\sum_x g(x)p_X(x)\quad \text{for discrete }X,\\ \mathbb{E}[g(X)]&=\int_{\mathbb{R}}g(x)f_X(x)\,\mathrm{d}x\quad \text{when }X\text{ has a density}. \end{aligned}

The formulas also hold as extended nonnegative expectations when g≥0g\ge0. A finite signed result requires absolute integrability; no distribution of g(X)g(X) has to be computed first.


Interpretation

To average a transformed variable, apply the transformation to each possible value and weight using the original distribution. This avoids deriving a new distribution merely to compute an expectation.

The parabola g(x) = x squared with points at x = -1, 0, 1 and 2, and the probabilities 0.1, 0.3, 0.4 and 0.2 of these values written below.

For the transformation g(x)=x2g(x)=x^2 shown, E[g(X)]=1(0.1)+0(0.3)+1(0.4)+4(0.2)=1.3\mathbb{E}[g(X)]=1(0.1)+0(0.3)+1(0.4)+4(0.2)=1.3. The values of gg are weighted by the PMF of XX, without deriving the PMF of g(X)g(X).

A function of a random variable changes the value on each outcome from XX to g(X)g(X). LOTUS averages those transformed values using the original law of XX, avoiding a separate derivation of the distribution of g(X)g(X).


Key Results

  • Choosing g(x)=xkg(x)=x^k computes the kkth moment when it exists; in particular g(x)=x2g(x)=x^2 gives the second moment.
  • Choosing g(x)=𝟙1{x∈A}g(x)=\indicator_{\{x\in A\}} gives P(X∈A)\mathbb{P}(X\in A) by a sum or an integral.

Examples

  • For a fair die, E[X2]=(1+4+9+16+25+36)/6=91/6\mathbb{E}[X^2]=(1+4+9+16+25+36)/6=91/6.
  • For X∼Exp⁡(2)X\sim\operatorname{Exp}(2), E[e−X]=∫0∞2e−3x dx=2/3\mathbb{E}[\mathrm{e}^{-X}]=\int_0^\infty2\mathrm{e}^{-3x}\,\mathrm{d}x=2/3.

Prerequisites

Sources

Aliases: law of the unconscious statistician Keywords: expectation of a function of a random variable, LOTUS for a Discrete Random Variable, LOTUS for a Continuous Random Variable Symbols: element of, infinity, integral, real numbers, sum

Last updated: 22 October 2026 19:04