\documentclass[twocolumn]{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}

\begin{document}

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

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

Directions: {\bf \Large Work only on this sheet} (on both sides, if
needed).  MAKE SURE TO COPY YOUR ANSWERS TO A SEPARATE SHEET FOR SENDING
ME AN ELECTRONIC COPY LATER.

{\bf Important note:}  Remember that in problems calling for R code or a
numerical answer, you are allowed to use any built-in R function, e.g.
{\bf choose()}, {\bf pnorm()}, etc.

{\bf 1.}  Suppose X has the density 2(1-t) for t in (0,1) and 0 elsewhere.

\begin{itemize}

\item [(a)] (10) Find $P(X > 0.5)$.

\item [(b)] (10) Find $EX$.

\item [(c)] (15) Find $F_X(0.2)$.

\item [(d)] (10) Could the density be 5(1-t) on (0,1)? Explain why or why
not ({\it in one line}!).

\end{itemize}

{\bf 2.}  Sam has a die that he wants to test for fairness, in this case
defined to be $H_0: p = 1/6$, where p is the probability of getting a 1.
He will roll the die until he gets the first 1; let $N_1$ denote the
number of rolls needed.  He'll then do it again; let $N_2$ denote the
number of rolls needed this time.  He'll do it n times in all.
Then he will calculate

\begin{equation}
\overline{N} = \frac{N_1+...+N_{n}}{n}
\end{equation}

Suppose, unknown to Sam, the actual value of p is 0.20.

\begin{itemize}

\item [(a)] (10) Find $P(N_1 = 5)$.

\item [(b)] (15) Find (exactly) $P(\overline{N} = 1.5)$ for the case n =
2.  (Remember to ask yourself, ``How can it happen?'')

\item [(c)] (10) Find (approximately) $P(\overline{N} < 5.2)$ for the case
n = 100.

\item [(d)] (10) What will be the approximate value of the quantity
$\frac{1}{100} \sum_{i=1}^{100} N^2_i$?

\item [(e)] (10) Again assuming n = 100, suppose Sam finds that
$\overline{N} = 7.5$.  Find the p-value.

\end{itemize}

\onecolumn
{\bf Solutions:}

{\bf 1.a}

$$
P(X > 0.5) = \int_{0.5}^{1.0} 2(1-t) ~ dt = 1/4
$$

{\bf 1.b}

$$
EX = \int_{0.5}^{1.0} ~ t \cdot 2(1-t) dt = 1/3
$$

{\bf 1.c}

$$
P(X < 0.2) = \int_{0}^{0.2} 2(1-t) ~ dt = 0.36
$$

{\bf 1.d} No, integral would be $>$ 1.

{\bf 2.a}

$$
0.8^4 \cdot 0.2
$$

{\bf 2.b}

$$
P(N_1 = 1 \textrm{ and } N_2 = 2 \textrm{ or } 
  N_2 = 1 \textrm{ and } N_1 = 2) = 2 \cdot 0.2 \cdot 0.8 \cdot 0.2
$$

{\bf 2.c} $\overline{N}$ is approximately normally distributed with mean
1/0.2 = 5 and variance $(0.8 / (0.2)^2) / 100$.  Thus the
probability is

\begin{lstlisting}
pnorm(5.2,mean=5.0,sd=sqrt(0.8/(0.2^2)/100))
\end{lstlisting}

{\bf 2.d} Use (9.21).  The quantity is question is

$$
s^2 + \overline{N}^2
$$

which for large n is approximately

$$
Var(N) + (EN)^2 = 0.8/(0.2^2) + 5^2 = 45.
$$

{\bf 2.e} Using similar reasoning as in {\bf 2.c}:

\begin{lstlisting}
2*(1 - pnorm(7.5,mean=6.0,sd=sqrt((0.83/(0.17^2)/100))))
\end{lstlisting}

\end{document}

