# Maximise expectation of exponential given mean and variance

The problem is as follows:

Suppose that $X$ is a random variable with $\mathbb{E}X=0$, $\mathbb{D}X = \sigma^2$ and having a finite support: $P(|X|\leq a)=1$. What is the maximum possible value of $\mathbb{E}e^{X}$ and on what RV is this value achieved?

My thought was to consider the value of the characteristic function of such an RV at the point $-i$: \begin{gather*} \mathbb{E}e^X=\varphi(-i)=\sum_{k=0}^{\infty}\frac{\mathbb{E}X^k}{k!}=1+\frac{\sigma^2}{2}+\sum_{k=3}^{\infty}\frac{\mathbb{E}X^k}{k!} \end{gather*} which may have worked if not for the condition of boundedness of support, which I have no idea how to incorporate here.

Of course I'm not asking for a complete solution but any ideas/approaches are highly welcome.

• For consistency, it must be the case that $\sigma^2 \leq a^2$ where equality holds when $X$ is a discrete random variable taking on values $-a$ and $+a$ with equal probability $\frac 12$, and for this special case, $$\mathbb Ee^X = \frac{e^a+e^{-a}}{2} = \cosh a.$$ How much worse do you do when $\sigma^2 < a^2$? – Dilip Sarwate Nov 28 '15 at 15:27
• @DilipSarwate Thank you for your comment. I see that this RV will be the one with the largest variance given the constraints for expectation and support, but I don't see why it maximises $\mathbb{E}e^{X}$ even if $\sigma^2=a^2$. Of course I can consider an RV that equals $\sigma$ and $-\sigma$ with equal probability, but then again not sure if it maximises the target. However I will try to get that idea further. – Vossler Nov 28 '15 at 18:10
• Vossler, the result Dilip states in his comment is simply a consequence of convexity of $e^x$ and, thus, holds more generally. – cardinal Nov 29 '15 at 2:54
• Couldn't one do this using calculus of variations? – seanv507 Nov 30 '15 at 8:13
• @seanv507I had this thought but my knowledge in this area is limited by the case of integral target function and integral constraints. Thus, if we try to formulate the problem for the target CDF, it is unclear for me how to write the support constraint (as well as the regular constraints for it being a CDF: limits, nonnegativity, monotonicity) – Vossler Nov 30 '15 at 8:27

I tried to carry this idea of putting as much mass at $a$ to a solution and it turns out that you can actually do even better as you proposed. Namely, you can put as much as $\frac{\sigma^2}{\sigma^2+a^2}$ there while still satisfying the constraints.
Consider such RV $X_0$ that \begin{gather*} X_0=\begin{cases} a,\,\,P=\frac{\sigma^2}{\sigma^2+a^2},\\ -\frac{\sigma^2}{a},\,\,P=\frac{a^2}{\sigma^2+a^2}. \end{cases} \end{gather*} It is straightforward to make sure that it satisfies all the constraints. Now, for this RV \begin{gather*} \mathbb{E}e^{X_0}=\frac{e^a\sigma^2+e^{-\frac{\sigma^2}{a}}a^2}{\sigma^2+a^2}. \end{gather*} Let us now prove that we can't do better. It is fairly easy to see that there exists a quadratic function $f(x):=\alpha x^2+\beta x+\gamma$ that satisfies the following constraints (three linear equations for its coefficients): \begin{gather*} f(a)=e^a,\\ f(-\sigma^2/a)=e^{-\frac{\sigma^2}{a}},\\ f^\prime(-\sigma^2/a)=(e^{x})^\prime|_{x=-\sigma^2/a}=e^{-\frac{\sigma^2}{a}}\,\,(\text{common tangent}). \end{gather*} For example, simply solving the equations we obtain: \begin{gather*} \alpha=\frac{e^aa^2-e^{-\frac{\sigma^2}{a}}a(a+a^2+\sigma^2)}{(\sigma^2+a^2)^2},\\ \beta=e^{-\frac{\sigma^2}{a}}+\frac{2\sigma^2}{a}\alpha,\\ \gamma=\mathbb{E}X_0-\alpha\sigma^2. \end{gather*} Putting our strengths together for the last struggle, we can see through simple analysis of derivatives that \begin{gather*} \forall x\in [-a;a]\,\,f(x)\geq e^x. \end{gather*} Thus, for any X satisfying the constraints \begin{gather*} \mathbb{E}e^{X}\leq\mathbb{E}f(X)=\alpha\mathbb{E}X^2+\gamma=\alpha\sigma^2+\gamma=\frac{e^a\sigma^2+e^{-\frac{\sigma^2}{a}}a^2}{\sigma^2+a^2}=\mathbb{E}e^{X_0}. \end{gather*} Case closed.
• +1 One way to approach this problem would be to emulate the "probability moving" argument at stats.stackexchange.com/a/50553. But I like this one much better: replacing $\exp$ with a quadratic function is a clever move! – whuber Nov 30 '15 at 1:09