Back to questions
Say you flip a coin 10 times and observe only one heads. What would be your null hypothesis and p-value for testing whether the coin is fair or not?
This is the same question as problem #5 in the Statistics Chapter of Ace the Data Science Interview!
The null hypothesis is that the coin is fair, and the alternative hypothesis is that the coin is biased: biased towards tails (note that this a one-sided test):
Since the sample size here is 10, you cannot apply the Central Limit Theorem and so cannot approximate a binomial using a normal distribution.
The p-value here is the probability of observing the results obtained given that the null hypothesis is true, i.e., under the assumption that the coin is fair. For 10 flips of a coin, there are 2^10 = 1024 possible outcomes, only 10 of which yield 9 tails and one heads.
Hence, the exact probability of the given result is the p-value, which is . Therefore, we can reject the null hypothesis at a 0.05 significance level.