How to manually calculate the p-value of getting at least 59 heads in 100 coin flips?

308 Views Asked by At

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:

  1. 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$
  2. 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}$
  3. $\sum_{k=59}^{100} {100\choose{k}}0,5^{100} = 0.044313$ according to Wolfram.

    What I got wrong?
2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

I get absolutely the same result, and I am quite confident your result is OK basically because the Null Hypothesis is to assume that heads and tails are both equally probable, i.e., 0.5 probability each. From the assumption that heads and tails are equally probable, you end up in a Binomial distribution. I think that the video has a mistake. He may have considered another probability distribution for heads and tails, but this would not make any sense.

I hope it helped.