# Using Neyman pearson lemma when ratio comes out to be zero.

Consider a Bernoulli random variable:

$$X_i= \begin{cases} 1, & \text{with probability }p \\ 0, & \text{with probability }1-p \end{cases}$$

You observe the outcomes of two Bernoulli trials and want to test $H_o : p=0$ against $H_1 : p=0.5$. Use Neyman-Pearson lemma to determine the most powerful test of $H_o$ versus $H_1$. What are the Type 1 $(\alpha)$ and Type 2 $(\beta)$ errors for your test?

Here's how I tried. Please point out my mistakes and correct me:

$$f(x_i)= \begin{cases} (1-p)^{1-x_i} p^{x_i}, & x_i =0,1 \\ 0, & \text{elsewhere} \\ \end{cases}$$

$H_o: p=p'=0$

$H_1: p=p''=0.5$

$\frac {L(p')}{L(p'')}$= $\frac {0}{1/4}$ = $0 \le k$ where $k$ is a positive number.

$\implies \frac {L(p')}{L(p'')} \lt k$ (for all $k \gt 0)$ $\implies \frac {L(p')}{L(p'')} \lt k$ for all $X_i$s (here for $X_1$ and $X_2$)

So here my critical region is all values of $X_i$ i.e., $X_i=0,1$ or to say $[X_1=0,1$ and $X_2=0,1]$

$\alpha = P_{H_o}(X_1=0,1$ and $X_2=0,1) = 0$

$\beta =1- P_{H_1}(X_1=0,1$ and $X_2=0,1)$

But, $P_{H_1}(X_1=0,1$ and $X_2=0,1)$

$=P_{H_1}(X_1=0,X_2=0) + P_{H_1}(X_1=0,X_2=1) + P_{H_1}(X_1=1,X_2=0) + P_{H_1}(X_1=1,X_2=1)$

$=(\frac12)(\frac12)4 =1$

So, $\beta = 1-1=0$

But both $\alpha$ and $\beta$ cant be zero? someone please tell me how to apply neyman pearson in such cases.

$$\frac{L(p')}{L(p'')} = \begin{cases} \frac{0}{1/4} & \text{if }X_1=X_2=1, \\[10pt] \frac{0}{1/4} & \text{if }X_1=1\ \&\ X_2=0, \\[10pt] \frac{0}{1/4} & \text{if }X_1=0\ \&\ X_2=1, \\[10pt] \frac{1}{1/4} & \text{if }X_1=X_2=0. \end{cases}$$ The probability of a false positive (Type I error, falsely rejecting $H_0$) is $0$, since $X_1+X_2$ cannot be positive if $p=0$. But the probability of failing to reject $H_0$ if the alternative is true is $1/4$, since $\Pr(X_1=X_2=0\mid p=0.5)=1/4$.
• taking $p=0$,,,, when $x_i = 1$ then clearly $f(x_i)=1^0 0^1=0$. BUT when $x_i = 0$ then $f(x_i=0)=1^1 0^0=??$ Jun 25, 2013 at 2:00
• There's no point in including that case, since when $p=0$, that won't happen. Jun 25, 2013 at 2:04
• ok. got it. But please tell me how to find $\alpha$ (type 1 error). This is the definition of $\alpha$ which I know: It is the probability that $X_i$s fall in critical region assuming null hypothesis case. So please tell me, how did you find critical region (and also $\alpha$) Jun 25, 2013 at 2:11
• Please tell me how are we getting the critical region in this case when in the ratio of $\frac{L(p')}{L(p'')}$ there are no $X_i$s?? Jun 25, 2013 at 8:34
• The critical region is $X_1+X_2\ge1$, since it is only in that case that one could reasonably reject $H_0$. Jun 25, 2013 at 16:49