math.wiki
Statistics › Statistical inference › Inference for proportions › One sample interval for a proportion and sample size
Open on the map
Statistics · S.IC.B.4

One sample interval for a proportion and sample size

A random sample found that some share of the people asked have a feature. What range of values for the share in the whole population does that sample support, and how many people must be asked to pin the share down to within a chosen margin?

Where you are 5 in Inference for proportions

When you reach for it

The public library system of Sapporo wants to know what share of its cardholders borrowed an e-book last year. There are about 180{,}000 cardholders, far too many to ask, so Yuto, who studies the system’s records, asks a simple random sample of 500 and finds that 210 did (made-up data throughout this lesson). The sample share is 0.42. The system does not care about these 500 people; it cares about all 180{,}000, and a different sample would have given a different share.

The one-sample interval for a proportion turns one sample share into a range of plausible values for the population share, with a stated confidence level. It is the move for any yes-or-no feature counted in one random sample: the share who borrowed, voted, own, attended. Its second use comes before any data exist. When a survey is being planned, the same formula, run backwards, says how many people to ask so that the interval comes out no wider than wanted.

The parts are already in place. Conditions for one proportion says when the sample share has a sampling distribution close to normal: a random sample, a sample no more than a tenth of the population, and at least 10 successes and 10 failures. Critical value supplies the multiplier z^* for a chosen level. This lesson puts them together, in two days: the interval itself, then the sample size.

The procedure

Day 1: the interval

Every interval here has the form “estimate, plus or minus a critical value times a standard error.” For a proportion the estimate is the sample share and its Standard error uses the sample share in place of the unknown population share, which gives

\hat{p} \pm z^* \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}, \qquad \hat{p} = \frac{x}{n}

where x is the number of successes and n the sample size. The amount added and subtracted is the Point estimates and the margin of error.

Name the parameter first. The parameter p is the share of a stated population with a stated feature: “the proportion of all cardholders in the system who borrowed at least one e-book last year.” Writing it down fixes what the conclusion will be about, and it is a population quantity, never the share in the sample.

Check the conditions, because the level depends on them. The interval captures p in about 95\% of samples only when \hat{p} varies from sample to sample along a curve close to normal, centered at p, with the spread the standard error describes. The random condition makes \hat{p} center on p; the tenth-of-the-population condition makes the draws close to independent, which the standard error formula assumes; the counts n\hat{p} \ge 10 and n(1 - \hat{p}) \ge 10 make the normal curve a good model. The counts use \hat{p} because p is unknown. When these hold, the procedure is called a one-sample z interval.

Compute. \hat{p} comes from the counts, z^* from the level, and the standard error from both \hat{p} and n. The interval’s center is \hat{p} and its half-width is the margin.

Conclude in context. The sentence names the level, the two ends, the population and the feature: “We are 95\% confident that between ... and ... of all ... have ...”. What “95\% confident” means, a statement about the method across all possible samples and not a probability about this one interval, is the subject of Confidence level and interpreting an interval.

Technology. A calculator’s 1-PropZInt command takes x, n and the level and returns the two ends and \hat{p}. In a spreadsheet, `NORM.S.INV` gives the critical value: `NORM.S.INV(0.975)` is the point with 0.975 of the standard normal curve to its left, 1.96. Neither checks a condition. The output is correct arithmetic whether or not the sample was random, so the checks stay with the person running it.

Day 2: the sample size

Before a survey, the margin it will produce is

m = z^* \sqrt{\frac{p(1 - p)}{n}}

Asking for a margin no larger than m and solving for n: both sides are positive, so squaring keeps the inequality, and multiplying through by n and dividing by m^2 gives

n \ge \left(\frac{z^*}{m}\right)^2 p^*(1 - p^*)

The share is unknown, since the data do not exist yet, so a planning guess p^* stands in for it. Two guesses are in use. The safe guess p^* = 0.5 makes p^*(1 - p^*) as large as it can be, 0.25, as Point estimates and the margin of error proves; a sample of that size gives a margin no larger than m whatever the share turns out to be. A prior estimate, from an earlier survey or a pilot, gives a smaller n when it lies away from 0.5, but it is only as good as the guess: if the new sample share lands nearer 0.5 than p^*, the margin comes out a little larger than planned.

