Law of the unconscious statistician

Accidentally correct expected values

The law of the unconscious statistician is the theorem for calculating the expected value of the transformation g(X)g(X) (of a known random variable XX) without knowing the probability distribution of g(X)g(X). In the discrete case, we have

E[g(X)]=xg(x)fX(x)\mathbb{E}[g(X)] = \sum_x{g(x)f_X(x)}

and in the continuous case

E[g(X)]=g(x)fX(x)dx\mathbb{E}[g(X)] = \int_{-\infty}^\infty{g(x)f_X(x)dx}

This theorem is assigned its name due to anecdotes of students making use of it without knowledge of its origins. This is due to its fundamental, intuitive looking form that one might expect (ha) is definitionally true, whereas in reality it is the consequence of rigorous derivation.

Sources