Exercises: Confidence Intervals: Estimating with Uncertainty
These exercises progress from concept checks through applied confidence interval construction and sample size determination. Estimated completion time: 3 hours.
Difficulty Guide: - ⭐ Foundational (5-10 min each) - ⭐⭐ Intermediate (10-20 min each) - ⭐⭐⭐ Challenging (20-40 min each) - ⭐⭐⭐⭐ Advanced/Research (40+ min each)
Part A: Conceptual Understanding ⭐
A.1. In your own words, explain the difference between a point estimate and an interval estimate. Why is the interval estimate generally more useful?
A.2. A classmate says: "A 95% confidence interval means there is a 95% probability that the population mean is inside the interval." Explain what's wrong with this statement and provide the correct interpretation.
A.3. Another classmate responds: "Fine, but for all practical purposes, isn't it basically the same thing? Why does the distinction matter?" How would you answer?
A.4. True or false (explain each): (a) A 99% confidence interval is always wider than a 95% confidence interval computed from the same data. (b) If a 95% CI for a population mean is (42, 58), the population mean is most likely near 50. (c) If you increase the sample size, the confidence interval gets narrower. (d) The margin of error depends on the population size. (e) If the 95% CI for a proportion is (0.42, 0.58), then 95% of sample values fall between 0.42 and 0.58.
A.5. Explain the three components of a confidence interval: point estimate, critical value, and standard error. Where does each component come from?
A.6. Why do we use the t-distribution instead of the normal distribution when constructing a confidence interval for a population mean? Under what circumstances does it matter, and when is the distinction negligible?
A.7. A researcher constructs a 95% confidence interval and a 99% confidence interval from the same sample. Which interval is wider, and why? If both intervals are "correct," why would anyone ever use the narrower one?
A.8. Explain why the formula for the required sample size to estimate a mean includes $\sigma$, which is the very quantity we don't know. How do researchers handle this in practice?
Part B: CI for a Mean ⭐⭐
B.1. Dr. Maya Chen collects systolic blood pressure readings from a random sample of 50 adults in a rural community. She finds $\bar{x} = 132.4$ mmHg and $s = 21.3$ mmHg.
(a) Construct a 95% confidence interval for the true mean systolic blood pressure. (b) Interpret the interval in context. (c) The American Heart Association threshold for hypertension is 130 mmHg. Based on your interval, can Maya conclude the community's average exceeds this threshold? Explain.
B.2. Alex Rivera takes a random sample of 250 StreamVibe users and finds their average daily watch time is $\bar{x} = 54.2$ minutes with $s = 22.8$ minutes.
(a) Construct a 90% confidence interval for the true mean daily watch time. (b) Construct a 99% confidence interval. (c) How much wider is the 99% interval compared to the 90% interval? Express this as a percentage. (d) StreamVibe's investors were told the average is "about 50 minutes." Is this claim consistent with the 95% confidence interval?
B.3. A manufacturing engineer measures the tensile strength of 15 steel rods from a production batch. She finds $\bar{x} = 420$ MPa and $s = 35$ MPa. The population of tensile strengths is approximately normally distributed.
(a) Why is the normality assumption important here (more than in B.1 or B.2)? (b) Find the critical value $t^*$ for a 95% CI with $df = 14$. (c) Construct the 95% confidence interval. (d) The specification requires a mean tensile strength of at least 400 MPa. Does the interval support the claim that the batch meets specifications?
B.4. A random sample of 36 commuters in a city reveals that their average one-way commute time is 38.4 minutes with a standard deviation of 14.2 minutes.
(a) Construct a 95% confidence interval for the mean commute time. (b) How large a sample would be needed to reduce the margin of error to 2 minutes? (c) Is the answer to (b) practically achievable? Discuss.
B.5. Alex is comparing watch times between two user groups. For now, she focuses on just the Premium users. From a random sample of 80 Premium users, she finds $\bar{x} = 68.7$ minutes and $s = 19.4$ minutes.
(a) Construct a 95% CI for the mean watch time of all Premium users. (b) Her earlier CI for all users (from B.2) was roughly (51.4, 57.0). Can she conclude Premium users watch significantly more than the average user? (Hint: think about whether the intervals overlap and whether overlap tells the full story. We'll formalize this comparison in Chapter 16.)
Part C: CI for a Proportion ⭐⭐
C.1. Dr. Maya Chen surveys 800 randomly selected adults in her county and finds that 96 have been diagnosed with Type 2 diabetes.
(a) Calculate the sample proportion. (b) Verify the success-failure condition. (c) Construct a 95% confidence interval for the true prevalence. (d) The national prevalence is approximately 11.3%. Is Maya's county consistent with the national rate?
C.2. Sam Okafor tracks Daria Williams's three-point shooting over 65 attempts and finds she makes 25 of them.
(a) Construct a 95% confidence interval for Daria's true three-point shooting percentage. (b) The NBA average three-point percentage is about 36%. Does the interval suggest Daria is above or below average? (c) Why is this interval so wide? What would Sam need to narrow it? (d) How many three-point attempts would Sam need to observe to get a margin of error of ±5 percentage points?
C.3. A political poll of 1,200 randomly selected likely voters finds that 648 support Candidate A.
(a) Construct a 95% confidence interval for the proportion of all likely voters who support Candidate A. (b) Can you conclude that Candidate A will win? Why or why not? (c) The news reports this poll as "54% support, ± 3 points." Verify that the margin of error is approximately 3 percentage points. (d) What sample size would be needed to reduce the margin of error to ±1 percentage point?
C.4. A tech company surveys 400 of its employees and finds that 156 work remotely at least 3 days per week.
(a) Construct a 99% confidence interval for the proportion of all employees who work remotely at least 3 days per week. (b) How does this interval compare to the 95% CI from the same data? (c) The company's official policy assumes 35% of employees work remotely 3+ days. Is this assumption supported by the data at the 99% level?
Part D: The Tradeoff Triangle ⭐⭐
D.1. A study with $n = 100$, $\bar{x} = 75$, and $s = 20$ produces a 95% CI of approximately (71.0, 79.0).
(a) Without recalculating, predict whether the 90% CI will be wider or narrower. Then compute it. (b) Without recalculating, predict what will happen to the 95% CI width if the sample size increases to $n = 400$. Then compute it (assume $\bar{x}$ and $s$ stay the same). (c) What sample size would be needed for a 95% margin of error of exactly ±2?
D.2. Fill in the following table. For each row, one quantity changes while the others are held constant. Describe the effect on the margin of error and CI width.
| Change | Effect on MOE | Effect on CI Width | Why? |
|---|---|---|---|
| Increase confidence from 95% to 99% | ? | ? | |
| Increase $n$ from 100 to 400 | ? | ? | |
| Increase $s$ from 10 to 20 | ? | ? | |
| Decrease confidence from 95% to 90% | ? | ? | |
| Decrease $n$ from 200 to 50 | ? | ? |
D.3. A hospital administrator wants to estimate the average patient wait time. She knows from experience that $\sigma \approx 15$ minutes.
(a) How large a sample does she need for a 95% margin of error of ±3 minutes? (b) How large for ±2 minutes? (c) How large for ±1 minute? (d) What pattern do you see? Express the relationship between halving the MOE and the required sample size.
Part E: Applied Problems ⭐⭐⭐
E.1. Dr. Maya Chen designs a study to estimate the average blood lead level in children in a community near a former industrial site. She plans to use a 95% confidence interval.
(a) From previous CDC studies, the standard deviation of blood lead levels in similar communities is approximately $\sigma = 3.5$ $\mu$g/dL. If Maya wants a margin of error of no more than 0.5 $\mu$g/dL, what sample size does she need? (b) She collects data from 200 children and finds $\bar{x} = 4.8$ $\mu$g/dL and $s = 3.2$ $\mu$g/dL. Construct a 95% CI. (c) The CDC "reference value" for blood lead in children is 3.5 $\mu$g/dL — children above this level warrant medical follow-up. Based on the CI, should Maya be concerned about lead exposure in this community? Explain. (d) Why might a 99% CI be more appropriate than a 95% CI in this context?
E.2. Alex Rivera wants to estimate the proportion of StreamVibe users who would upgrade to a new "Premium Plus" tier priced at $19.99/month. She runs a survey of 500 randomly selected users and finds that 85 say they would "definitely" or "probably" upgrade.
(a) Construct a 95% CI for the proportion interested in upgrading. (b) StreamVibe has 2 million users. If the true proportion is at the lower end of your CI, how many users would upgrade? If it's at the upper end? (c) At $19.99/month, what's the range of annual revenue this represents? (d) The business team says the new tier is profitable only if at least 200,000 users upgrade. Based on your CI, is the new tier a good bet?
E.3. Professor James Washington is analyzing data from a predictive policing algorithm. He examines a random sample of 150 cases flagged as "high risk" by the algorithm and finds that only 57 of these individuals were actually rearrested within two years.
(a) Construct a 95% confidence interval for the algorithm's positive predictive value (the proportion of "high risk" flags that correspond to actual rearrest). (b) The algorithm's developers claim a 50% positive predictive value. Is this claim supported by Washington's data? (c) What are the ethical implications of this finding? (Think about what happens to the other 62% who were flagged as high risk but were never rearrested.) (d) Washington also notices that the PPV differs by race. For Black defendants, $\hat{p} = 33/90 = 0.367$; for white defendants, $\hat{p} = 24/60 = 0.400$. Construct 95% CIs for each group. Do the intervals overlap? What does this suggest? (Full formal comparison will come in Chapter 16.)
Part F: Python Practice ⭐⭐
F.1. Write Python code to:
(a) Generate a random sample of $n = 50$ values from a normal distribution with $\mu = 100$ and $\sigma = 15$.
(b) Compute the 95% CI for the mean using scipy.stats.t.interval().
(c) Check whether the true $\mu = 100$ falls within the CI.
(d) Repeat (a)-(c) 1,000 times and count how many CIs contain $\mu = 100$. Does the result match the expected 95%?
F.2. Using the simulation from F.1, create a plot showing 50 confidence intervals, with those that miss $\mu = 100$ highlighted in red.
F.3. Write a function ci_mean(data, confidence=0.95) that takes a NumPy array and a confidence level and returns a tuple (lower, upper, margin_of_error). Test it on a sample dataset.
F.4. Write a function ci_proportion(successes, n, confidence=0.95) that computes a confidence interval for a proportion. Include input validation that checks the success-failure condition and prints a warning if it's not met.
Part G: Critical Thinking and Interpretation ⭐⭐⭐
G.1. A newspaper reports: "A new survey finds that 62% of Americans support the policy, with a margin of error of ±4 percentage points."
(a) What is the 95% confidence interval? (b) Can you conclude that a majority of Americans support the policy? Why or why not? (c) What sample size was likely used? (Work backward from the margin of error, assuming $\hat{p} = 0.62$.) (d) If the newspaper had reported a 99% margin of error instead of 95%, would it be larger or smaller than ±4 points?
G.2. Two studies measure the same quantity: - Study A: $n = 100$, 95% CI = (45, 55) - Study B: $n = 1{,}000$, 95% CI = (48, 52)
(a) Which study provides a more precise estimate? How can you tell? (b) If both studies are valid, is it surprising that the intervals overlap? Why or why not? (c) Which study would you trust more? Why?
G.3. A pharmaceutical company reports a 95% CI for the effect of their new drug on cholesterol as (-5, +15) mg/dL. A competitor's drug has a 95% CI of (+8, +12) mg/dL.
(a) Which drug has a more precisely estimated effect? (b) Can you conclude that the first drug works? Why or why not? (c) Can you conclude that the second drug works? (d) Which drug would you prefer to prescribe? Consider both the effectiveness and the certainty of the evidence.
G.4. Sam is confused about sample size and precision. He asks: "If I want to cut my margin of error in half, I just need to double my sample size, right?" Explain why this is wrong and provide the correct relationship.
Part H: Challenge Problems ⭐⭐⭐⭐
H.1. The Coverage Simulation (Python)
Design and run a simulation to investigate the following question: "What happens to the actual coverage rate of a 95% CI when the population is strongly skewed and the sample size is small?"
(a) Create a right-skewed population (e.g., exponential with $\lambda = 1$). (b) For sample sizes $n = 5, 10, 15, 30, 50, 100$, simulate 10,000 95% confidence intervals for the mean. Record what proportion actually contain the true population mean. (c) Create a plot showing actual coverage rate vs. sample size. Add a horizontal line at 95%. (d) At what sample size does the actual coverage rate get close to the nominal 95%? (e) What does this tell you about the "n ≥ 30 rule" for the CLT?
H.2. The Width Exploration
Mathematically derive the relationship between the width of a confidence interval and each of the following: (a) The confidence level (show that width is proportional to $z^*$ or $t^*$) (b) The sample size (show that width is proportional to $1/\sqrt{n}$) (c) The population variability (show that width is proportional to $\sigma$)
Then create a three-panel Python visualization showing each relationship graphically.
H.3. The Polling Paradox
A poll of 1,000 likely voters finds 52% support for Candidate A, with a margin of error of ±3.1 percentage points (95% CI).
(a) The 95% CI is (48.9%, 55.1%). Can you declare Candidate A the likely winner? (b) Now suppose a second independent poll of 1,000 voters finds 49% support for Candidate A. Its 95% CI is (45.9%, 52.1%). Both CIs contain 50%. Are the two polls contradictory? (c) If you could combine both polls into a single sample of 2,000 (1,010 supporting A out of 2,000), what's the new 95% CI? Is this more informative? (d) Discuss: when the news says an election is "within the margin of error," what are they really saying? Is this a statement about the poll, the election, or both?
H.4. Bayesian vs. Frequentist Interpretation
Research the Bayesian interpretation of intervals (called "credible intervals") and compare it to the frequentist confidence interval you learned in this chapter.
(a) In the Bayesian framework, can you say "there is a 95% probability that $\mu$ is in the interval"? Why or why not? (b) What additional information does the Bayesian approach require (hint: a prior)? (c) For large sample sizes, do Bayesian credible intervals and frequentist confidence intervals tend to agree? Why? (d) Write a paragraph arguing for each interpretation. Which do you find more intuitive?
(This connects back to Bayes' theorem from Chapter 9 and previews a philosophical debate that runs through all of statistics.)