= Solution
The test accepts $P$ when $D(\widehat P_n\Vert P)\leq\delta$. Under $P$, the <method of types> gives
$$
e_1^{(n)}
\leq(n+1)^{|A|}2^{-n\delta},
$$
so
$$
D_1(\delta)=\delta.
$$
Under $Q$, accepting $P$ requires a type in the closed set $\{R:D(R\Vert P)\leq\delta\}$. Therefore
$$
e_2^{(n)}
\leq(n+1)^{|A|}2^{-nD_2(\delta)},
$$
where
$$
D_2(\delta)
=\min_{R:D(R\Vert P)\leq\delta}D(R\Vert Q).
$$
Consequently $\limsup_n n^{-1}\log_2e_i^{(n)}\leq-D_i(\delta)$ for $i=1,2$. The first exponent is positive when $\delta>0$. Because relative entropy vanishes only when its arguments agree, the second is positive exactly while $Q$ lies outside the constraint set. Thus both are strictly positive for
$$
0<\delta<D(Q\Vert P).
$$
Back to article page