\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.} (10) On p.144, in an application of the Central Limit Theorem, it
states ``The exact answer [to 3 decimal places] is 0.132.''  Write an R
expression that would give us to that exact answer.

{\bf 2.} (10) Consider the network intrusion example, Section 6.2.
(Suppose it really is Jill, no intrusion.) Find $P(510 < X < 535)$.

{\bf 3.} This problem concerns the toy population example, Section
10.1.2.  
\begin{itemize}

\item [(a)] (10) Find $F_{\overline{X}}(69.2)$.

\item [(b)] (15) Find $P(\overline{X} > EX)$.

\item [(c)] (15) Find $Var(\overline{X})$.

\item [(d)] (15) In this part only, suppose we draw a {\it simple} random
sample of size 2.  Find $E(X_1 X_2)$.

\end{itemize}

{\bf 4.} Suppose $f_X(t) = \frac{3}{c^3}t^2$ on (0,c), 0 elsewhere.
Call this the ``t2 family.''  

\begin{itemize}

\item [(a)] (10) Write (on one line) {\bf pt2(x,c)}, for scalar {\bf x}.

\item [(b)] (15) Write (on one line) {\bf rt2(n,c)}, to generate {\bf n}
random variates.

\end{itemize}

\onecolumn

\newpage

{\bf Solutions:}

{\bf 1.}

\begin{lstlisting}
1 - pbinom(12,20,0.5)
\end{lstlisting}

{\bf 2.}

\begin{lstlisting}
pnorm(535,500,15) - pnorm(510,500,15) 
\end{lstlisting}

{\bf 3a.}  

$$
P(\overline{X} \leq 69.2) = P(\overline{X} = 69) = 1/9
$$

{\bf 3b.}

$$
EX = 
\frac{1}{3} \cdot 69 +
\frac{1}{3} \cdot 70 +
\frac{1}{3} \cdot 72 = 211/3 = 70 \frac{1}{3}
$$

$$
P(\overline{X} > 211/3) = P(\overline{X} \textrm{ is one of } 70.5,71,72) = 
\frac{2}{9} +
\frac{2}{9} +
\frac{1}{9} 
$$

{\bf 3c.} 

$$
Var(\overline{X}) = Var(X)/2 = [E(X^2)-(EX)^2] / 2 =
[\frac{1}{3} (69^2+70^2+72^2) - (\frac{211}{3})^2] / 2
$$

{\bf 3d.}

$$
E(X_1 X_2) =
\frac{1}{6} 
(
69 \cdot 70 +
69 \cdot 72 +
70 \cdot 69 +
70 \cdot 72 +
72 \cdot 69 +
72 \cdot 70 
)
$$

{\bf 4a.}

\begin{lstlisting}
function(x,c) (t/c)^3
\end{lstlisting}

{\bf 4b.}

\begin{lstlisting}
rtc <- function(n,c) c * runif(n)^(1/3)
\end{lstlisting}

\end{document}

