How to use Confidence Intervals to find the true mean within a percentage I'm working through a practice problem for my Stats homework. We're using Confidence Intervals to find a range that the true mean lies within. I'm having trouble understanding how to find the required sample size to estimate the true mean within something like +- 0.5%.
I understand how to work the problem when the range is given as a number, such as +- 0.5 mm. How do I handle percentages?
 A: I am not sure what kind of variable is being audited, so I give 2 alternatives:


*

*To be able to compute the required sample size to give an acceptable estimate to a continuous variable (= given confidence interval) you have to know a few parameters: mean, standard deviation (and to be precise: population size). If you do not know these, you have to be able to give an accurate estimate to those (based on e.g. researches in the past). 
$$n=\left(\frac{Z_{c}\sigma}{E}\right)^2,$$
where $n$ is sample size, $Z_{c}$ is choosen from standard normal distribution table based on $\alpha$ and $\sigma$ is the standard deviation.

*I could image that the variable being examined is a discrete one, and the confidence interval shows that how many percent of the population is about to choose one category based on the sample (proportion). That way the required sample size could be computed easily with:$$n=p(1-p)\left(\frac{Z_{c}}{E}\right)^2$$ where $n$ is sample size, $p$ is proportion in population, $Z_{c}$ is choosen from standard normal distribution table based on $\alpha$, and $E$ is the margin of error.
Note: you can find a lot of online calculators also (e.g.). Worth reading this article also.
A: It does seem a bit odd for this problem, because there does not appear to be a pivotal statistic or if there is, it isn't the usual Z or T statistic.
Here's why I think this is the case.
The problem of estimating the population mean, say $\mu$, to within $\pm $ 0.5% obviously depends on the value of $\mu$ (a pivotal statistic would NOT depend on $\mu$).  To estimate $\mu$ within an absolute amount, say $\pm $1, is independent of the actual value of $\mu$ (in the normally distributed case).  To put it another way, the width of the standard "Z" confidence interval does not depend on $\mu$, it only depends on the population standard deviation, say $\sigma$, the sample size n, and the level of confidence, expressed by the value Z.  You can call the length of this interval $ L=L(\sigma,n,Z)=\frac{2 \sigma Z}{\sqrt{n}} $
Now we want an interval which is $0.01 \mu $ wide (equal length either side of $\mu$).  So the required equation that we need to solve is:
$ L=0.01 \mu=\frac{2 \sigma Z}{\sqrt{n}} $
Re-arranging for n gives
$ n = (\frac{2 \sigma Z}{0.01 \mu})^2 = 40,000 Z^2 (\frac{\sigma}{\mu})^2 $
Using Z=1.96 to have a 95% CI gives
$ n = 153,664 * (\frac{\sigma}{\mu})^2 $
So that you need some prior information about the ratio $\frac{\sigma}{\mu}$ (by "prior information" I mean you need to know something about the ratio $\frac{\sigma}{\mu}$ in order to solve the problem).  If $\frac{\sigma}{\mu}$ is not known with certainty, then the "optimal sample size" also cannot be known with certainty.  The best way to go from here is to specify a probability distribution for $\frac{\sigma}{\mu}$ and then take the expected value of $(\frac{\sigma}{\mu})^2$ and put this into the above equation.
What happens if we only require $\pm 0.005 $ (rather than $\pm 0.005 \mu$)  is that $\mu$ in the above equations for n disappears.
