Back to homeMathematics · Integrated Math III · Change subject
Start for free
Math III · Mathematics
Statistical inference · Inference

Confidence Intervals

A headline reads: "54% of U.S. teens watch short videos every day (margin of error ±3 percentage points)." Emma wonders how a survey of about 1,000 teens can say anything about millions of them, and what that "±3" really promises. By the end of this page you will be able to answer both questions.

Point Estimates and Margin of Error

We almost never get to measure a whole population. Instead we take a random sample and use it to estimate a parameter, the true value for the population.

A point estimate is almost never exactly right, because a different sample would give a different number. So we report a range around it.

For a proportion, the standard error is $\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n}}$, and the critical value is $z^*$. The $z^*$ value is chosen from the confidence level: the middle $C\%$ of a standard normal curve lies between $-z^*$ and $z^*$.

Confidence level 90% 95% 98% 99%
$z^*$ 1.645 1.960 2.326 2.576

The estimate sits exactly in the middle of the interval. So if you are given the two endpoints, you can work backward:

$$\text{estimate} = \frac{\text{lower} + \text{upper}}{2}, \qquad \text{ME} = \frac{\text{upper} - \text{lower}}{2}$$
Practice★☆☆Not started
A recent survey of $500$ randomly selected registered voters in a large county in Texas found that $280$ of them support a new property tax initiative. Calculate the…

A recent survey of $500$ randomly selected registered voters in a large county in Texas found that $280$ of them support a new property tax initiative. Calculate the point estimate for the true proportion of voters who support the initiative, and compute the margin of error for a $95\%$ confidence interval. Use $z^* = 1.96$.

Solve
Practice★☆☆Not started
The Department of Transportation in Georgia computes a $90\%$ confidence interval for the true mean commute time (in minutes) of residents in Atlanta. The calculated…

The Department of Transportation in Georgia computes a $90\%$ confidence interval for the true mean commute time (in minutes) of residents in Atlanta. The calculated interval is $(28.4, 32.6)$. Identify the point estimate (sample mean) and the margin of error used to construct this interval.

Solve
Practice★☆☆Not started
A local bakery in New York City sells an average of $\bar{x} = 210$ bagels per day based on a random sample of $35$ days, with a margin of error of $14$ bagels for a…

A local bakery in New York City sells an average of $\bar{x} = 210$ bagels per day based on a random sample of $35$ days, with a margin of error of $14$ bagels for a $95\%$ confidence interval. Write out the $95\%$ confidence interval and provide a correct interpretation of the interval in the context of the problem.

Solve

Interpreting Confidence Intervals and Confidence Levels

Getting the interval is the easy part. Saying what it means is where most points are lost on the AP exam.

Imagine the true mean $\mu$ is fixed but unknown. Each random sample gives a different interval. Some intervals capture $\mu$ and some miss it.

Eight confidence intervals from eight different samples: seven capture the true mean and one misses it. true mean μ misses μ Blue: captures μ. Orange: misses μ.

Also, "95% confident" does not mean the sample mean is likely to fall in the interval. The sample mean is always the center of its own interval.

You can also use an interval to judge a claim. If a value is not in the interval, it is not a plausible value for the parameter at that confidence level. If it is in the interval, it remains plausible, but that does not prove it is the true value.

Practice★☆☆Not started
A marine biologist is studying the average weight of a specific species of salmon in the Pacific Northwest. She constructs a $99\%$ confidence interval for the true mean…

A marine biologist is studying the average weight of a specific species of salmon in the Pacific Northwest. She constructs a $99\%$ confidence interval for the true mean weight and writes: "We are $99\%$ confident that the interval from $12.4$ pounds to $15.2$ pounds captures the true mean weight of this salmon species."

Explain exactly what the phrase "$99\%$ confident" means in the context of repeated sampling.

Solve
Practice★★☆Not started
A statistics student uses the same sample data to construct three different confidence intervals for a population mean, as shown in the visual above. The confidence…
Parameter Value Point Estimate Interval A Interval B Interval C

A statistics student uses the same sample data to construct three different confidence intervals for a population mean, as shown in the visual above. The confidence levels used are $90\%$, $95\%$, and $99\%$.

Match each interval (A, B, and C) to its corresponding confidence level. Explain the mathematical relationship between the confidence level and the margin of error that justifies your answer, assuming the sample size and sample standard deviation remain constant.

Solve
Practice★★★Not started
A major trucking company in Texas calculates a $90\%$ confidence interval for the mean lifespan (in miles) of a specific brand of commercial tires. The interval is…

