Example 6.  Let  [Graphics:Images/MonteCarloMod_gr_157.gif].  Use the Monte Carlo method to calculate approximations to the double integral  

        [Graphics:Images/MonteCarloMod_gr_158.gif].  

Solution 6.

[Graphics:../Images/MonteCarloMod_gr_159.gif]


[Graphics:../Images/MonteCarloMod_gr_160.gif]

[Graphics:../Images/MonteCarloMod_gr_161.gif]



[Graphics:../Images/MonteCarloMod_gr_162.gif]

[Graphics:../Images/MonteCarloMod_gr_163.gif]

[Graphics:../Images/MonteCarloMod_gr_164.gif]

 

 

 

[Graphics:../Images/MonteCarloMod_gr_165.gif]

[Graphics:../Images/MonteCarloMod_gr_166.gif]

[Graphics:../Images/MonteCarloMod_gr_167.gif]

 

 

 

[Graphics:../Images/MonteCarloMod_gr_168.gif]

[Graphics:../Images/MonteCarloMod_gr_169.gif]

[Graphics:../Images/MonteCarloMod_gr_170.gif]

 

 

We are done!

Aside.  We can use Mathematica's subroutine NIntegrate to perform Monte Carlo integration, and we can verify that it is computing the same results as our subroutine MonteCarloIntegral2D.

    We will need to seed the random number generator with the same integer so that we get the same sequence of random numbers.

[Graphics:../Images/MonteCarloMod_gr_171.gif]

[Graphics:../Images/MonteCarloMod_gr_172.gif]


[Graphics:../Images/MonteCarloMod_gr_173.gif]

[Graphics:../Images/MonteCarloMod_gr_174.gif]

Observe that the results are the same.

We are really done!  

Aside.  The analytic value of the double integral can be found.

[Graphics:../Images/MonteCarloMod_gr_175.gif]


[Graphics:../Images/MonteCarloMod_gr_176.gif]

[Graphics:../Images/MonteCarloMod_gr_177.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2005