\documentclass[twocolumn]{article}
% \documentclass{article}

\setlength{\oddsidemargin}{0.5in}
\setlength{\evensidemargin}{0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.05in}
\setlength{\columnseprule}{0.3pt}

\setlength\columnsep{25pt}

\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}

\usepackage{listings}
\usepackage{amsmath}

\begin{document}

\lstset{xleftmargin=5mm,framexleftmargin=10mm,basicstyle=\footnotesize}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Directions: MAKE SURE TO COPY YOUR ANSWERS TO A SEPARATE SHEET FOR SENDING
ME AN ELECTRONIC COPY LATER.

{\bf \Large When a problem says ``Find,'' do NOT use simulation.}

% {\bf 1.} Consider the coin game, Sec. 4.8 of our text.
% 
% \begin{itemize}
% 
% \item [(a)] (15) Find $P(X_3 = 2)$.
% 
% \item [(b)] (15) Find $Var(X_8)$.
% 
% \item [(c)] (15) Find $p_{X_3,Y_3}(1,1)$.
% 
% \end{itemize}

{\bf 1.} Consider the coin and die game, Sec.\ 4.15.3.

\begin{itemize}

\item [(a)] (15) Find $P(M = 2)$.

\item [(b)] (15) Find $Var(M)$.

\item [(c)] (15) Find $p_{M,W}(1,1)$.

\end{itemize}

{\bf 2.} (15) Suppose some random variable $X$ has a Poisson distribution
with $\lambda = 3.2$.  Do NOT use loops in this problem.

\begin{itemize}

\item [(a)] (15) Find $P(X \leq 8)$.

\item [(b)] (15) Find $E(X^2)$.  (You'll need a mailing tube, but need
not cite it.)

\end{itemize}

{\bf 3.} Consider the parking space example, Sec.\ 4.2.2.

\begin{itemize}

\item [(a)] (15) Change line 7 in the code so that instead of returning
the approximate value of $ED$, it returns the approximate value of
$P(D \leq 12)$.

\item [(b)] (10) (Not a continuation of part (a).) We have a caravan of
four cars, and thus need four parking spaces.  Let $D$ denote the
distance of the furthest car from the destination.  Find $P(D = 12)$.
Do NOT answer with a single R function call; instead, you must write an
R expression that includes a call to {\bf choose()}.

\end{itemize}

\onecolumn

\newpage

{\bf Solutions:}

{\bf 1.a}  $(5/6) (1/6)$

{\bf 1.b}  $M$ is geometric, so its variance is $(1-p)/p^2$, where $p =
1/6$.

{\bf 1.c}

$$
p_{M,W}(1,1) = P(M = 1, W = 1) = P(M = 1) P(W = 1 | M = 1) =
(1/6) (1/2)
$$

{\bf 2.a}

\begin{lstlisting}
ppois(8,3.2)
\end{lstlisting}

{\bf 2.b}

$$
E(X^2) = Var(X) + (EX)^2 = 3.2 + 3.2^2
$$

{\bf 3.a}

\begin{lstlisting}
mean(dvals <= 12)
\end{lstlisting}

{\bf 3.b} Number the spaces 1,2,...,10 in the first block, 11,12,...,20
in the second block and so on.  $D = 12$ means that the furthest car is
in space 23.  That in turn means that the fourth empty space was space
23.  The probability of this is that of a negative binomial distribution
with $r = 4$ and $p = 0.15$.

\end{document}

