Before the method: the idea behind it
How much can you promise?
An interval is only useful if it is narrow enough to say something. “Support is between 10% and 90%, with 99% confidence” is technically true and completely worthless. This final lesson is about the quantity that controls that width, what you can do to shrink it, and what you must give up in exchange.
Part one
Three levers, and only one you really control
The margin of error is the amount added and subtracted from the point estimate.
Three quantities appear, and looking at where each one sits in the formula tells you exactly what it does.
The third is decided by the population, not by you. So in practice there are two levers: how confident you want to be, and how many people you are willing to survey. Everything about designing a study comes down to trading those two against each other.
Part two
The trade-off you cannot escape
More confidence means a wider interval. That is not a flaw in the method; it is what confidence means.
To be more certain of capturing p you must cast a wider net. The only way to have both high confidence and a narrow interval is to increase n, which costs money. Move the sliders and watch the interval respond.
With p fixed at 0.5, only the confidence level and sample size change the width.
Two patterns are worth fixing in your mind. Going from 95% to 99% confidence widens the interval by about 31%, since 2.576 divided by 1.96 is roughly 1.31. And quadrupling n halves E, because of the square root. Neither is free: the first costs precision, the second costs money.
Rearranging the formula for n turns this into a design tool. Decide the margin of error you need, choose your confidence level, and solve.
Because n must be a whole number and a smaller sample would fail the requirement, you always round up here, even when the decimal part is tiny. That is different from recovering a sample size that was actually used, where you round to the nearest integer.
Part three
When you know nothing about p
Planning a survey creates a chicken-and-egg problem: the formula for n needs \(\hat{p}\), but you cannot know it until after you run the survey.
The way out is to prepare for the worst case. Since \(\hat{p}(1-\hat{p})\) is the only part involving the unknown, ask where that product is largest. The answer is a small piece of calculus you already know.
The product peaks at 0.25 when p is 0.5, and falls away in both directions.
You can prove it with the calculus from Term 1. Let \(f(p)=p-p^2\). Then \(f'(p)=1-2p\), which is zero at \(p=0.5\), and \(f”(p)=-2\lt0\), confirming a maximum. So the product is greatest, and therefore the margin of error is greatest, when the population is evenly split.
This gives the rule you need: if no value of p is given, use 0.5. It maximises E, so the sample size you calculate is guaranteed to be large enough whatever the true proportion turns out to be. Any other value would risk an undersized sample.
Part four
Seeing it in a simulation
The previous lesson showed that most, but not all, intervals contain p. Changing the confidence level changes how many miss.
Below you can build intervals at a chosen confidence level and watch the hit rate settle. At 90% roughly one interval in ten misses; at 99% only about one in a hundred does, but every interval is noticeably wider.
Generate intervals, then switch levels and compare both the hit rate and the width.
Where this shows up in real life
Costing a survey
A market research firm quoting a job works backwards from the client’s required margin of error. Asking for 1% instead of 3% multiplies the sample size, and the price, by about nine. Clients routinely discover that precision is the expensive part.
Clinical trial size
Ethics committees require a sample size justification before approving a trial. Too few patients and the study cannot detect a real effect, wasting participants’ time and risk; too many exposes more people than necessary. This formula is where that number comes from.
Before you start
What to reach for
| The question asks for… | Do this |
|---|---|
| the margin of error | E = z√(p(1−p)/n), or half the interval width |
| the sample size for a required E | n = z²p(1−p)/E², then round up |
| a sample size with no p given | Use p = 0.5, since it maximises E |
| the effect of raising the confidence level | Larger z, so wider interval, same data |
| the effect of a larger sample | E shrinks as 1/√n, so quadruple n to halve E |
| how many intervals contain p | Confidence level times the number built |
Next: the working method, twenty practice questions, ten harder ones, and the ClassPad guide. This is the last lesson of the course.