% This is a LaTex file.
% Homework for the course "Discrete Modeling",
% Autumn quarter, 1997, Anne Greenbaum.
% A latex format for making homework assignments.
\documentstyle[12pt]{article}
% The page format, somewhat wider and taller page than in art12.sty.
\topmargin -0.1in \headsep 0in \textheight 8.9in \footskip 0.6in
\oddsidemargin 0in \evensidemargin 0in \textwidth 6.5in
\begin{document}
% Definitions of commonly used symbols.
% The title and header.
\noindent
{\scriptsize Discrete Modeling, Winter 1998} \hfill
\begin{center}
\large
Assignment 2.
\normalsize
\end{center}
\noindent
Given Fri., Jan. 16, due Fri., Jan. 23.
\vspace{.3in}
% The questions!
\noindent
{\bf Objectives:} To learn to use MATLAB or another programming language;
to try a simple Monte Carlo computation and to understand error
estimation.
\begin{description}
\item[(1)]
Estimate the value of $\pi$ by generating unifromly distributed
random points $(x,y)$ in the square $[-1,1] \times [-1,1]$ and
seeing what fraction of these points lie in the disk
$x^2 + y^2 \leq 1$. This fraction should be an approximation
to the area of the disk ($\pi$) divided by the area of the square ($4$),
so $4$ times this fraction should be an approximation to $\pi$.
Try the experiment with $N=100,~1000,$ and $10000$ points.
Determine the error in each approximation by comparing with the "exact"
value of $\pi$, returned by MATLAB when you type \verb+pi+.
Turn in a listing of your code and a table showing the approximate
solution and the error for each value of $N$ tested.
\item[(2)]
In real problems, of course, the exact solution is not known, so
one needs an error estimate to decide how much confidence to place
in the approximate solution. For each case above, compute an error
estimate based on the standard deviation. Explain how you computed
this estimate. Suppose you ran the simulation with $10000$ points
ten thousand times, each time computing a new approximation to $\pi$.
In how many cases would you expect the actual error to be less than
or equal to your estimate?
\end{description}
\end{document}