Hypothesis testing vs. Binomial distribution

probability

A coin is tossed 5 times, and lands heads on 4 of them. Test the hypothesis that the coin is fair versus
the alternative that it is biased towards heads, at a signicance level of 20%. Make sure to write down
the null, the alternative, the box, and the P-value. State your conclusion carefully.

My solution is:

Null: The coin is fair therefore # of heads = 50%
Alternative: # of heads >= 50%

The expected percentage of # of heads is 50%. The observed percentage is $\frac{4}{5}=80%$

The SE% of the # of heads is $\frac {0.5}{\sqrt{5}}*100=$22.4%

Then we have:

$z=\frac{0.8-0.5}{0.224}=1.339$

Area to the left of 1.33 is equal to 9.18% thus we reject the null hypothesis.

However, the solution given to this problem instead used binomial distribution:

$X\geqslant 4 =P(X=4)+P(X=5)= \frac{6}{32}=0.1875 \leqslant 0.2$

I don't understand why the probability is 0.1875 and not 0.0918? Is it wrong to not use the binomial method to solve this problem??

Thank you!

Best Answer

Suppose $\theta$ is the probability that a single coin toss results in heads. Then

$$H_0 : \theta = 0.5 \quad \text{vs.} \quad H_a : \theta > 0.5.$$

The test statistic we will use is based on the binomial distribution; i.e., if $X$ is the number of heads observed in $n$ tosses, then $$X \mid H_0 \sim \operatorname{Binomial}(n, \theta = 0.5).$$

If we observe $X = 4$ heads in $n = 5$ tosses, then the $p$-value corresponding to this test statistic is $$p = \Pr[X \ge 4 \mid H_0] = \left(\binom{5}{4} + \binom{5}{5}\right)\frac{1}{2^5}.$$ This represents the exact probability that we would obtain a result at least as extreme as what we observed if the null were true, and if our tolerance for Type I error is set to $\alpha = 0.20$, we reject $H_0$ and conclude that the data suggests the coin is biased in favor of heads at this significance level.

A normal approximation would be inappropriate for this test due to the small sample size. Moreover, if you used a normal approximation anyway, a continuity correction is required; thus such a test statistic would have the value $$Z \mid H_0 = \frac{4 - 2.5 - \color{red}{0.5}}{\sqrt{5(1/2)(1/2)}} = 0.894427$$ and the $p$-value is $1 - \Phi(0.894427) = 0.185547$. This is much closer to the exact $p$-value of $6/32 = 0.1875$ and demonstrates that the dominant source of error in your calculation has to do with not employing continuity correction. The structural flaw in your solution, however, remains the use of a normal approximation in the first place, when the test neither requires nor benefits from doing so.