= Solution
For any fixed $p>1/4$ below 1, the ratio to the null is
$$
\frac{f_p(y)}{f_{1/4}(y)}=[4(1-p)/3]^5\left(\frac{3p}{1-p}\right)^y.
$$
It increases with $y$. Its ordering is therefore the same for every such alternative, while the size is determined only by the null. The very same rule, \b[reject when $Y\geq4$], is most powerful against each alternative and hence is a <uniformly most powerful test>. At $p=1$ its power is 1, also optimal.
More generally, for $0<p_0<1$, the <binomial likelihood> ratio against any $p>p_0$ increases with $y$. Choose an integer cutoff $c$ so that
$$
\mathbb P_{p_0}(Y>c)\leq\alpha\leq\mathbb P_{p_0}(Y\geq c),
$$
and reject for $Y>c$, randomize with probability
$$
\boxed{\gamma=\frac{\alpha-\mathbb P_{p_0}(Y>c)}{\mathbb P_{p_0}(Y=c)}}
$$
when $Y=c$, and accept below. This gives exact size $\alpha$ and is a <uniformly most powerful test> for every positive integer $n$. Exact prescribed size may require this boundary randomization; a deterministic cutoff alone need not attain it. For $p_0=0$, reject all $Y>0$ and reject at $Y=0$ with probability $\alpha$, which is likewise optimal. At $p_0=1$ the stated one-sided alternative is empty. The cutoff generally depends on $p_0,n,\alpha$; there is no claim that one fixed cutoff serves every null parameter.
Back to article page