A major trucking company in Texas calculates a $90\%$ confidence interval for the mean lifespan (in miles) of a specific brand of commercial tires. The interval is $(78,500, 82,100)$.

A manager reads the report and makes the following four statements:

  1. "$90\%$ of the tires in our sample lasted between $78,500$ and $82,100$ miles."

  2. "There is a $90\%$ probability that the true mean lifespan of all tires of this brand is between $78,500$ and $82,100$ miles."

  3. "If we took $100$ different random samples of the same size, exactly $90$ of the resulting intervals would contain the true mean lifespan."

  4. "We are $90\%$ confident that the sample mean lifespan is between $78,500$ and $82,100$ miles."

Identify why each of these four statements is a statistically incorrect interpretation of the confidence interval or the confidence level.

Solve

Conditions for Inference

The formulas only give a trustworthy interval if the data were collected well. Always check the conditions before calculating, and write them down.

Three conditions for a confidence interval: Random, 10 percent, and Large Counts or Normal. Random SRS or random assignment 10% condition n ≤ 10% of the population Normal / Large Counts proportion: counts ≥ 10 mean: n ≥ 30 or no skew
Practice★☆☆Not started
A high school principal in Chicago wants to estimate the proportion of seniors who plan to attend a four-year college. She selects a simple random sample of $30$ seniors…

A high school principal in Chicago wants to estimate the proportion of seniors who plan to attend a four-year college. She selects a simple random sample of $30$ seniors from the senior class of $800$ students. In the sample, $24$ students say they plan to attend a four-year college. Check if the "Large Counts" (Normality) condition is met for constructing a confidence interval for the population proportion. Show your work and state your conclusion.

Solve
Practice★★☆Not started
A local gym in Denver wants to estimate the average amount of time its members spend working out per visit. The manager stands by the front door on a Monday morning from…

A local gym in Denver wants to estimate the average amount of time its members spend working out per visit. The manager stands by the front door on a Monday morning from 8:00 AM to 10:00 AM and asks the first $40$ members who leave how long they worked out. The $95\%$ confidence interval calculated from this data is $(45.2, 58.6)$ minutes.

Identify which condition for constructing a confidence interval is violated in this scenario. Explain how this violation could introduce bias into the estimate of the true mean workout time for all gym members.

Solve
Practice★★★Not started
A factory in Pennsylvania manufactures baseballs. The production manager takes a random sample of $400$ baseballs from the assembly line and finds that $12$ of them have…

A factory in Pennsylvania manufactures baseballs. The production manager takes a random sample of $400$ baseballs from the assembly line and finds that $12$ of them have defective stitching.

The manager wants to construct a confidence interval, but the intern points out a potential issue with the conditions for inference. Check the conditions for constructing a $95\%$ confidence interval for the true proportion of defective baseballs. If a condition is violated, identify it and explain why the standard $1$-Prop Z-Interval formula might not yield a strictly valid interval in this specific mathematical context.

Solve

One-Proportion z-Interval

Why does this work? When the conditions hold, the sampling distribution of $\hat{p}$ is approximately normal and centered at $p$, with standard deviation about $\sqrt{\hat{p}(1-\hat{p})/n}$. About $C\%$ of samples give a $\hat{p}$ within $z^*$ standard errors of $p$.

On the AP exam, answer in four steps: State the parameter and the confidence level, Plan (name the procedure and check conditions), Do (calculate), Conclude (interpret in context). On a TI-84 the tool is STAT → TESTS → A:1-PropZInt.

Number line showing the interval from 0.553 to 0.687 centered at the sample proportion 0.62. 0.500.550.600.650.700.75 p̂ = 0.62 0.553 0.687

When Large Counts fails: the plus-four interval

If the sample has fewer than 10 successes or fewer than 10 failures, the normal model is poor and the standard interval can capture $p$ less often than advertised. A common fix is the plus-four (Agresti-Coull) method. Add 2 successes and 2 failures to the data, then use the same formula:

$$\tilde{p} = \frac{x + 2}{n + 4}, \qquad \tilde{p} \pm z^*\sqrt{\frac{\tilde{p}(1-\tilde{p})}{n + 4}}$$
Practice★★☆Not started
A software company in Silicon Valley is testing a new user interface. They take a simple random sample of $150$ users and find that $96$ of them prefer the new interface…

