Conditional probability (Binomial distribution)

61 Views Asked by At

I'm doing an exercise of hypothesis testing with $X_1, \ldots X_{12}$, $X \sim Ber(p)$, $H_0\colon p \leq \frac{1}{2}$, $H_1\colon p > \frac{1}{2}$ and a critical region of $C_{\Upsilon}=\{(X_1,\ldots X_{12}) : \sum_{i=0}^{12}x_i >7\}$ and I got a probability that I do not know how to calculate,

$P( \text{Reject}\ H_0 \mid H_0)=P( \sum_{i=0}^{12}x_i > 7 \mid p\leq \frac{1}{2})$

I did it like this: $P( T >7 \mid p\leq \frac{1}{2})=1-P( T \leq 7 \mid p\leq \frac{1}{2}) = 1-(P( T = 0 \mid p\leq \frac{1}{2}) + \ldots P( T =7\mid p\leq \frac{1}{2}))=1-(\binom{12}{0}\frac{1}{2}^{12}+\ldots +\binom{12}{7}\frac{1}{2}^{12} )=0.806640625=\alpha$

And then I had to obtain the power function but I get the same result as above.