Fairness of a Coin

A coin is tossed $40$ times. Define $T$ as the number of tails.

i) Define the region of rejection by $|T-20|\geq5.$ Calculate $\alpha,$ the significance level ---

$\displaystyle\alpha = P(y\leq15 \lor y\geq25)= 1- P(16 \leq y\leq24) = 1-\sum_{T=16}^{24}{{40\choose{T}}\left(\frac{1}{2}\right)^T\left(\frac{1}{2}\right)^{40-T}} \approx 0.154.$

ii) Let $T=26.$ Compute the p-value. ---

We have $\displaystyle \frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}} = \frac{\frac{26}{40}-0.5}{\sqrt{\frac{0.5(1-0.5)}{40}}} \approx 1.897.$ We have $H_0: p = 0.5$ and $H_a: p \neq 0.5,$ since we are testing whether it is fair or not (the side it favors doesn't matter). Hence, the p-value is $2(\phi(1.897))=0.9426.$ This also entails, using the former significance level, that we fail to reject the null.

iii) Calculate $\beta,$ the probability of a type II error for $H_0: p=0.5$ and $H_a: p = 0.6.$ ---

We have $\displaystyle z = \frac{\phi^{-1}(0.5,\sqrt{\frac{0.5(1-0.5)}{40}}, 0.846) - 0.6}{\sqrt{\frac{0.5(1-0.5)}{40}}} \approx \frac{0.581-0.6}{0.079057}\approx 0.240333,$ where $\phi^{-1}$ is the inverse normal function, with parameters $\mu, s,$ and $p$ (probability), respectively. The area to the right of this is $0.405,$ which is $\beta.$

This is a homework problem that I'm a little unsure on. Specifically, I don't fully understand how to calculate the p-value for proportions in this two-tailed scenario. Also, I'm not sure if I correctly calculated $\beta.$ I don't know whether one must take into account the fact that it's (presumably) a two-tailed test. Any pointers/guidance would be greatly appreciated.

• Since this is a homework question, you should add the [self-study] tag and make sure you read its wiki. – Dougal Apr 9 '15 at 3:39

i) $\alpha = P(T\leq15 \lor T\geq25)= 1- P(16 \leq T\leq24) = 1-\sum_{T=16}^{24}{{40\choose{T}}\left(\frac{1}{2}\right)^T\left(\frac{1}{2}\right)^{40-T}} \approx 0.154.$
ii) $p~~value=2*P(T\ge26|p=0.5)\approx0.0807$ So,likely fail to reject.
iii) $\beta(type~II~error)=P(16\le T \le 24 | p=0.6)=\sum_{T=16}^{24}{{40\choose{T}}\left(0.6\right)^T\left(0.4\right)^{40-T}}\approx0.846$
• The "correction" is wrong because it fails to include the possibilities $Y=15$ or $Y=25$, both of which are explicitly in the critical region. Normally that would be a minor issue, but (a) it changes the answer substantially and (b) it seems to be one of the key issues in this question. The computations of the p-value and power implicitly use a different statistical test (based on a Normal approximation rather than the exact Binomial distribution), which furthers the confusion. – whuber Nov 9 '17 at 13:45