I encountered the following question while I was preparing for data science interviews:
You are running for office and your pollster polled 100 people. 60 of them claimed they will vote for you. Can you relax?
The solution of the problem goes like this:
- Assume that there’s only you and one other opponent.
- Also, assume that we want a 95% confidence interval. This gives us a z-score of 1.96.
- Confidence interval formula: $$\hat{p}\,\pm z^{\ast}\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$$ where p-hat = 60/100 = 0.6, z* = 1.96, n = 100
...
Can someone explain where the formula for confidence interval comes from (e.g. assumptions made about the population distribution)? I know how to calculate the confidence interval when the population variance and mean are known, but I couldn't figure how the article writer came up with this specific formula.
Thank you in advance!