# An Application of the Neyman-Pearson Lemma. Problem: Using the Neyman-Pearson Lemma, determine the most powerful test of size $5 \%$.

I know the Neyman-Pearson Lemma says that the test with the critical region $$\left\{ x \in \{ 1,2,3,4 \} ~ \Bigg| ~ \frac{L(x \mid \theta = 0)}{L(x \mid \theta = 1)} \leq A \right\},$$ where $A$ satisfies $$\mathbf{Pr} \left( \frac{L(X \mid \theta = 0)}{L(X \mid \theta = 1)} \leq A ~ \Bigg| ~ H_{0} \right) = 0.05,$$ is the most powerful test of size $5 \%$. However, I’m not sure what the likelihood functions are, as I’m more used to seeing them given by a formula.

Thanks.

According to the data, we have $$L(x \mid \theta = 0) = \begin{cases} 0.02 & \text{if  x = 1 }; \\ 0.02 & \text{if  x = 2 }; \\ 0.03 & \text{if  x = 3 }; \\ 0.93 & \text{if  x = 4 }, \end{cases} \\ L(x \mid \theta = 1) = \begin{cases} 0.10 & \text{if  x = 1 }; \\ 0.20 & \text{if  x = 2 }; \\ 0.30 & \text{if  x = 3 }; \\ 0.40 & \text{if  x = 4 }. \end{cases}$$ Therefore, $$\Lambda(x) \stackrel{\text{def}}{=} \frac{L(x \mid \theta = 0)}{L(x \mid \theta = 1)} = \begin{cases} 0.2 & \text{if  x = 1 }; \\ 0.1 & \text{if  x = 2 }; \\ 0.1 & \text{if  x = 3 }; \\ 2.325 & \text{if  x = 4 }. \end{cases}$$ The chosen size is $0.05$; the Neyman-Pearson Lemma says that in order to find the most powerful test of this size, we need to find an $\eta \in \mathbb{R}$ such that $$\mathbf{Pr}(\Lambda(X) \leq \eta \mid \theta = 0) = 0.05.$$ The choice of $\eta = 0.1$ works, so the most powerful test of size $0.05$ is:
Reject $H_{0}$ in favor of $H_{1}$ when the observed value of $\Lambda(X)$ is $\leq 0.1$, or equivalently, when the observed value of $X$ is either $2$ or $3$.