# Law of the unconscious statistician

In probability theory and statistics, the law of the unconscious statistician (sometimes abbreviated LOTUS) is a theorem used to calculate the expected value of a function g(X) of a random variable X when one knows the probability distribution of X but one does not explicitly know the distribution of g(X).

The form of the law can depend on the form in which one states the probability distribution of the random variable X. If it is a discrete distribution and one knows its probability mass function ƒX (but not ƒg(X)), then the expected value of g(X) is

$\operatorname {E} [g(X)]=\sum _{x}g(x)f_{X}(x),\,$ where the sum is over all possible values x of X. If it is a continuous distribution and one knows its probability density function ƒX (but not ƒg(X)), then the expected value of g(X) is

$\operatorname {E} [g(X)]=\int _{-\infty }^{\infty }g(x)f_{X}(x)\,dx$ (provided the values of X are real numbers as opposed to vectors, complex numbers, etc.).

Regardless of continuity-versus-discreteness and related issues, if one knows the cumulative probability distribution function FX (but not Fg(X)), then the expected value of g(X) is given by a Riemann–Stieltjes integral

$\operatorname {E} [g(X)]=\int _{-\infty }^{\infty }g(x)\,dF_{X}(x)$ (again assuming X is real-valued).

However, the result is so well known that it is usually used without stating a name for it: the name is not extensively used. For justifications of the result for discrete and continuous random variables see.

## From the perspective of measure

A technically complete derivation of the result is available using arguments in measure theory, in which the probability space of a transformed random variable g(X) is related to that of the original random variable X. The steps here involve defining a pushforward measure for the transformed space, and the result is then an example of a change of variables formula.{{ safesubst:#invoke:Unsubst||date=__DATE__ |$B= {{#invoke:Category handler|main}}{{#invoke:Category handler|main}}[citation needed] }} {{ safesubst:#invoke:Unsubst||$N=Refimprove |date=__DATE__ |\$B= {{#invoke:Message box|ambox}} }}