Importance Sampling, a simple example, and the results

The suffix \( cr \) stands for the brute force approach while \( is \) stands for the use of importance sampling. All calculations use ran0 as function to generate the uniform distribution.

\( N \) \( I_{cr} \) \( \sigma_{cr} \) \( I_{is} \) \( \sigma_{is} \)
10000 3.13395E+00 4.22881E-01 3.14163E+00 6.49921E-03
100000 3.14195E+00 4.11195E-01 3.14163E+00 6.36837E-03
1000000 3.14003E+00 4.14114E-01 3.14128E+00 6.39217E-03
10000000 3.14213E+00 4.13838E-01 3.14160E+00 6.40784E-03

However, it is unfair to study one-dimensional integrals with MC methods!