# Constructing most powerful critical region basics

I've been trying to teach myself some of the fundamentals of statistics and would like to see if I'm in the right direction.

Here's the problem:

Construct the most powerful critical region of size $\alpha$ to test the null hypothesis $H_0: \theta=\theta_0$, where $\theta$ is the parameter of a binomial distribution $b(n,\theta)$ with a given value of $n$, against the alternative hypothesis $H_1: \theta=\theta_1<\theta_0$. Use $\theta_0=0.75$, $\theta_1=0.5$, $n=25$, and $\alpha=0.05$.

My work:

Since we have simple hypotheses, we can apply the Neyman-Pearson lemma. So, if $f(x;\theta)$ is the pmf we're working with, we have $$\frac{f(x;\theta_1)}{f(x;\theta_0)}= \frac{ {25\choose x}(1/2)^x (1/2)^{25-x}}{{25\choose x}(3/4)^x (1/4)^{25-x}}= 2^{25}(1/3)^x.$$ Now, this ratio is decreasing in $x$, which means we reject $H_0$ for small enough $x$. So, we want to find $c$ such that $$\mathbb{P}(X\leq c \hspace{1mm}; \theta=0.75)=0.05$$ and, by computation, I found $$\mathbb{P}(X\leq 14 \hspace{1mm}; \theta=0.75) \approx 0.03$$ and $$\mathbb{P}(X\leq 15 \hspace{1mm}; \theta=0.75) \approx 0.07.$$ Hence, by Neyman-Pearson, a test that rejects when $X\leq 14$ is a UMP level $\alpha(=0.05)$ test. So, the most powerful critical region of size $0.05$ is $0\leq X \leq 14$.

I would very much appreciate any feedback/corrections/etc. Thanks!

Anyway you look at it, the answer looks good.

You have discovered that the log likelihood ratio is linear:

$$\log\left(\frac{f(x;\theta_1)}{f(x;\theta_0)}\right) = 25\log(2) - x\log(3).$$

The left hand panel of the figure plots this. (Since only the shape of the log likelihood ratio matters, no value axis is shown.) This reflects the fact that the relative probability that $X$ came from $\theta_1$ compared to $\theta_0$ decreases as $X$ grows larger. Those probabilities appear in the middle panel of the figure: red, peaking near $25\theta_1=12.5$, for $\theta_1$, and blue, peaking near $25\theta_0=18.75$, for $\theta_0$. That suffices to show the UMP critical region must be some interval starting at $X=0$.

A good quantitative check of the result is afforded by the cumulative distribution functions, shown in the right panel with comparable colors. The dotted horizontal line is at a value of $\alpha=0.05$. The CDF corresponding to $\theta_0$ rises above $\alpha$ between $X=14$ and $X=15$, showing that the false positive rate must be less than $\alpha$ for the critical region $\{0,1,\ldots, 14\}$ but greater than $\alpha$ if $15$ is also included. Consequently $\{0,1,\ldots, 14\}$ is the unique solution.