Given Normal population with mean $\theta$ and variance $1$, find Sample size for UMP for $H_0 : \theta = 0$ against $H_1: \theta = 4$ Given Normal population with mean $\theta$ and variance $1$, find Sample size for UMP for $H_0 : \theta = 0$ against $H_1: \theta = 4$ with given probabilities  of type I and Type II errors specified by $ \alpha = 0.05 = \beta$, [Given $P(Z>1.96) = 0.05, Z \sim N(0,1)$]
If I calculate the likelihood function quotient we have:
$\displaystyle \frac{L(\theta =0)}{L(\theta = 4)} =\exp(-\frac{1}{2}\bigg(\sum_{i=1}^n X_i^2 - \sum_{i=1}^n (X_i-4)^2\bigg) = \exp(-4\bigg(\sum_{i=1}^nX_i^2 - 8n\bigg) $
From here I am not sure what to do exactly,
I saw the Neyman-Pearson lemma which seems useful, seems insofar as if $k$ is a constant and given the critical region $C$
$\exp(-4\bigg(\sum_{i=1}^nX_i^2 - 8n\bigg) \le k$ inside $C$ and $\exp(-4\bigg(\sum_{i=1}^nX_i^2 - 8n\bigg) \ge k$ outside $C$ then $C$ will be the most powerful critical region for testing then solve for $n$
But I still need to use the specified error probabilities.
Insight into this is appreciated.
 A: Clearly, you will reject when your sample mean $\bar X_n$ of $n$ observations exceeds $0.$ If you want $\alpha$ and $\beta$ to be equal, then by symmetry the critical value must be $c = 2.$
Then you need to find $n$ so that $\alpha = \beta = 0.025.$
[I think there is a mistake in your question. $P(Z > 1.96) = 0.025,$ not $0.05.$ So I'm just looking at the part of the solution
that is directly relevant to finding $n.$ I'll let you reconcile the result with the likelihood ratio on your own. It's often difficult to figure out what the likelihood ratio result is telling you
without some intuition, which I hope to provide.]
A Type I error occurs if you Reject $H_0$ when it is true.
So you want $P(\bar X_n \ge c) = 0.05.$ That is,
$$P(\bar X_n \ge c) 
= P\left(\frac{\bar X_n - \theta_0}{\sigma/\sqrt{n}}
\le \frac{c-\theta_0}{\sigma/\sqrt{n}}\right)$$
$$= P\left( \frac{\bar X_n - 0}{1/\sqrt{n}}
\le \frac{2-0}{1/\sqrt{n}} \right)$$
$$= P(Z
\le 2\sqrt{n}) = \alpha = 0.025.$$
So $2\sqrt{n} = 1.96$ and $n = 1$ observation should suffice.
In the figure below the critical value is shown by a vertical dotted line.

In the figure, the probability $\alpha + 0.025$ of Type I error is represented by the small region under the blue curve that lies to the right of the dotted vertical line.
The probability $\beta$ of Type II error is the small region under the brown curve that lies to the left of the vertical line. (That would be a separate computation similar to the one I have shown you for $\alpha.)$