The formula usually returns a number with a decimal part. A sample size is a whole number, and the inequality asks for n at least that large, so n is rounded up, even when the decimal is small. Rounding down leaves the margin just above the target.

Two things do not appear in the formula: the population size and the data. As long as the planned sample stays under a tenth of the population, a city with ten times as many cardholders needs the same sample for the same margin. The planned sample still has to be random, and once collected, its conditions are checked again with the real counts.

Worked examples

Example 1

Day 1: the e-book interval

A simple random sample of 500 of the system’s about 180{,}000 cardholders finds that 210 borrowed at least one e-book last year. Construct and interpret a 95\% confidence interval for the share of all cardholders who did.

Solution

Parameter. Let p be the proportion of all cardholders in the Sapporo system who borrowed at least one e-book last year. The interval is about p, not about the 500 people asked.

Conditions. The sample was drawn at random from the cardholder list, so the random condition holds. A tenth of 180{,}000 is 18{,}000, and 500 is far below that, so the draws are close to independent. There are 210 successes and 500 - 210 = 290 failures, both at least 10, so the sampling distribution of \hat{p} is close to normal. All three conditions hold.

Compute. The level 95\% gives z^* = 1.96.

\begin{aligned} \hat{p} &= \frac{210}{500} = 0.42 \\ \text{SE}_{\hat{p}} &= \sqrt{\frac{0.42 \times 0.58}{500}} \approx 0.0221 \\ z^*\,\text{SE}_{\hat{p}} &\approx 1.96 \times 0.0221 \approx 0.0433 \end{aligned}

The interval is 0.42 \pm 0.0433, which runs from 0.3767 to 0.4633, or about 0.377 to 0.463.

Conclude. We are 95\% confident that between 37.7\% and 46.3\% of all cardholders in the system borrowed at least one e-book last year.

The same ends come from a spreadsheet: `=0.42-NORM.S.INV(0.975)*SQRT(0.42*0.58/500)` returns 0.3767, and the same formula with a plus sign returns 0.4633. A calculator’s 1-PropZInt with x = 210, n = 500 and level 0.95 prints the interval (0.3767,\ 0.4633).

Example 2

Day 1: reading the output

Hayun prepares the system’s annual report, which uses 90\% intervals. She enters x = 210, n = 500 and level 0.90 into 1-PropZInt and gets this output.

1-PropZInt
interval(0.3837,\ 0.4563)
\hat{p}0.42
n500

Find the margin of error from the output, confirm it by hand, and write the conclusion.

Solution

The interval is centered at \hat{p}, so the center is the midpoint of the two ends, and the margin is half the width:

\begin{aligned} \frac{0.3837 + 0.4563}{2} &= 0.42 \\ \frac{0.4563 - 0.3837}{2} &= 0.0363 \end{aligned}

By hand, 90\% confidence leaves 0.05 in each tail, so z^* = 1.645, and with the same standard error as before, 1.645 \times 0.02207 \approx 0.0363. The two agree.

The output never mentions the conditions; they were checked in the previous example and do not change with the level. The conclusion: we are 90\% confident that between 38.4\% and 45.6\% of all cardholders borrowed at least one e-book last year. This interval sits inside the 95\% one, because the smaller level uses a smaller z^* with the same center and the same standard error.

Example 3

Day 1: what the interval rules in and out

At a council meeting, a member says that “about half” of cardholders borrow e-books. Last year’s survey had estimated 40\%. Using the 95\% interval from 0.377 to 0.463, is 0.50 a plausible value for p? Is 0.40? Does the interval show that the share has changed since last year?

0.34 0.38 0.42 0.46 0.50 0.377 0.463 last year, 0.40 the claim, 0.50 share of cardholders who borrowed an e-book
Figure 1The 95\% interval for the share of Sapporo cardholders who borrowed an e-book (made-up data). Last year’s 0.40 lies inside it; the claimed 0.50 lies outside.
Solution

The interval is the set of values of p the sample supports at 95\% confidence. Figure 1 shows 0.50 lying beyond the upper end, 0.463, so a share of one half is not plausible: the sample is evidence, at that level, that fewer than half of cardholders borrowed an e-book. The claim misses the interval by 0.50 - 0.463 = 0.037, close to four percentage points.

