# Find sample size given standard deviation, sample mean, confidence interval

A machine is set up such that the average content of juice per bottle equals u. Assume that the population standard deviation is $$5$$cl.

1. A sample of 100 bottles yields to an average of $$48$$cl. Calculate a $$90\%$$ and $$95\%$$ confidence interval for the average content.

2. Suppose the sample size is unknown. What sample size is required to estimate the average contents to be within $$0.5$$cl at the $$95\%$$ confidence level?

For the first question I found that:

• $$\alpha=10\%$$ gives $$\text{CI} = \bar x\pm t_{1-\alpha/2}\frac\sigma{\sqrt n}=48\pm t_{0.05}\frac5{\sqrt{100}}=(47.175,48.825)$$ and similarly
• $$\alpha=5\%$$ gives $$\text{CI} =48\pm t_{0.025}\frac5{\sqrt{100}}= (47.02,48.98)$$.

I have difficulty regarding the second question. I have never faced such a question and don't really know how to tackle the problem.

• For the first question, CI = [X - t * sd/sqrt(n) ; X + t * sd/sqrt(n)] with X as the sample mean, sd the standard deviation, t the value of the normal distribution given a confidence level and n the sample size. Dec 27 '19 at 19:48

At the $$95\%$$ confidence level, the confidence interval is given by $$\mu\pm1.96\sigma/\sqrt n$$ where $$\mu$$ is the mean, $$\sigma$$ is the standard deviation and $$n$$ is the sample size. From the question, we want $$1.96\sigma/\sqrt n=0.5$$ and since $$\sigma=5$$, the sample size required is $$n=(1.96\cdot5/0.5)^2=384.16$$, or $$385$$ after rounding up.