

% STA 2201S 2001 Assignment 4


\documentclass[12pt]{article} 
%\usepackage{amsbsy} % for \boldsymbol and \pmb 
\pagestyle{empty} % No page numbers

\oddsidemargin=0in                   % better for US Letter paper
\evensidemargin=0in
\textwidth=6.3in

\topmargin=-0.4in
\headheight=0.2in
\headsep=0.5in
\textheight=9.4in                 


\begin{document}
%\enlargethispage*{1000 pt} 

\begin{center}   
{\Large \textbf{STA 2201S 2001 Assignment 4}}\\
\vspace{1 mm}
Quiz on Thursday Febuary 8th. Bring printouts to the quiz.
\end{center}   

 \begin{enumerate}

    \item As we saw in class, a natural way to construct a Monte Carlo estimate of a probability $p$ is to simulate a collection of \emph{i.i.d.} random variables $Y_1, \ldots, Y_m$ with $Pr\{Y_i=1 \}=p$ and $Pr\{Y_i=0 \}=1-p$ for $i=1, \ldots, m$. The Monte Carlo approxiation of $p$ is then $\overline{Y}_m$. Any time we do this, we should accompany our estimate with a confidence interval, to indicate the proabble accuracy of our approximation. Our 99\% confidence interval will be $\overline{Y}_m$ plus or minus a ``99\% margin of error." Using this vocabulary,
     \begin{enumerate}
        \item Find the Monte Carlo sample size for this \emph{i.i.d.} Bernoulli case so that the 99\% margin of error is \emph{guaranteed} to be less than 0.001. I get a number in excess of 1.6 million. Ouch.
        \item What Monte Carlo sample size is required if the 99\% margin of error is to be at most 0.01?
        \item Suppose we are interested in estimating a power that is to be 0.80 or more. Now what Monte Carlo sample size is required if the 99\% margin of error is to be at most 0.01?
     \end{enumerate}
Bring your printout.
    
    \item Sometimes, Monte Carlo estimates of $p$ are based on simulating \emph{i.i.d.} $Y_1, \ldots, Y_m$ that are not Bernoulli, but still satisfy $E[Y_i]=p$.  As before, we use $\overline{Y}_m$ as our Monte Carlo approximation, and it converges by the Strong Law of Large Numbers. The quantities $Y_1, \ldots, Y_m$ are usually conditional probabilities, so that $0 \leq Y_i \leq 1$. Show that the required Monte Carlo sample sizes you calculated in Question One also apply to this case, as follows.

Let $Y$ be a random variable that is arbitrary except that $Pr\{0 \leq Y \leq 1 \}=1$ and $E[Y]=\theta$. Prove $Var(Y) \leq \theta (1-\theta)$.

    \item Let the random variable $X$ have density

\begin{displaymath}
f(x) =  \int_{-\infty}^{\infty} \frac{1}{\sqrt{2 \pi}} 
        e^{-\frac{1}{2}(x-u)^2} \, \frac{1}{\pi (1+u^2)}   \,du.
\end{displaymath}
 
Approximate $Pr\{X<0 \}$ by Monte Carlo. Accompany your estimate by a large-sample confidence interval of width no more than 0.02. Bring your printout.

Some comments: This density is a location mixture of normals, in which the mixing distribution is standard Cauchy. It's symmetric about zero, so the answer is exactly one-half. I did the computer part two different ways, the \emph{i.i.d.} Bernoulli way, and another way that turned out to be more efficient. In each case it took only a few lines of code. 

 \end{enumerate}
 
 
\end{document}

   
