Tutorials › VEE Mathematical Statistics › Planning Sample Size For A Target Mean-Interval Width

VEE Mathematical Statistics · Intervals for Means · Tutorial 544 of 880

Planning Sample Size For A Target Mean-Interval Width

Use the known-standard-deviation Z interval to plan the smallest sample that meets a specified precision target.

Intermediate 11 min read

What You'll Learn

  • Identify the assumptions required for a Z interval with known population standard deviation.
  • Convert a target full interval width into a maximum margin of error.
  • Select the correct standard normal critical value for a stated confidence level.
  • Calculate and round up the minimum required sample size.
  • Check that the chosen sample size meets the target and that the next smaller size does not.

Why Plan the Sample Size?

A confidence interval is more useful when its precision is planned before data collection. A study that samples too few observations may produce an interval too wide to support a practical decision; collecting many more observations than needed can waste time and resources. For a two-sided Z confidence interval for a population mean with known standard deviation, the required sample size follows directly from the desired maximum margin of error.

The key planning point is that the confidence level and population standard deviation both affect the interval width. A higher confidence level requires a larger critical value, and greater population variability requires more observations to achieve the same precision. The sample size is a design choice made before the sample is observed.

Model and assumptions: Let \(X_1,\ldots,X_n\) be independent observations from a population with mean \(\mu\) and known standard deviation \(\sigma\). If the population is normal, the Z interval below is exact for any \(n\). If the population is not normal, it is an approximate interval when the sample is sufficiently large for the sampling distribution of \(\bar X\) to be adequately approximated by a normal distribution. The formula does not account for dependence, nonrandom selection, or a standard deviation that is unknown.

The Sample-Size Formula

For a two-sided confidence level \(1-\alpha\), let \(z_{1-\alpha/2}\) be the standard normal quantile with cumulative probability \(1-\alpha/2\). Under the stated model, the Z confidence interval for \(\mu\) is

$$ \bar X \mathbin{\pm} z_{1-\alpha/2}\frac{\sigma}{\sqrt n}. $$

The margin of error is the distance from the sample mean to either endpoint:

$$ E=z_{1-\alpha/2}\frac{\sigma}{\sqrt n}. $$

If the design requirement is that the margin of error be no greater than a specified value \(E_{\max}\), solve this inequality for \(n\):

$$ z_{1-\alpha/2}\frac{\sigma}{\sqrt n}\le E_{\max} \quad\Longrightarrow\quad n\ge \left(\frac{z_{1-\alpha/2}\sigma}{E_{\max}}\right)^2. $$

Since the sample size must be a whole number, the minimum acceptable size is the ceiling of the quantity on the right. That means round up to the next integer whenever the calculation is not already an integer. Rounding to the nearest integer can leave the actual margin just above the target.

Sometimes the requirement is stated as a maximum full interval width \(W_{\max}\), rather than a margin of error. Because the interval extends \(E\) units on each side of its center, its full width is \(2E\). Thus use \(E_{\max}=W_{\max}/2\), giving

$$ n_{\min} = \left\lceil \left(\frac{2z_{1-\alpha/2}\sigma}{W_{\max}}\right)^2 \right\rceil. $$

Why the Formula Holds

The sample-size calculation comes from requiring the confidence interval’s half-width to meet the planned precision, not from the observed value of \(\bar X\). The justification is the standard normal pivot for a normal sample with known \(\sigma\); for a sufficiently large sample from a nonnormal population, the same calculation uses the normal approximation.

1
Start with the pivot.
Under the normal model, \(Z=(\bar X-\mu)/(\sigma/\sqrt n)\) has the standard normal distribution. The two-sided central probability statement is \(P(-z_{1-\alpha/2}\le Z\le z_{1-\alpha/2})=1-\alpha\).
2
Rearrange the probability statement.
Multiplying through by the positive standard error and isolating \(\mu\) gives \(P(\bar X-z_{1-\alpha/2}\sigma/\sqrt n\le\mu\le\bar X+z_{1-\alpha/2}\sigma/\sqrt n)=1-\alpha\). Each endpoint is \(z_{1-\alpha/2}\sigma/\sqrt n\) from \(\bar X\).
3
Impose the design target.
To make that half-width no greater than \(E_{\max}\), require \(z_{1-\alpha/2}\sigma/\sqrt n\le E_{\max}\). All quantities are positive, so squaring and rearranging preserves the inequality and gives \(n\ge(z_{1-\alpha/2}\sigma/E_{\max})^2\). The least whole-number \(n\) satisfying it is the ceiling.

This also explains why the planned interval width is fixed once \(n\), the confidence level, and \(\sigma\) are fixed: the observed sample mean changes the location of the interval, but not its width.

Worked Sample-Size Calculations

Worked Example: A Maximum Margin of Three Hours

A hypothetical sleep study will estimate the population mean duration of a particular nightly rest period. Assume independent observations, a normal population, and known population standard deviation \(\sigma=12\) hours. What is the smallest sample size that gives a 95% Z confidence interval with margin of error no greater than 3 hours?

Method. Use the known-\(\sigma\), two-sided Z formula. For 95% confidence, \(\alpha=0.05\), so \(z_{1-\alpha/2}=z_{0.975}=1.96\). Set \(E_{\max}=3\) hours.

Substitute the values:

$$ n\ge\left(\frac{1.96(12)}{3}\right)^2 =\left(\frac{23.52}{3}\right)^2 =7.84^2 =61.4656. $$

The minimum integer is \(n=\lceil61.4656\rceil=62\). To check the ceiling decision, calculate the actual margin at 62:

$$ E_{62}=\frac{23.52}{\sqrt{62}}\approx2.987043\text{ hours}\le3. $$