A software company in Silicon Valley is testing a new user interface. They take a simple random sample of $150$ users and find that $96$ of them prefer the new interface over the old one.

Verify that all conditions for inference are met (assume the company has over $10,000$ users). Then, construct and interpret a $95\%$ confidence interval for the true proportion of all users who prefer the new interface.

Solve
Practice★★☆Not started
A public health official claims that more than half of the adults in a Texas county have received the annual flu vaccine. A random sample of $300$ adults in the county…

A public health official claims that more than half of the adults in a Texas county have received the annual flu vaccine. A random sample of $300$ adults in the county reveals that $162$ of them have received the vaccine.

Construct a $95\%$ confidence interval for the true proportion of adults in the county who have received the vaccine. Based strictly on your confidence interval, is there convincing evidence to support the official's claim? Explain your reasoning.

Solve
Practice★★★Not started
A local school district in Illinois wants to estimate the true proportion of elementary school students who are reading below grade level. They take a simple random…

A local school district in Illinois wants to estimate the true proportion of elementary school students who are reading below grade level. They take a simple random sample of $80$ students and find that $6$ of them are reading below grade level.

  1. Show mathematically that the Large Counts condition for constructing a standard $1$-Prop Z-Interval is not met.

  2. Because the condition fails, the standard interval is invalid. A statistician suggests using the "Plus Four" (Agresti-Coull) method, which adds $2$ successes and $2$ failures to the sample before calculating the interval. Calculate the new pseudo-sample proportion $\tilde{p}$ and construct the $95\%$ confidence interval using this adjusted method.

Solve

The t Distribution and Critical Values

For a mean, the standard deviation of $\bar{x}$ is $\dfrac{\sigma}{\sqrt{n}}$. But we almost never know the population standard deviation $\sigma$. We replace it with the sample standard deviation $s$, which gives the standard error:

$$\text{SE}_{\bar{x}} = \frac{s}{\sqrt{n}}$$

That substitution adds extra uncertainty, since $s$ changes from sample to sample. To account for it, we use a t distribution instead of the normal curve.

A standard normal curve and a t distribution with small degrees of freedom: the t curve is lower in the middle and has heavier tails. normal t (small df) Heavier tails, lower peak

Heavier tails mean we must go further from the center to capture the middle $C\%$. So for the same confidence level, $t^* > z^*$, and the smaller the sample, the bigger $t^*$.

df 90% 95% 99%
10 1.812 2.228 3.169
20 1.725 2.086 2.845
30 1.697 2.042 2.750
$\infty$ ($z^*$) 1.645 1.960 2.576

On a TI-84, use invT(area to the left, df). For a $C\%$ interval the area to the left is $1 - \dfrac{1 - C}{2}$. For 95% confidence it is $0.975$.

Practice★☆☆Not started
A quality control engineer at a factory in Michigan takes a random sample of $18$ car batteries and measures their lifespan in months. The sample mean is $42.5$ months…

A quality control engineer at a factory in Michigan takes a random sample of $18$ car batteries and measures their lifespan in months. The sample mean is $42.5$ months with a sample standard deviation of $3.2$ months. Assuming the population of battery lifespans is approximately normally distributed, determine the critical value $t^*$ that should be used to construct a $95\%$ confidence interval for the true mean lifespan.

Solve
Practice★☆☆Not started
To estimate the true mean price of a gallon of regular unleaded gas in Florida, a consumer advocacy group takes a simple random sample of $45$ gas stations. The sample…

To estimate the true mean price of a gallon of regular unleaded gas in Florida, a consumer advocacy group takes a simple random sample of $45$ gas stations. The sample mean is $\$3.45$ and the sample standard deviation is $\$0.18$. Calculate the $90\%$ confidence interval for the true mean price of a gallon of gas. Use $t^* = 1.680$.

Solve

Constructing a t-Interval

Use the same four steps as before: State, Plan, Do, Conclude. The only change is the third condition. For a mean, you must justify that the sampling distribution of $\bar{x}$ is approximately normal.

You can also work backward from an interval, just as with proportions. The midpoint gives $\bar{x}$ and half the width gives $\text{ME}$. Since $\text{ME} = t^*\dfrac{s}{\sqrt{n}}$, solve for $s$:

$$s = \frac{\text{ME}\cdot\sqrt{n}}{t^*}$$ Number line with the interval from 62 to 70, center 66, and margin of error 4 on each side. 62 66 70 ME = 4 ME = 4
Practice★★☆Not started
A researcher is analyzing the wingspan of the American Bald Eagle. A random sample of $22$ adult eagles yields a mean wingspan of $79.2$ inches with a standard deviation…

