# How to find smallest sample size such that the sample mean is within delta of the population mean with 95% confidence?

Let $\mu$ be the population mean and $\hat{\mu}$ be the sample mean. For a given $\Delta$, I would like to find the least $N$, the sample size, such that

$$P(|\mu-\hat{\mu}| < \Delta) = 0.95.$$

Denote $\mu$ and $\sigma$ be the population mean and standard deviation, $\widehat{\mu}$ be the sample mean, and $N$ be the sample size.

If the samples are independent, by C.L.T.,

$$\frac{\widehat{\mu} - \mu}{\sigma / \sqrt{N}} \overset{d}{\to} N(0, 1)$$

$\DeclareMathOperator{\pr}{Pr}$

$$\pr(|\mu - \widehat{\mu}| < \Delta) = 0.95$$

$$\iff \pr\left( \left|\frac{\widehat{\mu} - \mu}{\sigma / \sqrt{N}}\right| < \frac{\Delta}{|\sigma / \sqrt{N}|} \right) = 0.95$$

And we will get

$$\pr\left( \left|Z\right| < \frac{\Delta}{\sigma / \sqrt{N}} \right) = 0.95$$

where $Z$ is the standard normal. And so, we can obtain

$$1.96 = \frac{\Delta}{\sigma / \sqrt{N}} \iff N = \left( \frac{\Delta}{1.96\sigma} \right)^2$$

As $Z^2 = X \sim \chi_1^2$, we can also find $N$ this way,

$$\pr\left( X < \frac{\Delta^2}{\sigma^2 / N} \right) = 0.95$$

$$3.84 = \frac{\Delta^2}{\sigma^2 / N} \iff N = \frac{\Delta^2}{3.84 \sigma^2}$$

• The first result is not correct but the second is fine. The equailities later on are also approximate ... – Math-fun Jul 6 '16 at 11:30
• How do you know to divide $\sigma^2$ by $N$ in the first equation? – bourbaki4481472 Jul 6 '16 at 14:13
• @bourbaki4481472 I want to standardise $\mu - \widehat{\mu}$ by dividing $\sigma / \sqrt{N}$ which is the standard error of $\widehat{\mu}$. – pe-pe-rry Jul 7 '16 at 3:49