Likelihood ratio test always equal to $1$? Consider a random sample of size $n$ from a discrete uniform distribution with pmf $f(x|N) = 1/N$, where $x=1,\dots,N$. Determine the likelihood ratio test for testing $H_0: N \leq N_0$, $H_1: N > N_0$. 
I found the likelihood function is $1/N^n$. The maximum will be at $N=1$. So I believe the likelihood test will be $\Lambda = 1$. Is this correct - if so, what does this mean? It seems that we always will fail to reject $H_0$, which isn't really much of a test is it?
 A: The likelihood ratio test (LRT) statistic does not always equal $1$.
Likelihood function given the sample $x=(x_1,\ldots,x_n)\in\{1,2,\ldots,N\}$ is $$L(N\mid x)=\frac{1}{N^n}I_{\{x_{(n)},x_{(n)}+1,\ldots\}}(N)\quad,\,N\in\{1,2,\ldots\}$$
Here $x_{(n)}=\max\{x_1,x_2,\ldots,x_n\}$ is the maximum order statistic as usual.
So the LRT statistic is
\begin{align}
\Lambda(x)&=\frac{\sup_{N\le N_0}L(N\mid x)}{\sup_N L(N\mid x)}
\\&=\frac{L(\tilde N\mid x)}{L(\hat N\mid x)}\,\,,
\end{align}
where $\hat N=x_{(n)}$ is the (unrestricted) MLE of $N$ and $\tilde N=\min(\hat N,N_0)$ is the restricted MLE of $N$ when $N\le N_0$. Therefore the ratio is
$$\Lambda(x)=\begin{cases}1&,\text{ if }x_{(n)}\le N_0 \\ \frac{L(N_0\mid x)}{L(x_{(n)}\mid x)}&,\text{ if }x_{(n)}>N_0\end{cases}$$
That is,
$$\Lambda(x)=\begin{cases}1&,\text{ if }x_{(n)}\le N_0 \\ 0&,\text{ if }x_{(n)}>N_0\end{cases}$$
$H_0$ is trivially accepted when $\Lambda=1$. We reject $H_0$ for small values of $\Lambda$.

So a level $\alpha$ likelihood ratio test rejects $H_0$ if $X_{(n)}>N_0$. 

The above test has size $0$. If you want the test to attain exact size $\alpha$, use the randomized test $$\phi(x)=\begin{cases}1&,\text{ if }x_{(n)}>N_0 \\ \alpha &, \text{ if }x_{(n)}\le N_0\end{cases}$$
