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

\usepackage{amsmath}


\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 AT THE END OF THE EXAM:}  E-mail me your code, in a single file
named {\bf ID1.ID2...R}, where the ID values are the student ID numbers
of the members of your group (only those present, of course).

Suppose we sample q people at random from a population consisting of m
individuals, numbered 1,...,m.  There are three subpopulations:  Those
numbered 1,...,c; those numbered c+1,...,c+d, and those numbered
c+d+1,...,m.  Let X, Y and Z denote the numbers of people who fall into
the three subpopulations.

\begin{itemize}

\item [(a)] () Suppose the sampling is {\it with} replacement.  Find the
exact value of $p_{X,Y,Z}(i,j,k)$.  {\it Express your answer as an R
function}, {\bf rplcsamp(m,q,c,d,i,j,k)}.

\item [(b)] () Same as (a), except that sampling is {\it without}
replacement.  Your R function will be {\bf norplcsamp(m,q,c,d,i,j,k)}.

\item [(c)] () Same as (b), except that the probability is found via
simulation.  The call is {\bf simnorplcsamp(m,q,c,d,i,j,k,nreps)}, with a
default value of 10000 for {\bf nreps}.

\end{itemize}

Do NOT include any error-checking code.

\end{document}

