# Sample size from a confidence interval?

Consider a large lot of electronic components where there is interest in the proportion of T working components. Suppose it is know for sure that $$0.7 < T < 0.9$$ How many components ought to be randomly sampled to provide an 80% confidence interval with length less than 0.01?

How do you approach this problem?

You have a standard deviation $\sqrt{T(1-T)}$ for a sample of size $1$. If $0<T<1$ then $\sqrt{T(1-T)}\le1/2$. But if it is known that $0.7<T$, then the standard deviation is $\le\sqrt{(0.7)(1-0.7)}\cong0.46$. The standard error for a confidence interval based on a sample of size $n$ is therefore $\le0.46/\sqrt{n}$. The length of the interval is about $2\cdot1.28\cdot0.46/\sqrt{n}$. (The number $1.28$ is something you get from a table). So you want to make $n$ big enough so that that is $\le0.01$.
• If $T=0.7$ then $T(1-T)=0.21$ (not $0.27$) and if $T=0.9$ then $T(1-T)=0.09$ (not $0.07$). Maybe $0.07$ and $0.27$ are typos? Commented Dec 9, 2013 at 4:45
• You need $2\cdot1.28\cdot0.46/\sqrt{n}\le0.01$, so $n\ge\left(\dfrac{2\cdot1.28\cdot0.46}{0.01}\right)^2$. So $n\ge 13868$. But I wouldn't be sure about that last digit since $1.28$ is rounded and the last one or two digits are sensitive to rounding. Commented Dec 9, 2013 at 5:08