Solution (source code)

= Solution

A possibly randomized test is a function $\varphi(X)\in[0,1]$, interpreted as the conditional probability of rejecting $H_0$. Its <power function> is
$$
\pi_\varphi(\theta)=\mathbb E_\theta[\varphi(X)].
$$
It has size at most $\alpha$ when
$$
\sup_{\theta\in\Theta_0}\pi_\varphi(\theta)\leq\alpha.
$$
Such a test is a <uniformly most powerful test> of size $\alpha$ if, for every other test $\psi$ of size at most $\alpha$,
$$
\pi_\varphi(\theta)\geq\pi_\psi(\theta)
\qquad\text{for every }\theta\in\Theta_1.
$$
\b[Thus one test maximizes power simultaneously at every parameter value in the alternative.]