Hypothesis Testing for Coin Flip
Premium
Question: Say you flip a coin 10 times and observe only one head. What would be your null hypothesis and p-value for testing whether the coin is fair or not?
Since the sample size is small, we compute the p-value directly via the binomial distribution. There are 10 ways to get exactly one head in 10 flips out of (2^10 = 1024) total combinations. Thus:
Null hypothesis (H0): the coin is fair (unbiased), meaning the probability of flipping a head is 0.5 Alternative (H1): the coin is unfair (biased), meaning the probability of flipping a head is not 0.5
To test this hypothesis, I would calculate a p-value which is the probability of observing a result as extreme as, or more extreme than, what I say in my sample, assuming the null hypothesis is true.
I could use the probability mass function of a binomial random variable to model the coin toss behavior and test my hypothesis. Since the H1 is that the coin is simply biased (not biased just towards tails), then this is a two-tailed test.
So, I need the probability of getting 1 head or fewer, and also 9 heads or more, assuming the coin is fair. That is P(0 heads) + P(1 head) + P(9 heads) + P(10 heads) = 0.0215 The PMF of a Binom is (n choose k) x p^k x (1-p)^n-k.
Since the p-value calculated, 0.0215 is less than 0.05 we can reject the null hypothesis and conclude the coin is likely biased.