A researcher is analyzing the wingspan of the American Bald Eagle. A random sample of $22$ adult eagles yields a mean wingspan of $79.2$ inches with a standard deviation of $3.8$ inches. A dotplot of the sample data shows no strong skewness and no outliers.

Construct a $98\%$ confidence interval for the true mean wingspan of adult American Bald Eagles. State the degrees of freedom and the critical value used.

Solve
Practice★★☆Not started
An agricultural researcher calculates a $90\%$ confidence interval for the mean yield (in bushels per acre) of a new variety of corn in Iowa. Based on a simple random…

An agricultural researcher calculates a $90\%$ confidence interval for the mean yield (in bushels per acre) of a new variety of corn in Iowa. Based on a simple random sample of $36$ plots, the interval is $(185.4, 194.6)$.

Using the formula for the margin of error of a one-sample t-interval, work backwards to determine the sample standard deviation ($s$) of the corn yields. (Use $t^* = 1.690$ for your calculation).

Solve
Practice★★★Not started
The city council of Austin, Texas, is considering a new municipal bond to fund public parks. To proceed, they need two pieces of information from their constituents: 1.…

The city council of Austin, Texas, is considering a new municipal bond to fund public parks. To proceed, they need two pieces of information from their constituents:

  1. The proportion of residents who support the bond.

  2. The mean amount of additional annual property tax residents are willing to pay for these parks.

A random sample of $250$ residents is surveyed. Of those, $145$ support the bond. The sample mean for the amount they are willing to pay is $\$42.50$ with a sample standard deviation of $\$18.20$.

Construct a $99\%$ confidence interval for the true proportion of supporters, and a $95\%$ confidence interval for the true mean amount residents are willing to pay.

The council will only put the bond on the ballot if they are highly confident that a majority (more than $50\%$) support it, AND if the lower bound of the mean willingness to pay is at least $\$40.00$. Based on your intervals, what should the city council decide? Justify your answer.

Solve

What Controls the Width of an Interval

A narrow interval is more precise, so we want it. But three things affect the margin of error $\text{ME} = (\text{critical value}) \times \text{SE}$:

Change Effect on ME Why
Higher confidence level Wider Larger $z^*$ or $t^*$ is needed to capture the middle $C\%$
Larger sample size $n$ Narrower SE has $\sqrt{n}$ in the denominator
More variability ($\hat{p}$ near 0.5, or larger $s$) Wider Individuals vary more, so estimates vary more

There is a trade-off between confidence and precision. A 99% interval is more likely to capture the parameter than a 90% interval, but it is wider and says less.

The sample size effect is not proportional. Because of the square root, to cut the margin of error in half, you need four times as many observations. Use the slider to see how the margin of error for a proportion (with $\hat{p} = 0.5$) changes with $n$ and with the critical value $z$.

Practice★★★Not started
A popular coffee shop chain in Boston claims that their drip coffee is served at an optimal mean temperature of $160^\circ\text{F}$. A skeptical customer takes a random…
150 155 160 165 170 Coffee Temperature (°F)

A popular coffee shop chain in Boston claims that their drip coffee is served at an optimal mean temperature of $160^\circ\text{F}$. A skeptical customer takes a random sample of $12$ cups of coffee over a month and records their temperatures. The dotplot of the sample data is shown above. The sample mean is $160.5^\circ\text{F}$ and the sample standard deviation is $4.6^\circ\text{F}$.

First, discuss whether the conditions for constructing a one-sample t-interval are satisfied, referencing the provided dotplot. If the conditions are met, calculate a $95\%$ confidence interval for the true mean temperature of the coffee. Does the interval provide convincing evidence that the coffee shop's claim is false?

Solve
Practice★★★Not started
A researcher takes a random sample of $n = 5$ observations to estimate a population mean $\mu$. The sample mean is $\bar{x} = 104$ and the sample standard deviation is…
Value Density Standard Normal t-distribution

A researcher takes a random sample of $n = 5$ observations to estimate a population mean $\mu$. The sample mean is $\bar{x} = 104$ and the sample standard deviation is $s = 12$. The population is known to be normally distributed.

Initially, the researcher calculates a $95\%$ confidence interval using the appropriate t-distribution (shown as the dashed orange curve in the SVG). Suddenly, a previous census report is discovered, revealing that the true population standard deviation is exactly $\sigma = 12$. The researcher recalculates the $95\%$ confidence interval, this time using the standard normal distribution (solid blue curve).