The value 0.40 lies inside, so it is plausible. That does not show the share is still 0.40: every value from 0.377 to 0.463 is plausible, including 0.45, which would be a rise. The interval gives no evidence of a change and no evidence against one. It also treats last year’s 40\% as a fixed number, though it was itself an estimate with its own margin; comparing two shares properly is a job for an interval for a difference of proportions.

Example 4

Day 2: a margin of 3 percentage points

Riku is planning next year’s survey. The board wants a 95\% interval with a margin of error no larger than 0.03, and no one is willing to guess the share in advance. How many cardholders should be sampled?

Solution

With no estimate to lean on, the safe guess p^* = 0.5 gives the largest p^*(1 - p^*), so the sample size it gives works for any share. With z^* = 1.96 and m = 0.03:

\begin{aligned} 1.96\sqrt{\frac{0.5 \times 0.5}{n}} &\le 0.03 \\ n &\ge \left(\frac{1.96}{0.03}\right)^2 (0.5)(0.5) \\ n &\ge 4{,}268.44 \times 0.25 \approx 1{,}067.11 \end{aligned}

The sample must be a whole number at least 1{,}067.11, so Riku rounds up to 1{,}068. Rounding down would fall short: \displaystyle 1.96\sqrt{0.25/1067} \approx 0.030002, a hair over the target, while \displaystyle 1.96\sqrt{0.25/1068} \approx 0.02999 meets it.

The planned sample also passes the tenth-of-the-population check, since 1{,}068 is well below 18{,}000. Point estimates and the margin of error reads a published margin of three points back to a sample of about this size; here the same relation runs forward, from a wanted margin to a sample.

Example 5

Day 2: using this year’s estimate

Hayun points out that this year’s survey estimated 0.42. Use p^* = 0.42 to find the sample size for the same margin and level, and say what the saving costs. How large would the saving be if the planning guess were 0.1?

Solution

The only change is the factor p^*(1 - p^*) = 0.42 \times 0.58 = 0.2436:

n \ge 4{,}268.44 \times 0.2436 \approx 1{,}039.79

so 1{,}040 cardholders, 28 fewer than with the safe guess. If next year’s sample share comes out at 0.42, the margin is \displaystyle 1.96\sqrt{0.2436/1040} \approx 0.0300, on target. If it comes out nearer 0.5, the margin creeps above 0.03, because p(1 - p) is larger there. The safe guess can never be beaten that way.

Figure 2 shows why the saving is small. The needed sample, 4{,}268.44 \times p^*(1 - p^*), is an arch that is flat near its top, so moving the guess from 0.5 to 0.42 barely lowers it. Far from the top the saving is real: with p^* = 0.1, n \ge 4{,}268.44 \times 0.09 \approx 384.16, so 385 would do. A prior estimate is worth using when the share is clearly far from one half and the estimate is trusted.

0 0.25 0.42 0.5 0.75 1 400 800 1,200 1,040 1,068 planning guess p* sample size n
Figure 2The sample size for a margin of 0.03 at 95\% confidence, for each planning guess p^*. The arch peaks at p^* = 0.5 and is flat near its top, so a guess near 0.5 saves few interviews.
Example 6

Day 2: more confidence and a smaller margin

Yuto asks what it would take to report a 99\% interval with a margin of 0.02. Find the sample size with p^* = 0.5, and compare it with a 95\% interval with the same margin.

Solution

At 99\%, z^* = 2.576:

\begin{aligned} n &\ge \left(\frac{2.576}{0.02}\right)^2 (0.25) \\ &= 16{,}589.44 \times 0.25 = 4{,}147.36 \end{aligned}

so 4{,}148 cardholders. At 95\% with the same margin,

n \ge \left(\frac{1.96}{0.02}\right)^2 (0.25) = 9{,}604 \times 0.25 = 2{,}401

and here the bound is a whole number, so 2{,}401 itself is enough. The ratio of the two is \displaystyle \left(\frac{2.576}{1.96}\right)^2 \approx 1.73: raising the level from 95\% to 99\% costs about 73\% more interviews at the same margin. Tightening the margin from 0.03 to 0.02 at 95\% multiplies the sample by \displaystyle \left(\frac{0.03}{0.02}\right)^2 = 2.25, and indeed 1{,}067.11 \times 2.25 \approx 2{,}401. Both 4{,}148 and 2{,}401 stay under 18{,}000, so the tenth-of-the-population condition still holds.

