Solution (source code)

= Solution

Expand the logarithm of the <product measure> and exchange the finite sums:
$$
\begin{aligned}
\sum_{x_1^n\in B}P_n(x_1^n)\log_2Q^n(x_1^n)
&=\sum_{x_1^n\in B}P_n(x_1^n)\sum_{i=1}^n\log_2Q(x_i)\\
&=n\sum_{a\in A}\left\{\sum_{x_1^n\in B}P_n(x_1^n)\widehat P_{x_1^n}(a)\right\}\log_2Q(a)\\
&=n\sum_{a\in A}\overline P(a)\log_2Q(a),
\end{aligned}
$$
where part c identifies the expression in braces.