\problemdata       % Takes 5 *mandatory* arguments
  {moviepoll}              % latex-friendly label for the prob.
  {variance,polling}       % The topic(s) of the problem content.
  {}                       % Source (if known)
  {F01 ps12, S02 cp12F-1}  % Usage (list ones you are aware of).
  {Nick Matsakis, S02}     % Last revision info (author, date).
\begin{problem} {\bf Attack of the Clones}
We want to determine the percentage of people $r$ who intend to watch
the {\em Episode II: Attack of the Clones}. Since we are still working
on our jedi mind tricks, we decide to conduct a poll.

\begin{problemparts}
\problempart Suppose that we poll 800 people. Use the Pairwise
Sampling Theorem to bound the confidence level that our estimated
value is within $\pm0.04$ of the actual value $r$.

\solution{The Pairwise Sampling Theorem gives us a bound on the
probability that the average of a sum of independent, identically
distributed random variables differs from their mean by more than a
certain amount $\epsilon$.  Call this probability $\delta$.  Our
confidence level, $c = 1 - \delta$. From the theorem we find,

\[
\pr{\abs{\frac{S_n}{n} - r} \geq \epsilon}
\leq 
\frac{\sigma^2}{n\epsilon^2}
\]

Recall that $\sigma^2$ is the variance of the random variables we are
summing. In this case, these are Bernoulli random variables, so the
variance is $p(p-1)$. Unfortunately, $p$ is also the value we are
trying to compute! However, we can take advantage of the fact that the
variance is maximized when $p=1/2$.  This gives us the following bound
on $\delta$.

\begin{eqnarray*}
\delta
& \leq & \frac{p(p-1)}{n\epsilon^2} \\
& \leq & \frac{0.5(0.5-1)}{n\epsilon^2} \\
& \leq & \frac{1}{4n\epsilon^2}
\end{eqnarray*}

Plugging in 800 for $n$, and $0.04$ for $\epsilon$ we find $\delta
\leq 0.195$.  Our confidence level is $1-\delta$, so $c \geq 1 -
0.195$, or 80\%.
}

\problempart Again using the Sampling Theorem, 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.04 of the actual value $r$.

\solution{ 
In order to be at least 95\% confident in our measurement, we need the
probability that our measurement is outside the error margin to be
less than 0.05.  Using our formula from part \textbf{a}, it is easy to
see that $\delta \leq 0.05$ when the bound is less than 0.05.
\[
\delta \leq \frac{1}{4n\epsilon^2}  \leq  0.05
\]
Solving for $n$, we find, that in order to achieve this bound we have
to poll at least $3125$ people.

\begin{eqnarray*}
0.05 & \geq & \frac{1}{4n \cdot 0.04^2}\\
n & \geq & \frac{1}{4 \cdot 0.05 \cdot 0.04^2}\\
n & \geq & 3125
\end{eqnarray*}
}

\problempart Do you think it is reasonable to model people as
independent coin tosses? Why does the number of people chosen in this
poll not depend on the population size?

\solution{ 
This was intended to be a thought provoking question. The polling
theorems we have been using are based on the assumption that the
people polled are independent. However, people's behavior in voting is
often strongly correlated with other people in that region. For this
reason, it is important to be sure the people sampled in a poll are
genuinely independent, and the results are not extrapolated to a
larger population (for example, assuming a poll taken in California
applies to the entire United States).

The poll doesn't depend on population size or dependence between
individual people. It may be helpful to think of the people polled as
being colored balls in a (giant) box that we are sampling from.
Regardless of the number of balls in the box or whether or not the
color of some balls is dependent on that of other balls, the
probability that we draw a red ball is just the fraction of balls in
the box that are red.
}
\end{problemparts}
\end{problem}
