Interview Q&A / Data Science

IntermediateQuick answer1 min readUpdated 3 Oct 2026

How does sample size affect the margin of error in a survey?

SHORT ANSWER

For a proportion, margin of error is about 1.96 x sqrt(p(1-p)/n). It shrinks with the square root of n, so 1000 respondents give roughly +/- 3% and 400 give roughly +/- 5%, and reducing it further gets expensive quickly.

Explain it simply

In an opinion poll, each extra respondent adds information, but with diminishing returns. The error depends on the square root of n, so cutting it in half needs four times the sample.

Margin of error (95%) = 1.96 x sqrt(p x (1 - p) / n)

The worst case is p = 0.5, because that is the most uncertain split.

Example

A college polls students on whether to hold the fest in January, with p = 0.5 as the cautious guess:

  • n = 400: 1.96 x sqrt(0.25 / 400) = 1.96 x 0.025 = 0.049, so about +/- 4.9%
  • n = 1000: 1.96 x sqrt(0.25 / 1000) = 0.031, so about +/- 3.1%
python
import math
for n in (400, 1000):
    print(n, round(1.96 * math.sqrt(0.25 / n), 3))  # 400 0.049 / 1000 0.031

Going from 400 to 1000 people (2.5 times the effort) gains less than 2 points of precision.

What to say in the interview

"The margin of error for a proportion is z times the square root of p(1-p) over n, so it falls with the square root of the sample. I plan the sample size from the precision I need, using p = 0.5 when I have no estimate. A large sample does not fix bias; if the sampling method is poor, the error is not just random."

Common mistakes

  • Thinking the population size matters much. For a large population, the sample size is what drives the margin.

#margin-of-error#sampling#survey

Related questions

Practise more Data Science questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Data Science quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.