Margin of error and sample size practice problems
By Jude Wallis · Updated
These eight problems run the margin of error formula both directions: forward from a critical value and standard error to a margin, and backward from a target margin to the sample size you need. Every sample size rounds up unless it lands exactly on a whole number.
AP Statistics: Unit 3 (topics 3.3 Constructing a Confidence Interval for a Population Proportion, 3.4 Justifying a Claim Based on a Confidence Interval for a Population Proportion). Topic 3.3 in the Fall 2026 course asks you to calculate the margin of error and estimate a sample size from it, topic 3.4 covers how sample size and confidence level change the interval width, and the sample size formula for a mean in problem 7 is standard college content that the AP course does not cover.
What these problems build
These eight problems work the margin of error formula in both directions. Forward, you take a critical value (z-star, written ) and a standard error and produce the margin of error. Backward, you name the margin of error you want and solve for the sample size that delivers it:
Two rules do most of the work. A sample size always rounds up to the next whole person or unit, because rounding down leaves the margin of error above your target. And when you have no prior estimate of the proportion, you use the conservative planning value (p-star, written ) , which maximizes at 0.25 and so gives the largest sample any true proportion could demand.
For the interval machinery behind all of this, read how to calculate a confidence interval. Check your margins against the margin of error calculator and your sample sizes against the sample size calculator. The matching AP topic page is 3.3 Constructing a Confidence Interval for a Population Proportion.
Use the standard critical values 1.645, 1.96, and 2.576, keep the standard error to at least four decimals until the last step, and round every sample size up unless it lands exactly on a whole number. When the arithmetic is solid, move on to interpreting confidence intervals, where the answers are sentences.
Problem 1
A streaming service surveys a random sample of 400 subscribers and finds that 320 finished the new season within a week. Treat the sample as under 10% of all subscribers. Find the margin of error for a 95% confidence interval for the true proportion who finish within a week, then write the interval.
Show the worked solution
Sample proportion (p-hat, written ): .
Check the large counts condition: and .
Standard error (the typical sample-to-sample spread of ): .
Critical value for 95% confidence: .
Margin of error: .
Interval: .
The margin of error is 0.0392, about 3.9 percentage points, and the 95% interval is .
Problem 2
A polling firm wants a 95% confidence interval for the proportion of registered voters who plan to vote in a local election. The margin of error must be no more than 0.03 (3 percentage points), and the firm has no prior estimate of the proportion. How many voters must it survey?
Show the worked solution
With no prior estimate, use the conservative planning value , so .
Rearranging for gives $$
For 95% confidence , and the target is .
The quotient repeats, so square the ratio as a fraction instead of squaring a rounded decimal: .
Multiply by 0.25: .
Round up, never down. A sample of 1067 would leave the margin of error a hair above 0.03, so the answer is 1068.
The firm needs 1068 voters. This is the calculation behind national polls that report about 3 points of margin from a sample near 1,000.
Problem 3
A campus dining service ran a pilot survey last year and found that about 40% of students bought lunch on campus at least three days a week. It now wants a 95% confidence interval with a margin of error of 0.05. Using the pilot result as the planning value, how many students should it survey?
Show the worked solution
Use the pilot result as the planning value: , so .
Apply with and .
Divide: .
Square: .
Multiply by 0.24: .
Round up: 369 students.
They should survey 369 students. A trustworthy prior estimate lets you get by with a smaller sample than the conservative would require.
Problem 4
A city wants a 90% confidence interval for the proportion of households that compost, with a margin of error of 0.04.
(a) The city has no prior data. Find the required sample size. (b) A neighboring city with similar demographics found 20% composting. Using , find the required sample size. (c) Explain why the answer in (a) is the larger one, and why that makes the safe default.
Show the worked solution
For 90% confidence, , and , so .
Square it once and reuse it: .
(a) With no prior data use , giving : . Round up to 423 households.
(b) With , : . Round up to 271 households.
(c) The only factor that changed is . As a function of that product is a downward-opening parabola peaking at , where it equals 0.25. Every other planning value gives a smaller product and therefore a smaller .
So returns the largest sample size any true proportion could demand. If your planning value is wrong, a sample built on still meets the target margin of error, while one built on may fall short.
(a) 423 households. (b) 271 households. (c) peaks at 0.25 when , so that choice gives the largest and therefore safest sample size.
Problem 5
A transit agency surveyed a random sample of 500 riders and reported a 95% margin of error of about 0.044 for the proportion who ride daily, based on .
(a) Verify that margin of error. (b) The agency wants to cut the margin of error in half. How many riders does it need? (c) How many would it need to cut the original margin of error to one third?
Show the worked solution
(a) .
, which rounds to 0.044.
Hold and the planning proportion fixed. Then is proportional to , so is proportional to .
(b) Dividing the margin of error by 2 multiplies by : riders.
Check it: , and , half the original margin of error.
(c) Dividing the margin of error by 3 multiplies by : riders.
Check it: , and , one third of 0.04383.
(a) About 0.044. (b) 2000 riders. (c) 4500 riders. Precision costs you the square: halving the margin of error takes four times the data, and cutting it to a third takes nine times.
Problem 6
A logistics team samples 2500 packages and finds arriving on time.
(a) Find the margin of error at 90%, 95%, and 99% confidence. (b) The team is now planning a fresh study and wants a margin of error of 0.02 using . Find the required sample size at each of those three confidence levels. (c) State the trade-off in one sentence.
Show the worked solution
(a) . The standard error does not depend on the confidence level, so it is the same for all three.
At 90%, and . At 95%, and . At 99%, and .
(b) Apply three times.
90%: , then , then . Round up to 1692.
95%: , then , then exactly. Nothing to round up, so 2401.
99%: , then , then . Round up to 4148.
(c) A higher confidence level uses a larger critical value, so at a fixed sample size the margin of error grows, and at a fixed margin of error the required sample size grows.
(a) 0.01645, 0.0196, and 0.02576. (b) 1692, 2401, and 4148. Moving from 90% to 99% confidence at the same margin of error costs about 2.5 times the sample. (c) Higher confidence buys a wider net for the same data, so at a fixed margin of error it costs more observations, and at a fixed sample size it costs precision.
Problem 7
A hospital wants to estimate the mean wait time in its urgent care clinic. Past records put the population standard deviation at about minutes (sigma, the standard deviation of the whole population).
(a) How many patients must be sampled so a 95% confidence interval has a margin of error of at most 2 minutes? (b) How many for a margin of error of at most 1 minute?
Use . Sample size planning for a mean is standard college statistics; the AP course covers the sample size rearrangement only for a proportion, in topic 3.3.
Show the worked solution
(a) For 95% confidence , with and .
Numerator: .
Divide by the target margin: .
Square: . Round up to 139 patients.
(b) Same numerator, new target: , and . Round up to 554 patients.
The quadrupling shows up again: . Quadruple the unrounded value and round up once at the end. Quadrupling the rounded 139 would give 556, which overshoots by two patients.
(a) 139 patients. (b) 554 patients. Halving the target margin of error multiplied the requirement by 4.
Problem 8
A student council surveys a random sample of 250 students at a large high school and finds 150 support moving the start time later. Treat the sample as under 10% of the student body.
(a) Find the margin of error for a 95% confidence interval. (b) The council wants a margin of error of 0.04. Using this year's result as the planning value, how many students should it survey? (c) How many would it need using the conservative instead? (d) Show that rounding down in part (b) would miss the target.
Show the worked solution
(a) . Large counts hold: and .
.
, about 6.1 percentage points.
(b) Planning value , so . Then and .
, so round up to 577 students.
(c) With : , so round up to 601 students. That is larger because .
(d) At : , so , which sits above the 0.04 target.
At : , so , just under the target. That is why the rule is always to round up.
(a) About 0.0607. (b) 577 students. (c) 601 students. (d) A sample of 576 gives a margin of error of 0.040008, above target, while 577 gives 0.039974, below it.