Calculate both confidence intervals. Using the visual properties of the curves provided in the SVG, explain theoretically why the margin of error changes the way it does when moving from the t-distribution to the standard normal distribution.

Solve

Choosing a Sample Size

Before collecting data, we can decide how large $n$ must be so the margin of error is no bigger than a target $m$. Set $\text{ME} \le m$ and solve for $n$.

For a proportion you need a guess for $\hat{p}$. If you have a prior estimate from an earlier study, use it. If you have none, use $\hat{p} = 0.5$. This is the conservative choice, because $\hat{p}(1-\hat{p})$ is largest at $0.5$ (it equals $0.25$), so it guarantees a large enough sample whatever the true value is.

For a mean, use a reasonable estimate of the population standard deviation $\sigma$ (from past studies or a pilot sample). We use $z^*$ here because $n$ is not known yet, so we cannot get the degrees of freedom for $t^*$.

Costs matter too. If each person sampled costs money, compute the required $n$ first, then multiply by the cost per person and compare with the budget. If the budget is too small, you can work backward: the largest affordable $n$ gives the smallest achievable margin of error $\text{ME} = z^*\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n}}$.

Closing the hook. Emma's headline reported a margin of error of $\pm 3$ points. With 95% confidence and $\hat{p} = 0.5$, we need $n \ge \left(\dfrac{1.96}{0.03}\right)^2(0.25) \approx 1{,}067.1$, so $n = 1{,}068$. That is why national polls survey "about 1,000" people. A well-chosen random sample of that size can speak for millions of teens, and the margin of error tells you how much to trust the number.

Practice★☆☆Not started
A fast-food chain wants to estimate the proportion of its customers who would purchase a new plant-based burger. They want the margin of error to be no more than $0.04$…

A fast-food chain wants to estimate the proportion of its customers who would purchase a new plant-based burger. They want the margin of error to be no more than $0.04$ with $95\%$ confidence ($z^* = 1.96$). Since they have no prior information about the true proportion, they use a conservative estimate of $\hat{p} = 0.5$. Calculate the minimum sample size required to meet these conditions.

Solve
Practice★★☆Not started
An urban planner in Seattle is researching the monthly rent for one-bedroom apartments in the downtown area. She wants to estimate the true mean rent with $95\%$…

An urban planner in Seattle is researching the monthly rent for one-bedroom apartments in the downtown area. She wants to estimate the true mean rent with $95\%$ confidence and a margin of error of no more than $\$50$. Based on previous studies, she assumes the population standard deviation is approximately $\sigma = \$220$.

Calculate the minimum sample size of apartments she needs to randomly select to achieve this margin of error.

Solve
Practice★★★Not started
An environmental agency wants to estimate the true proportion of households in California that have installed solar panels. They want the margin of error to be no more…

An environmental agency wants to estimate the true proportion of households in California that have installed solar panels. They want the margin of error to be no more than $0.02$ with $99\%$ confidence.

The agency has a strict budget of $\$15,000$ for the survey, and each household sampled costs $\$4.50$ to process.

Determine the required sample size to meet the statistical goals (assuming no prior estimate for $p$). Can the agency achieve their desired margin of error and confidence level within their budget? If not, what is the smallest margin of error they can achieve with $99\%$ confidence using their entire budget?

Solve

Summary

  • A confidence interval is estimate $\pm$ margin of error, where $\text{ME} = (\text{critical value}) \times \text{SE}$. The estimate is the midpoint of the interval.

  • Interpret an interval as: "We are $C\%$ confident that the interval from $a$ to $b$ captures the true [parameter in context]." The confidence level describes the long-run success rate of the method.

  • Check conditions first: Random, 10%, and Large Counts (proportions) or Normal/$n \ge 30$ (means).

  • Proportion: $\hat{p} \pm z^*\sqrt{\hat{p}(1-\hat{p})/n}$. Mean: $\bar{x} \pm t^* s/\sqrt{n}$ with $df = n - 1$.

  • Higher confidence makes the interval wider. A larger $n$ makes it narrower, and cutting ME in half takes four times the sample.

  • Sample size: $n \ge (z^*/m)^2\hat{p}(1-\hat{p})$ or $n \ge (z^*\sigma/m)^2$. Use $\hat{p} = 0.5$ if there is no prior estimate, and always round up.

See all the exercises in this section