\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 1.} (20) Your chemistry professor announces the results of the
midterm exam:  Mean 18 and standard deviation 5.  She says that since
the scores were so low, she is going to multiply all scores by 2 and
then add 10.  What will be the new mean and standard deviation?  Answer
using R's {\bf c()} notation, e.g. {\bf c(88,-8)} if you think the new
mean and standard deviation will be 88 and -8, respectively.

{\bf 2.} (25) Consider the ALOHA example, Sec.\ 2.5 (and $p = 0.4$, $q =
0.8$).  Let $O_k$ denote the number of original messages that are still
pending at the end of epoch $k$, $k = 1,2,...$.  We are just concerned
with $k = 1$.  Find $E(O_1)$.

{\bf 3.} (15) Suppose $K$ and $L$ are independent indicator random
variables, with event probabilities $p$ and $q$.  Supply the
\underline{reasons} for each step in the following derivation, in which
$a$ and $b$ are constants.  The reasons should cite equations or
properties, maybe algebra, say with Eqns. (2.10)-(2.13) as an example.
You will have answers (a), (b) and (c), i.e. 6 lines in your electronic
file.

\begin{eqnarray*}
Var(aK + bL)
&=& Var(aK) + Var(bL) ~~ \textrm{(reason (a))} \\ 
&=& a^2 Var(K) + b^2 Var(L) ~~ \textrm{(reason (b))} \\
&=& a^2 p(1-p) + b^2 q(1-q) ~~ \textrm{(reason (c))}
\end{eqnarray*}

{\bf 4.} (20) Say we have a random variable $X$, of which we simulate many
instances, resulting in an R vector {\bf w}.  We make the R call

\begin{lstlisting}
mean(w > mean(w))
\end{lstlisting}

State what quantity this is approximating.  Your answer must use math
symbols such as E(), P(), Var(), X and punctuation --- no code and no
English.

{\bf 5.} (20) In the context of p.65, find $Cov(G_1,G_2)$.  

\onecolumn

\newpage

{\bf Solutions:}

{\bf 1.} 
\begin{lstlisting}
c(46,10)
\end{lstlisting}

{\bf 2.}

\begin{equation}
1 \times 2(0.4)(1-0.4) +
2 \times (0.4^2 + (1-0.4)^2)
\end{equation}

{\bf 3.a} Eqn. (3.75)

{\bf 3.b} Property G

{\bf 3.c} Eqn. (3.79)

{\bf 4.} $P(X > EX)$

{\bf 5.} 

\begin{eqnarray}
Cov(G_1,G_2) 
&=& E(G_1 G_2) - E(G_1) \cdot E(G_2) \\
&=& r - (\frac{2}{3})^2
\end{eqnarray}

where

\begin{equation}
r = P(G_1 G_2 = 1) =
\frac{2}{3} \cdot
\frac{5}{8}
\end{equation}

Note that $G_1 G_2$ is itself an indicator random variable.
\end{document}
