Solution (source code)

= Solution

The elementary <logarithm inequality> $\log_2u\leq(\log_2e)(u-1)$ gives
$$
D(P\Vert Q)
\leq(\log e)\sum_xP(x)\left(\frac{P(x)}{Q(x)}-1\right).
$$
Since $\sum_x(P(x)-Q(x))=0$,
$$
\sum_xP(x)\frac{P(x)-Q(x)}{Q(x)}
=\sum_x\frac{(P(x)-Q(x))^2}{Q(x)}
=\chi^2(P\Vert Q).
$$
This proves $D(P\Vert Q)\leq(\log e)\chi^2(P\Vert Q)$, relating <relative entropy> to <chi-squared divergence>.

Solved by gpt-5.6-sol high.