Example 7

Day 2: when a condition is shaky

Two situations. First, Hayun takes a random sample of 60 cardholders at a small branch and finds that 3 borrowed an e-book in a language other than Japanese. Second, the library’s website runs a poll, 1{,}000 visitors choose to answer, and 610 say they borrowed an e-book last year. Compute the 95\% formula interval in each case and say what it is worth.

Solution

The branch sample. The formula gives

\begin{aligned} \hat{p} &= \frac{3}{60} = 0.05 \\ \text{SE}_{\hat{p}} &= \sqrt{\frac{0.05 \times 0.95}{60}} \approx 0.0281 \\ z^*\,\text{SE}_{\hat{p}} &\approx 1.96 \times 0.0281 \approx 0.0551 \end{aligned}

so the interval is 0.05 \pm 0.0551, from about -0.005 to 0.105. Its lower end is below 0, an impossible share, which is the first sign of trouble. The count condition fails: 3 successes, not 10. With so few successes the sampling distribution of \hat{p} is lumpy and skewed right, and the normal curve behind z^* is a poor model. The stated 95\% is then not the real capture rate. Counting over every possible sample of 60 with the binomial distribution, if the true share were 0.05, only about 81\% of samples would give a “95\%” interval that contains it. The remedy is more data: at a share near 0.05, 10 expected successes take a sample of about 200.

The website poll. The formula gives \displaystyle 0.61 \pm 1.96\sqrt{0.61 \times 0.39/1000}, which is about 0.61 \pm 0.0302, from 0.580 to 0.640, a narrow and confident-looking interval. It is worth nothing as an estimate of p. The respondents chose themselves, and people who use the website may well borrow e-books at a different rate from cardholders as a whole. The margin of error measures only the chance variation of random sampling; it says nothing about a biased way of choosing the sample, and a larger poll of volunteers would only make the wrong interval narrower.

Boundaries

  • The interval needs a random sample from the population named in the parameter, or a random process. Without randomness the formula still produces numbers, but neither the center nor the level means anything about p.
  • The standard error formula treats the draws as independent, which sampling without replacement allows only when n is at most a tenth of the population. When the sample is a larger fraction, the true spread of \hat{p} is smaller than the formula says, so the interval is wider than it needs to be; a corrected formula exists for that case.
  • The normal model needs n\hat{p} \ge 10 and n(1 - \hat{p}) \ge 10. With fewer successes or failures the real capture rate can fall well short of the stated level, and an end can land below 0 or above 1. Other intervals built for small counts, such as one that adds two successes and two failures before computing (the plus-four interval), behave better there and lie beyond this lesson.
  • The margin covers sampling variation only. Nonresponse, a biased question, or a list that leaves part of the population out move the estimate in ways no margin measures.
  • The sample-size formula guarantees the margin only for the guess it was given. With p^* = 0.5 the guarantee holds for every share; with any other p^* it holds only if the sample share is at least as far from 0.5 as p^* is.
  • The interval is for one population proportion. Two groups compared share by share need the difference of two proportions, and a mean needs a different standard error and t^*.

Where this goes next

The next lesson, Interval for a difference of proportions, estimates how far apart two population shares are, such as this year’s and last year’s, with the same plan: name, check, compute, conclude. The same sample share also feeds the One sample test for a proportion, which asks whether one claimed value, like the council member’s 0.50, is believable, and ends in Deciding and concluding from a p-value. For averages, the One sample interval for a mean and sample size keeps the shape of estimate plus or minus a critical value times a standard error, and it too can be run backwards to choose a sample size.

Exercises

Use z^* = 1.645, 1.96 and 2.576 for 90\%, 95\% and 99\% confidence. All data are made up.

