\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 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 SHOW YOUR WORK!} 

{\bf 1.} (20) We wish to have additional output from the DES code {\bf
MM1.R}:  Among all the times that the server finishes a job, what
proportion have the property that the server immediately starts another
job?  Add code to {\bf MM1.R} to achieve this.  Your answer must be in
the form, ``Between lines 22 and 23, add the following code...''

{\bf 2.} Consider the file backup storage example on p.356, but with 
$f_X(t) = \frac{2}{9} t, 0 < t < 3$.  Express your answers as common
fractions, reduced to the lowest terms.

\begin{itemize}

\item [(a)] (25) Say we look at the end of track n, for n large.  Find the
probability that the current file has occupied all or part of exactly
three tracks so far.

\item [(b)] (25) Find the probability that the first two tracks (0 and 1)
have at most two files in it.  (In any case, the last file in the track
will necessarily be partial.)  

\end{itemize}

{\bf 3.} (30) We will draw a sample of size 2 from a population that
consists of k subgroups.  Our sampling procedure is to choose a person
at random from the entire population, and then to choose our second
person from the same subgroup that the first person belongs to.  (The
sampling is done with replacement.) The variable of interest, X, has
mean $\mu_i$ and variance $\sigma_i^2$ in subgroup i, i = 1,...,k.  A
proportion $p_i$ of the population consists of subgroup i, i = 1,...,k,
with $p_1+...+p_k = 1$.  Find the variance of the sample mean,
$\overline{X}$, in terms of these quantitites.  Your answer will use the
$\sum$ symbol, but should be reasonably concise for full credit.

{\bf Solutions:}

{\bf 1.}  The main point is to add code somewhere between lines 53 and
57 to increment the proper count.  It also must be initialized and
printed out.

{\bf 2a.}  We need P(A(n) $>$ 2.0).  So, evaluate the long-run age density 
from our book, and then integrate from 2 to 3.

{\bf 2b.}  Let $L_1$ and $L_2$ be the lengths of the two files.  We need
$P(L_1+L_2 > 1.0)$.  Drawing a picture, we see that the easiest way to
evaluate this is to find $P(L_1+L_2 < 1.0)$ and then subtract from 1.0.
That probability is equal to

$$
\int_{0}^{1} \int_{0}^{u} f_{L_1,L_2}(u,v) ~ dv ~ du
= \int_{0}^{1} \int_{0}^{u} \frac{2}{9} u \cdot \frac{2}{9} v~ dv ~ du 
= \frac{2}{243}
$$

{\bf 3.}  Use the Law of Total Expectation.

$$
Var(\overline{X}) = E[Var(\overline{X} | G)] 
+ Var[E(\overline{X} | G)]
$$

where G is the group number.

From our usual properties of $\overline{X}$ in random samples, we have

$$
E(\overline{X} | G) = \mu_G \textrm{ and }
Var(\overline{X} | G) = \sigma_G^2 / 2
$$

So,

$$
E[Var(\overline{X} | G)] = \frac{1}{2} \sum_{i=1}^k p_i \sigma_i^2
$$

Also

$$
Var \left [
E(\overline{X}|G)
\right ] =
Var(\mu_G) = E(\mu_G^2) - [E(\mu_G)]^2 =
\sum_{i=1}^k p_i \mu_i^2 - \left [\sum_{i=1}^k p_i \mu_i \right ]^2
$$

Finally, add.

\end{document} 

