Last Updated: March 2024
Problem#
How can you calculate the confidence interval for the proportion of heads in a series of coin tosses?
Solution#
We assume the coin tosses are independent and the sample size is large enough. Given this we can use the following formula to compute our confidence interval of the proportion of tossing heads.
Formula
The formula for calculating the confidence interval for a proportion is:
CI = (P.hat – z* x SE, P.hat + z* x SE)
Where:
- CI: Confidence interval
- P.hat: Sample proportion of heads (number of heads / total tosses)
- z*: Critical z-score corresponding to the desired confidence level (e.g., 1.96 for 95% confidence)
- n: Sample size (total number of coin tosses)
- SE: standard error which is square root [p.hat(1-p.hat) / n]
Steps
- Calculate the sample proportion (p̂): Divide the number of heads by the total number of coin tosses.
- Determine the confidence level: Choose your desired confidence level (e.g., 90%, 95%, 99%).
- Find the critical value (z*): Look up the z-score in a standard normal distribution table based on your confidence level. Common values:
- 90% confidence: z* = 1.645
- 95% confidence: z* = 1.96
- 99% confidence: z* = 2.576
- Calculate the margin of error: Multiply the z-score by the square root of [(p.hat(1-p.hat) / n)]
- Construct the confidence interval: Add and subtract the margin of error from the sample proportion (p.hat).
Example
Let’s say you toss a coin 100 times and get 52 heads. Here’s how to calculate the 95% confidence interval:
- Sample proportion (p.hat): 52 / 100 = 0.52
- Confidence level: 95%
- Critical value (z*):** 1.96
- Margin of error: 1.96 * √[(0.52 * 0.48) / 100] ≈ 0.098
- Confidence Interval: 0.52 ± 0.098 = (0.422, 0.618)
Interpretation
We can be 95% confident that the true proportion of heads for this coin lies between 42.2% and 61.8%.