Day 1: carrying out the interval

  1. A simple random sample of 400 of the system’s cardholders finds that 132 used a library study room last year. Name the parameter, check the conditions, and construct and interpret a 95\% confidence interval.
  2. Of about 31{,}000 cardholders aged 65 or over, a random sample of 625 finds 250 who attended a library talk last year. Construct and interpret a 90\% confidence interval.
  3. A random sample of 1{,}200 cardholders finds 300 who renewed a loan online last year. Construct a 99\% confidence interval.
  4. For each situation, say whether the one-sample z interval may be used, and if not, which condition fails. (a) A random sample of 50 cardholders, 7 of whom have a child’s card linked. (b) A random sample of 120 of the 900 cardholders at one branch. (c) A random sample of 200 of 30{,}000 cardholders, 40 of whom used a book drop. (d) 500 cardholders who answered a poll on the library’s website.
  5. A 1-PropZInt output reads: interval (0.2911,\ 0.3489), \hat{p} = 0.32, n = 1000. Find the number of successes, the margin of error, and the confidence level that was used.
  6. A report says that 55\% of a random sample of 900 cardholders would use the library on Sunday mornings. Construct a 95\% interval, and say whether it gives evidence that a majority of all cardholders would.

Day 2: choosing a sample size

  1. Find the sample size for a 90\% interval with a margin of at most 0.05, with no prior estimate.
  2. Find the sample size for a 95\% interval with a margin of at most 0.025, with no prior estimate.
  3. Last year about 20\% of cardholders used the mobile library van. For a 99\% interval with a margin of at most 0.03, find the sample size using that estimate, and using p^* = 0.5.
  4. In Exercise 7, Riku rounds the bound down to the nearest whole number. Find the worst-case margin his sample gives, and the margin with the rounded-up size.
  5. The board wants the margin of 0.03 at 95\% halved to 0.015. Find the sample size with p^* = 0.5, and compare it with the size for 0.03.
  6. The budget pays for 600 interviews. What is the largest margin of error a 95\% interval from them can have?
  7. Hayun plans a survey of 1{,}040 cardholders with p^* = 0.42, aiming for a margin of 0.03 at 95\%. The sample share comes out at 0.48. What is the actual margin?
  8. A random sample of 40 cardholders at a branch finds 2 who borrowed a large-print book. Compute the 95\% formula interval and explain why it should not be reported.
  9. A branch has 4{,}000 cardholders and wants a 95\% margin of at most 0.03, with no prior estimate. What fraction of its cardholders would the formula’s sample be, which condition does that strain, and in which direction is the formula’s interval off?

Reasoning

  1. Riku writes that “there is a 95\% probability that p is between 0.377 and 0.463.” Explain what is wrong and give a correct statement of what 95\% refers to.
  2. Explain why the interval’s standard error and count checks use \hat{p}, but the sample-size formula uses a guess p^*.
  3. Explain why a city with ten times as many cardholders needs the same sample size for the same margin, and when that stops being true.
  4. Explain why the interval is centered at \hat{p} and not at p, and why two random samples of 500 from the same cardholders give intervals with different centers and slightly different widths.
