- The margin of error is the “plus or minus” part of a confidence interval: \(z^* \sqrt{\hat{p}(1-\hat{p})/n}\) for a proportion.
- It shrinks with the square root of the sample size, so halving the margin of error needs four times as many people.
- To plan a survey, solve for \(n\): \(n = (z^*/E)^2\, p^*(1-p^*)\), and always round up. With no prior guess, use \(p^* = 0.5\).
- The case answer: a student union that wants its result within ±4 points with 95% confidence must survey at least 601 students; ±3 points needs 1,068.
- Exam point: the margin of error covers only random sampling error. It says nothing about bias from poor wording, non-response or convenience samples.
The case: how many students should the union survey?
A university student union wants to know what proportion of its 18,000 students support moving the library to 24-hour opening. Last year a quick poll of 600 students found 62% in favour. (The figures are illustrative.) This year the union wants to present the result to the university’s board, and the board has asked for a figure that is “accurate to within 3 percentage points”.
The union’s research officer has two jobs. First, she needs to explain what last year’s 62% actually told them, including its margin of error. Second, she needs to decide how many students to survey this year so that the result meets the board’s standard. Every extra student costs time, and the union has volunteers for only about 1,100 short interviews.
Is that enough? To answer, we need the margin of error formula, and then we need to turn it around to solve for the sample size.
The concept: margin of error for a proportion
When we estimate a population proportion \(p\) from a sample proportion \(\hat{p}\), the estimate is almost never exactly right. The sampling distribution of \(\hat{p}\) tells us how far off it typically is. A confidence interval turns that into a range: estimate plus or minus a margin.[1]
The margin of error is that “plus or minus” amount. It has two ingredients. The standard error measures how much \(\hat{p}\) varies from sample to sample. The critical value \(z^*\) sets how many standard errors we go out on each side, which depends on how confident we want to be. For 95% confidence, \(z^* = 1.96\); for 90%, 1.645; for 99%, 2.576.
Because the standard error has \(n\) under a square root, the margin of error falls as the sample grows, but more and more slowly. This “square-root law” is the reason national polls of 1,000 to 1,500 people are so common: beyond that, each extra interview buys very little extra precision.
Here \(E\) is the margin of error, written as a proportion (0.03 for 3 percentage points). \(z^*\) is the critical value from the standard normal distribution for the chosen confidence level. \(\hat{p}\) is the sample proportion and \(n\) the sample size. In the planning formula on the right, \(p^*\) is a guess at the proportion before the survey is done. If you have no reliable guess, use \(p^* = 0.5\): the product \(p^*(1-p^*)\) is largest there (0.25), so the sample size you get is enough for any true \(p\). Always round \(n\) up to the next whole number, because rounding down would give a margin slightly bigger than \(E\).
Why this method fits the case
The union is estimating a single proportion, “in favour of 24-hour opening”, from a random sample of students. That is exactly the setting for a one-proportion z interval. The board’s demand, “within 3 points”, is a margin of error target. The planning formula answers it directly.
The conditions match those for the sampling distribution of \(\hat{p}\):
- Random: the union must sample at random from the student list, for example by drawing student ID numbers. A stall outside the library would over-represent library users.
- 10% condition: 1,068 is about 5.9% of 18,000, so independence is reasonable.
- Large Counts: with around 60% in favour, the expected numbers of “yes” and “no” are both in the hundreds.
When is this not the right tool?
- When the sample is a large share of the population. If the union could survey half of all students, a finite population correction would make the margin smaller than this formula says.
- When the main worry is bias, not random error. A larger sample does not fix a leading question or a 15% response rate. The margin of error does not measure these problems at all.
- When you are estimating a mean. For an average, such as hours spent in the library, use \(n = (z^*\sigma/E)^2\) instead.
Setting it up
| Quantity | Symbol | Value |
|---|---|---|
| Last year’s sample size | \(n\) | 600 |
| Last year’s sample proportion | \(\hat{p}\) | 0.62 |
| Confidence level / critical value | \(z^*\) | 95% / 1.96 |
| Target margin of error | \(E\) | 0.03 |
| Planning guess (safe) | \(p^*\) | 0.5 |
| Planning guess (from last year) | \(p^*\) | 0.62 |
| Population size | \(N\) | 18,000 |
Two planning guesses are listed on purpose. Using last year’s 62% gives a smaller sample, but if opinion has moved towards 50% the margin would then be a little larger than promised. The safe guess of 0.5 guarantees the target.
Solving it
Last year 62% of a random sample of 600 students supported 24-hour opening. Find the 95% margin of error and the confidence interval.
We are 95% confident that between 58.1% and 65.9% of all students supported the change last year. The margin of 3.9 points misses the board’s 3-point standard.
Now turn the formula around to plan this year’s survey.
How many students must the union survey for a 95% margin of error of at most 3 percentage points? Use (a) \(p^* = 0.5\) and (b) \(p^* = 0.62\).
The safe answer is 1,068 students. The union’s capacity of about 1,100 interviews is enough, with a small cushion for refusals.
The third example shows how the confidence level and the target interact, which matters when the budget is tight.
Using \(p^* = 0.5\), find the sample size needed for a margin of error of 3 points at (a) 90% confidence and (b) 99% confidence. Then find the 95% margin of error for samples of 600 and 2,400.
Going from 90% to 99% confidence more than doubles the sample. Quadrupling the sample from 600 to 2,400 halves the margin, exactly as the square-root law predicts.
What the answer tells us
Last year’s 62% came with a margin of about ±3.9 points, so the true level of support could reasonably have been anywhere from the high 50s to the mid 60s. That was enough to say “a clear majority” but not enough to meet the board’s ±3 standard. This year a random sample of 1,068 students will meet it for any level of support, and the union’s capacity just covers it.
Reasonableness check. A widely quoted rule of thumb is that the 95% margin of error with \(p\) near 0.5 is roughly \(1/\sqrt{n}\). For \(n = 1{,}068\), \(1/\sqrt{1068} \approx 0.031\), very close to our 0.030. For \(n = 600\), \(1/\sqrt{600} \approx 0.041\), close to the 0.040 we found. Our answers agree with the shortcut.
Sensitivity. Figure 1 shows how fast the margin falls at first and how slowly later. Going from 100 to 600 students cuts the 95% margin from 9.8 to 4.0 points. Going from 1,068 to 2,401 only cuts it from 3.0 to 2.0 points, at more than twice the cost. For many decisions, ±3 points is the sweet spot, which is why so many published opinion polls use samples of around 1,000.[2] The confidence level matters as much as the margin: insisting on 99% instead of 95% raises the required sample from 1,068 to 1,844.
One more check concerns what the margin does not cover. If only the most motivated students reply, or the question is worded as “Do you support better access to the library?”, the result can be several points off even with a perfect sample size. The research officer should spend some of her effort on a neutral question and on chasing non-respondents, not only on hitting 1,068.[3]
The Statistics Made Simple textbook explains confidence intervals for proportions from first principles, with diagrams of the sampling distribution and the margin of error. The Statistics Made Simple Practice Questions book gives you graded interval and sample-size problems with full solutions.
Practice questions
Use \(z^* = 1.645\) for 90%, 1.96 for 95% and 2.576 for 99% confidence.
EasyQ1. In a random sample of 400 shoppers, 30% used a discount code. Find the 95% margin of error. Show worked answer
\(E = 1.96 \times 0.02291 \approx 0.0449\), about ±4.5 percentage points.
EasyQ2. With no prior estimate, how large a sample is needed for a 95% margin of error of 5 percentage points? Show worked answer
Round up: \(n = 385\).
MediumQ3. A health researcher believes about 10% of adults in a region have a particular allergy. How many adults should she sample for a 95% margin of error of 2 percentage points? How many would she need with no prior estimate? Show worked answer
With \(p^* = 0.5\): \(n = 9604 \times 0.25 = 2401\).
A good prior guess far from 0.5 saves a lot of interviews.
MediumQ4. A poll of 1,200 voters finds 45% support a candidate. Find a 95% confidence interval. Can the poll conclude that support is below 50%? Show worked answer
Interval: 0.422 to 0.478.
The whole interval lies below 0.50, so the poll gives convincing evidence that support is below 50%.
ExamQ5. A company wants to estimate the proportion of its customers who would buy a new product. (a) Find the minimum sample size for a 99% margin of error of at most 0.02, with no prior estimate. [3] (b) A pilot study suggests the proportion is about 0.45. Find the new minimum sample size for a 95% margin of error of at most 0.02. [2] (c) Give one reason why the true error may be larger than the margin of error. [1] Show worked answer
(b) \(n \ge (1.96/0.02)^2 \times 0.45 \times 0.55 = 2376.99\) [M1]; \(n = 2{,}377\) [A1].
(c) Any valid source of bias, e.g. non-response, or customers saying they would buy but not doing so [B1].
Frequently asked questions
Does a bigger population need a bigger sample?
Hardly at all, as long as the sample is a small fraction of the population. The formula for the margin of error does not include the population size. A random sample of 1,068 gives about ±3 points whether the population is 18,000 students or 50 million voters. Only when the sample is more than about 10% of the population does a correction make the margin noticeably smaller.
Why use 0.5 when I have no estimate?
The term \(p(1-p)\) reaches its maximum of 0.25 when \(p = 0.5\). Using 0.5 therefore gives the largest sample you could ever need for that margin and confidence level. Whatever the true proportion turns out to be, the actual margin will be no bigger than planned.
What does “95% confident” actually mean?
It describes the method, not one particular interval. If we repeated the survey many times and built an interval each time, about 95% of those intervals would contain the true proportion. Our posts on how to interpret a confidence interval and confidence intervals explained go into the wording in more depth.
Why do news reports quote a single margin of error for a whole poll?
Pollsters usually quote the maximum margin, worked out with \(p = 0.5\), so that it covers every question in the poll. For a question where the answer is far from 50%, the actual margin is smaller. For subgroups, such as only young voters, the sample is smaller and the margin is larger, often much larger.
References
- Illowsky, B. and Dean, S. (2023) Introductory Statistics 2e. Houston, TX: OpenStax. https://openstax.org/details/books/introductory-statistics-2e
- Agresti, A., Franklin, C. and Klingenberg, B. Statistics: The Art and Science of Learning from Data. Boston: Pearson.
- Moore, D. S., McCabe, G. P. and Craig, B. A. Introduction to the Practice of Statistics. New York: W. H. Freeman.
- College Board. AP Statistics Course and Exam Description. New York: College Board.

