\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}
\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}

\begin{document}

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

Directions: {\bf \Large Work only on this sheet} (on both sides, if
needed); do not turn in any supplementary sheets of paper. There is
actually plenty of room for your answers, as long as you organize
yourself BEFORE starting writing.

{\bf \Large Unless otherwise stated, give numerical answers as
expressions, e.g. $\frac{2}{3} \times 6 - 1.8$.  Do NOT use
calculators.}

{\bf 1.} A vending machine stocks Kit Kats, Butterfingers and Crunch
bars.  Among all customers, $\frac{1}{2}$ choose Kit Kats, $\frac{1}{3}$
select Butterfingers and $\frac{1}{6}$  purchase Crunches.  Let K, B and
C be the number of each item bought, among n transactions.  

\begin{itemize}

\item [(a)] (10) Suppose n = 5.  To what parametric family does
the distribution of the vector (K,B,C) belong, and with what parameter
values?

\item [(b)] (10) Same question as (a), but for K alone.

\item [(c)] (10) For n = 6, give the value of Cov(K,C).

\item [(d)] (10) Suppose the stock on hand of Crunches is 3.  (We have
ther two items.) Let N be the number of customers we must
observe before the Crunches are gone.  To what parametric family of
oes $p_N$ belong, and with what parameter values??

\end{itemize}

{\bf 2.} (15) The R code below simulates the ``museum demonstration''
(pp.55-56).  Fill in the blanks.

\begin{Verbatim}[fontsize=\relsize{-2},numbers=left]
nrows <- 15
nballs <- 500
bins <- vector(length=2*nrows+1)
for (i in 1:_______________________________) {
   position <- nrows
   for (j in 1:____________________________) {
      if (runif(1) < 0.5) {
         position <- _____________________________
      } else position <- _________________________
   }
   bins[position] <- _____________________________
}
\end{Verbatim}

{\bf 3.} (10) Fill in the steps, including reasons at the bottom, in the
following proof that $Cov(W+R,W-R) = Var(X) - Var(Y)$:

\begin{eqnarray}
Cov(W+R,W-R) &=& 
   \textrm{\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_} \\
&=& Cov(W,W) - Cov(R,R) \\
&=& Var(W) - Var(R) 
\end{eqnarray}

{\bf Reasons} (you must cite equation numbers whenever possible, English
otherwise):

\begin{Verbatim}[fontsize=\relsize{-2}]
equation (1):
equation (2):
equation (3):
\end{Verbatim}

{\bf 4.} (15) Suppose $f_X(t)$ is equal to 2t on (0,1), 0 elsewhere.  Find
P(X $>$ EX), expressing your answer as a fraction, reduced to
lowest terms.

{\bf 5.} (10) On p.148, state the standard error of $\hat{c}$.

{\bf 6.} (10) Say $Cov(X) = \Sigma$ for some random vector X.  Let v be a
nonrandom column vector of the same length as X.  Explain clearly why the
quantity $v' \Sigma v \geq 0$.

{\bf Solutions:}

{\bf 1a.}  Multinomial, r = 3, n = 5, $p_1 = \frac{1}{2}$, 
$p_2 = \frac{1}{3}$, $p_3 = \frac{1}{6}$.

{\bf 1b.}  Binomial, n = 5, p = 1/2.

{\bf 1c.} $-6 \cdot \frac{1}{2} \cdot \frac{1}{6}$

{\bf 1d.} Negative binomial, r = 3, p = 1/6.

{\bf 2.}  nballs, nrows, position+1, position-1, bins[position]+1

{\bf 3.}

Cov(W,W) - Cov(W,R) + Cov(R,W) - Cov(R,R)

(3.21), algebra and symmetry of Cov(), (3.23)

{\bf 4.}

\begin{equation}
EX = \int_{0}^{1} t \cdot 2t  ~ dt = \frac{2}{3}
\end{equation}

\begin{equation}
P(X > EX) = P \left (X > \frac{2}{3} \right ) = \int_{2/3}^{1} 2t ~ dt = \frac{5}{9}
\end{equation}

{\bf 5.} Just use the definitions!

\begin{eqnarray}
s.e.(\hat{c}) &=& \textrm{estimated standard deviation of } \hat{c} ~~
   (\textrm{def. of s.e.}) \\
&=&
   \widehat
   {\sqrt
      {
      Var(\hat{c})
      }
   } ~~ (\textrm{def. of std. dev.}) \\
&=&
   \widehat
   {\sqrt
      {
      Var(2 \overline{X} + 1)
      }
   } ~~ (\textrm{def. of } \hat{c}) \\
&=&
   \widehat
   {\sqrt
      {
      4 Var(\overline{X})
      }
   } ~~ (\textrm{properties. of Var()}) \\
&=&
   2 \widehat
   {\sqrt
      {
      \frac{\sigma^2}{n}
      }
   } ~~ (\textrm{(4.9)}) \\
&=& \frac{2}{\sqrt{n}} \cdot \widehat{\sigma} ~~ (\textrm{alg.}) \\
&=& \frac{2s}{\sqrt{n}} ~~ (\textrm{def. of s})
\end{eqnarray}

A more sophisticated (and possibly a bit more accurate) way to get an
estimator of $\sigma^2$ would be the write

\begin{equation}
Var(X) = E(X^2) - (EX)^2 = 
   \frac{1}{c} \sum_{i=1}^c i^2 - \left ( \frac{c+1}{2} \right )^2 
\end{equation}

One could then plug $\hat{c}$ into this last expression for c, and use
the result as $\hat{\sigma}^2$.

{\bf 6.} Let $Y = v' X$.  Then 

\begin{eqnarray}
v' \Sigma v &=& Var(v' X) ~~ ((3.80)) \\ 
&=& Cov(Y) ~~ (\textrm{sub}) \\
&=& Var(Y) ~~ (\textrm{Cov(Y) is a 1x1 matrix consisting of Var(Y)} \\
&\geq& 0 ~~ (\textrm{variances are nonnegative})
\end{eqnarray}

\end{document}

