\problemdata       % Takes 5 *mandatory* arguments
  {better-polling}         % latex-friendly label for the prob.
  {variance,polling}       % The topic(s) of the problem content.
  {}                       % Source (if known)
  {S02 cp12F-2}            % Usage (list ones you are aware of).
  {Nick Matsakis, S02}     % Last revision info (author, date).
\begin{problem}
We really would like to poll less people. Rather than lower our
standards, we decide to recalculate the number of people using an
approximation of the binomial distribution.

Let $\delta$ be the probability that the experiment deviates more than
$\epsilon$ from the expected value, then

\begin{eqnarray*}
\delta \leq 2 F_{n,1/2} ((1/2 - \epsilon) n)\\
\end{eqnarray*}

\begin{problemparts} 

\problempart Suppose that we poll 800 people. How confident are we,
that our estimated value is within $\pm0.04$ of the actual value $r$?

\solution {Coming Soon.}

\problempart Find the number of people we would need to poll to if we
wanted to be 95\% confident that our estimated value was within 0.02
of the actual value $r$.

\solution{

\begin{equation}\label{delta bound}
\delta \leq F_{n,\frac{1}{2}}((\frac{1}{2} - \epsilon) n) +
   F_{n,1-\frac{1}{2}}((1-\frac{1}{2}-\epsilon) n)
 = 2 F_{n,\frac{1}{2}}((\frac{1}{2} - \epsilon) n).
\end{equation}

Now plugging in $\epsilon = 0.02$ into~(\ref{delta bound}) gives:
\begin{align*}
\delta \leq  2 F_{n,\frac{1}{2}}(0.48 n)
    & \leq 2 \cdot  \frac{1 - \alpha}{1 - 2\cdot\alpha} f_{n,1/2}(0.48 n)\\
    &  \approx 2 \cdot 0.6842 \cdot 2^{-n(1 - H(0.48))}/\sqrt{2\pi \cdot 0.48(1-0.48)n}\\
    & = 2 \cdot 0.6842 \cdot \frac{2^{-0.00115 n}}{1.2523 \sqrt{n}}.
\end{align*}

We want to poll enough people so that $\delta$ is less than $0.05$.
The easiest way is to plug in values for $n$, the number of people
polled:
\[
\begin{array}{c|l}
\mbox{$n$ = people polled} & \begin{array}{cc}
\mbox{upper bound on} \\
\mbox{probability poll is wrong}
\end{array} \\
\hline
1000 &  29.4\% \\
2000 &  9.3\% \\
3000 &  3.4\% \\
2500 &  5.6\% \\
2750 &  4.4\%\\
2616 &  5.004\%\\
2617 &  4.999\%
\end{array}
\]

So polling 2617 people is sufficient to determine public opinion to within
2\% with confidence of 95\%.  Again, the remarkable point is that the
population of the country has no effect on the poll size.  Whether there
are ten thousand people or a billion in a country, polling 2617 people
is sufficient!
}

\end{problemparts}
\end{problem}
