next up previous
Next: Exercise 10.2: Importance of Up: Monte Carlo error analysis Previous: Monte Carlo error analysis

Exercise 10.1: One dimensional integration

  1. Write a program that implements the ``hit and miss'' Monte Carlo integration algorithm. Find the estimate $I(N)$ for the integral of

    \begin{displaymath}
f(x)=4\sqrt{1-x^2}
\end{displaymath}

    as a function of $N$, in the interval $(0,1)$. Choose $H=1$, and sample only the $x$-dependent part $\sqrt{1-x^2}$, and multiply the result by 4. Calculate the difference between $I(N)$ and the exact result $\pi$. This difference is a measure of the error associated with the Monte Carlo estimate. Make a log-log plot of the error as a function of $N$. What is the approximate functional deppendece of the error on $N$ for large $N$?

  2. Estimate the integral of $f(x)$ using the simple Monte Carlo integration by averaging over $N$ points, using (270), and compute the error as a function of $N$, for $N$ upt to 10,000. Determine the approximate functional deppendence of the error on $N$ for large $N$. How many trials are necessary to determine $I_N$ to two decimal places?

  3. Perform 10 measurements $I_n(N)$, with $N=10,000$ using different random sequences. Show in a table the values of $I_n$ and $\sigma$ according to (270) and (271). Use (272) to estimate the standard deviation of the means, and compare to the values obtained from (273) using the 100,000 values.

  4. To verify that your result for the error is independent of the number of sets you used to divide your data, repeat the previous item grouping your results in 20 groups of 5,000 points each.


next up previous
Next: Exercise 10.2: Importance of Up: Monte Carlo error analysis Previous: Monte Carlo error analysis
Adrian E. Feiguin 2009-11-04