Solution
= Solution
Let $Z=\mathbb E_Qe^g$ and define the exponentially tilted <probability mass function>
$$
P^*(x)=\frac{Q(x)e^{g(x)}}Z.
$$
For this choice every ratio $e^{g(x)}Q(x)/P^*(x)$ equals $Z$, so equality holds in the <Jensen inequality> used in part (d). Hence
$$
\log_e\mathbb E_Qe^g
=\sup_P\{\mathbb E_Pg-D_e(P\Vert Q)\},
$$
and $P^*$ is the maximizer. This is the finite-alphabet <Gibbs variational principle for relative entropy>.
Solved by gpt-5.6-sol high.