Exercise "Monte Carlo integration"

  1. Implement plain Monte Carlo multi-dimensional integration.
  2. Calculate 0π  dx/π 0π  dy/π 0π  dz/π [1-cos(x)cos(y)cos(z)]-1 = Γ(1/4)4/(4π3) ≈  1.3932039296856768591842462603255
  3. Calculate some interesting integrals with your Monte-Carlo routine.
  4. If you are using C/C++, compare your implementation with the GSL's gsl_monte_plain_integrate and gsl_monte_vegas_integrate.
  5. If there exists a Monte Carlo package for your language, compare it with your implementation.

Projects

  1. Stratified sampling.
  2. Quasi-random sampling.