1. Probabilty of smoking

A fraction p of citizens in a city smoke. We are to determine the value of p by making a survey that involves n citizens whom we select randomly. If k of these n people smoke, then p'=k/n will be our result. How large should we choose n if we want our result p' to be closer to the real value p than 0.005 with probability at least 0.95? In other words: determine the smallest number $\displaystyle n_0$ such that:
$\displaystyle P(|p'-p|)\leq 0.005)\geq 0.95$, for any $\displaystyle p \in (0,1)$ and $\displaystyle n\geq n_0$.

Thank you very much in advance!

2. Re: Probabilty of smoking

A fraction p of citizens in a city smoke. We are to determine the value of p by making a survey that involves n citizens whom we select randomly. If k of these n people smoke, then p'=k/n will be our result. How large should we choose n if we want our result p' to be closer to the real value p than 0.005 with probability at least 0.95? In other words: determine the smallest number $\displaystyle n_0$ such that:
$\displaystyle P(|p'-p|)\leq 0.005)\geq 0.95$, for any $\displaystyle p \in (0,1)$ and $\displaystyle n\geq n_0$.

Thank you very much in advance!
We use the normal approximation, so under this approximation we have:

$\displaystyle (p'-p) \sim N(0,p(1-p)/n)$

Now the z-score corresponding to $\displaystyle (p'-p)=0.005$ is:

$\displaystyle z=\frac{0.005 n}{p(1-p)}$

and the critical value for a 2-sided 95% interval is $\displaystyle 1.96$ so we find the largest $\displaystyle n$ such that:

$\displaystyle \frac{0.005 n}{p(1-p)}\le 1.96$

for any $\displaystyle p \in [0,1]$ (which will occur when $\displaystyle p=0.5$)

CB