Probability & Statistics

The Mean of e to the X

If X is normal with mean 0 and variance sigma squared, what is the expected value of e to the X? The answer is not 1, and the gap reveals something about averaging an exponential.

solvedmedium1 min

Suppose XX is distributed normal with mean 00 and variance σ2\sigma^2. What is E[eX]\E[e^X]?

Reveal solutionHide solution

#Write the integral

E[eX]=ex1σ2πex2/(2σ2)dx.(1)\E[e^X] = \int_{-\infty}^{\infty} e^{x} \cdot \frac{1}{\sigma\sqrt{2\pi}}\, e^{-x^2 / (2\sigma^2)}\, dx. \tag{1}

#Complete the square

Merge the two exponents and group the powers of xx,

xx22σ2=12σ2(x22σ2x)=(xσ2)22σ2+σ22.(2)x - \frac{x^2}{2\sigma^2} = -\frac{1}{2\sigma^2}\big(x^2 - 2\sigma^2 x\big) = -\frac{(x - \sigma^2)^2}{2\sigma^2} + \frac{\sigma^2}{2}. \tag{2}

#Integrate

The constant eσ2/2e^{\sigma^2/2} pulls out, and what remains is a normal density centred at σ2\sigma^2, whose integral is 11,

E[eX]=eσ2/21σ2πe(xσ2)2/(2σ2)dx=eσ2/2.(3)\E[e^X] = e^{\sigma^2/2} \int_{-\infty}^{\infty} \frac{1}{\sigma\sqrt{2\pi}}\, e^{-(x - \sigma^2)^2 / (2\sigma^2)}\, dx = e^{\sigma^2/2}. \tag{3}
median 1mean
Exponentiating a symmetric normal produces a right-skewed lognormal. The long upper tail drags the mean up to e to the one half, strictly above the median of 1, so averaging an exponential is not the exponential of the average.

#Result

E[eX]=eσ2/2.(4)\E[e^X] = e^{\sigma^2/2}. \tag{4}

This is the mean of the lognormal variable eXe^X, which exceeds its median e0=1e^0 = 1 because the exponential stretches the upper tail far more than the lower. It is also the normal moment generating function E[etX]=eσ2t2/2\E[e^{tX}] = e^{\sigma^2 t^2 / 2} read off at t=1t = 1.