The next smaller sample size does not meet the requirement:

$$ E_{61}=\frac{23.52}{\sqrt{61}}\approx3.011428\text{ hours}>3. $$

Thus 62 is the smallest acceptable sample size. Common mistake avoided: rounding 61.4656 to 61 would not meet the target; the required operation is always to round up.

Worked Example: A Maximum Full Width of Eight Minutes

A hypothetical laboratory plans to estimate the mean duration of a calibration procedure. Assume independent observations, a normal population, and known standard deviation \(\sigma=15\) minutes. The desired 90% confidence interval must have full width no greater than 8 minutes. Find the minimum sample size.

Method. Convert full width to margin first: \(E_{\max}=8/2=4\) minutes. For 90% two-sided confidence, \(z_{0.95}\approx1.644854\). The product of the critical value and standard deviation is \(1.644854(15)=24.672810\).

The required real-valued sample size is

$$ n\ge\left(\frac{24.672810}{4}\right)^2 =(6.1682025)^2 \approx38.046691. $$

Therefore, \(n_{\min}=39\). Check the boundary: at \(n=38\), the margin is

$$ E_{38}=\frac{24.672810}{\sqrt{38}}\approx4.002459\text{ minutes}, \qquad 2E_{38}\approx8.004917\text{ minutes}. $$

The full width at 38 is just above 8 minutes, so that size fails. At \(n=39\),

$$ E_{39}=\frac{24.672810}{\sqrt{39}}\approx3.950810\text{ minutes}, \qquad 2E_{39}\approx7.901620\text{ minutes}. $$

The width at 39 is below 8 minutes, confirming that 39 is the minimum. Common mistake avoided: applying the formula with 8 as the margin would plan for a full width of 16 minutes, not 8.

Worked Example: Higher Confidence and a Tighter Target

A hypothetical process-monitoring study will estimate a population mean using a 99% Z confidence interval. The population standard deviation is known to be \(\sigma=18\) units, and the largest acceptable margin of error is 2.5 units. Assume independent observations and a normal population. Determine the minimum sample size and verify that the immediately smaller size fails.

Method. For 99% confidence, \(\alpha=0.01\) and \(z_{0.995}\approx2.575829\). Multiplying by the standard deviation gives \(2.575829(18)=46.364922\).

Then

$$ n\ge\left(\frac{46.364922}{2.5}\right)^2 =(18.5459688)^2 \approx343.952959. $$

Rounding up gives \(n_{\min}=344\). The boundary check at 343 observations is

$$ E_{343}=\frac{46.364922}{\sqrt{343}}\approx2.50347\text{ units}>2.5. $$

At 344 observations,

$$ E_{344}=\frac{46.364922}{\sqrt{344}}\approx2.49983\text{ units}\le2.5. $$

So 344 meets the target and 343 does not. Common mistake avoided: using the 95% critical value rather than the 99% critical value would understate the required sample size. The higher confidence level makes the critical value larger, so more observations are needed to retain the same margin.

Planning Choices and Common Traps

Before calculating, identify exactly what the precision requirement describes. A stated “error of at most 4” usually refers to a margin of error, while “interval width at most 8” refers to the distance between both endpoints. These are equivalent targets only after dividing the full width by two.

Design inputWhat to useEffect on required sample size
Confidence levelTwo-sided critical value \(z_{1-\alpha/2}\)Higher confidence increases the critical value and required \(n\)
Known population standard deviation\(\sigma\), in the same units as the target marginGreater variability increases required \(n\)
Maximum margin of error\(E_{\max}\)A smaller margin increases required \(n\), approximately in inverse proportion to its square
Maximum full widthFirst set \(E_{\max}=W_{\max}/2\)Using the width as the margin doubles the intended half-width

A frequent exam trap is to round the computed value to the nearest whole number. For instance, if the calculation gives \(38.046691\), the answer is 39, not 38: the constraint is an inequality, and a sample of 38 fails. Another trap is mixing units. If \(\sigma\) is measured in minutes, the target margin must also be in minutes before the ratio is formed.

The formula also depends on the model. If \(\sigma\) is unknown, this is not the stated known-standard-deviation Z design formula; substituting an estimate changes the procedure and its assumptions. If observations are dependent or the sample design differs from independent sampling, the standard error may not be \(\sigma/\sqrt n\). Finally, a formula-based sample size does not correct a biased sampling method or guarantee that the sample represents the population.

Key takeaway: Choose the correct two-sided Z critical value, express the requirement as a maximum margin of error, calculate \((z_{1-\alpha/2}\sigma/E_{\max})^2\), and round up. Verify the result at the proposed \(n\) and, when useful, at \(n-1\).

Check Your Understanding

For each problem, use the stated known-standard-deviation Z model, convert a full-width requirement to a margin when needed, and round up to the minimum whole-number sample size.

  1. A normal population has known \(\sigma=8\). What sample size is needed for a 95% confidence interval with maximum margin 2? (Answer: 62)
  2. A process has known \(\sigma=20\), and a 90% confidence interval must have full width at most 10. What is the minimum sample size? (Answer: 44)
  3. A normal population has known \(\sigma=6\). Find the sample size for a 99% confidence interval with maximum margin 1.5. (Answer: 107)
  4. A study has known \(\sigma=14\) and requires a 95% confidence interval with full width no greater than 6. Find the minimum \(n\), and state the margin used in the calculation. (Answer: \(E_{\max}=3\), \(n=84\))
  5. For a 95% confidence interval with known \(\sigma=10\), the target margin is 2. A proposed sample size is 96. Does it satisfy the target, and what minimum sample size should be planned? (Answer: No; \(n_{\min}=97\))
Clinical Biostats