This is an example from a video on Khan Academy: Rahim heard that spinning rather than flipping a coin raies the probability of getting heads above 50%. He tested this by spinning 10 different pennies 10 times each. His hypotheses were $H_0 : p = 0.5$ and $H_a : p > 0.5$, where $p$ is the true proportion of spins that a penny would land showing heads.
In his 100 spins, the penny landes showing heads in 59 spins. Rahim calculated that statistics $\hat{p} = \frac{59}{100}$ had an assosiated $p$-value of approximately 0.036.
My question: how was the $p$-value calculated? This is how I tried and got different result:
- Considered p-value is a probability of getting 59 or more heads from 100 spins given that $H_o$ is true. It can be obtained by adding probabilities of getting $k$ heads for $k = 59, 60, ... 100$
- Probability of getting $k$ heads from $n = 100$ flips is ${{n}\choose{k}} 0,5^{k}0,5^{n-k} = {100\choose{k}}0,5^{100}$
- $\sum_{k=59}^{100} {100\choose{k}}0,5^{100} = 0.044313$ according to Wolfram.
What I got wrong?
Reversing engineering the official result suggests that they used the normal approximation casually, without making any adjustment for continuity. The binomial computation is better.
To be precise: The associated normal approximation has mean $50$ and standard deviation $\sigma =\sqrt {100\times .5\times .5}=5$. If you sample from this distribution, then the probability of drawing $59$ or greater is $.03593$, matching the official solution.
Of course, if you are going to use the normal approximation, you should use the standard continuity correction. If you sample from the normal, the probability of drawing $58.5$ or greater is $.044565$ which, unsurprisingly, closely lines up with the exact value provided by the binomial distribution.