Answers
  1. p is the share of all cardholders who used a study room last year. Random sample; 400 \le 18{,}000; 132 and 268 are both at least 10. \hat{p} = 0.33, \displaystyle \text{SE} = \sqrt{0.33 \times 0.67/400} \approx 0.0235, margin 1.96 \times 0.0235 \approx 0.0461, interval 0.284 to 0.376. We are 95\% confident that between 28.4\% and 37.6\% of all cardholders used a study room last year.
  2. Random; 625 \le 3{,}100; 250 and 375 are at least 10. \hat{p} = 0.40, \displaystyle \text{SE} = \sqrt{0.4 \times 0.6/625} \approx 0.0196, margin 1.645 \times 0.0196 \approx 0.0322, interval 0.368 to 0.432. We are 90\% confident that between 36.8\% and 43.2\% of cardholders aged 65 or over attended a talk.
  3. \hat{p} = 0.25, \displaystyle \text{SE} = \sqrt{0.25 \times 0.75/1200} = 0.0125, margin 2.576 \times 0.0125 = 0.0322, interval 0.2178 to 0.2822. Conditions: random, 1{,}200 \le 18{,}000, 300 and 900 at least 10.
  4. (a) No: only 7 successes, fewer than 10. (b) No: 120 is more than a tenth of 900, which is 90. (c) Yes: random, 200 \le 3{,}000, 40 and 160 are at least 10. (d) No: the respondents chose themselves, so the sample is not random.
  5. x = 0.32 \times 1000 = 320. The margin is \displaystyle \frac{0.3489 - 0.2911}{2} = 0.0289. \displaystyle \text{SE} = \sqrt{0.32 \times 0.68/1000} \approx 0.01475, so \displaystyle z^* \approx \frac{0.0289}{0.01475} \approx 1.96, a 95\% level.
  6. x = 495, \displaystyle \text{SE} = \sqrt{0.55 \times 0.45/900} \approx 0.0166, margin 1.96 \times 0.0166 \approx 0.0325, interval 0.517 to 0.583. The whole interval lies above 0.5, so at 95\% confidence it is evidence that a majority would.
  7. \displaystyle n \ge \left(\frac{1.645}{0.05}\right)^2(0.25), which is 1082.41 \times 0.25 \approx 270.60, so 271.
  8. \displaystyle n \ge \left(\frac{1.96}{0.025}\right)^2(0.25), which is 6146.56 \times 0.25 \approx 1536.64, so 1{,}537.
  9. \displaystyle \left(\frac{2.576}{0.03}\right)^2 \approx 7373.08. With p^* = 0.2: 7373.08 \times 0.16 \approx 1179.69, so 1{,}180. With p^* = 0.5: 7373.08 \times 0.25 \approx 1843.27, so 1{,}844.
  10. With n = 270: \displaystyle 1.645\sqrt{0.25/270} \approx 0.05006, above 0.05. With n = 271: \displaystyle 1.645\sqrt{0.25/271} \approx 0.04996, within the target.
  11. \displaystyle n \ge \left(\frac{1.96}{0.015}\right)^2(0.25) \approx 4268.44, so 4{,}269, about four times 1{,}068: halving the margin quadruples the sample, since the margin falls like \displaystyle \frac{1}{\sqrt{n}}.
  12. The worst case is \hat{p} = 0.5: \displaystyle 1.96\sqrt{0.25/600} \approx 0.0400, so at most about 0.040.
  13. \displaystyle 1.96\sqrt{0.48 \times 0.52/1040} \approx 0.0304, slightly more than the 0.03 planned, because 0.48 is nearer 0.5 than the guess 0.42.
  14. \hat{p} = 0.05, \displaystyle \text{SE} = \sqrt{0.05 \times 0.95/40} \approx 0.0345, margin 1.96 \times 0.03446 \approx 0.0675, interval about -0.018 to 0.118. Only 2 successes, far below 10, so the normal model fails; the lower end is an impossible negative share and the true capture rate is below 95\%. A much larger sample is needed.
  15. With p^* = 0.5 the formula gives 1{,}068, which is \displaystyle \frac{1068}{4000} = 0.267, about 27\% of the cardholders. That strains the tenth-of-the-population condition. Sampling that large a fraction without replacement makes \hat{p} vary less than the formula assumes, so an interval from the formula is wider than needed, and the branch could reach a margin of 0.03 with fewer than 1{,}068 cardholders using a corrected formula.
  16. The parameter p is a fixed number; it is either in 0.377 to 0.463 or not, with no probability left. The 95\% describes the method: across all possible random samples of 500, about 95\% of the intervals built this way contain p. Correct: “We are 95\% confident that between 37.7\% and 46.3\% of all cardholders borrowed an e-book,” meaning the interval came from a method that captures p in about 95\% of samples.
  17. The true spread of \hat{p} is \displaystyle \sqrt{p(1 - p)/n}, but p is unknown; after sampling, \hat{p} is the best available stand-in, both for the standard error and for the expected counts. Before sampling there is no \hat{p} at all, so a guess has to take its place, and the safe guess 0.5 is the one that makes the planned margin hold whatever the share is.
  18. Neither the interval nor the sample-size formula contains the population size: the spread of \hat{p} depends on p and n, because each draw from a large population is close to an independent yes-or-no trial with chance p. So the larger city needs the same n. It stops being true when the sample is more than about a tenth of the population, where draws without replacement are no longer close to independent.
  19. The interval is built from the data, and p is unknown, so the only available center is the sample’s own estimate \hat{p}; the question is how far p might be from it. A second sample of 500 contains different people, so its \hat{p} differs, which moves the center. The width is \displaystyle 2z^*\sqrt{\hat{p}(1 - \hat{p})/n}, which depends on \hat{p} as well as n, so a different \hat{p} gives a slightly different width too.
kg1128 · updated 2026-10-20 · CC-BY-SA-4.0