Example 2.  Use Monte Carlo simulation to approximate the integral  [Graphics:Images/MonteCarloPiMod_gr_74.gif]

Solution 2.

Set up the function and the rectangular box enclosing the area.

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


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

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

Explore what happens with  [Graphics:../Images/MonteCarloPiMod_gr_78.gif]  points.

 

 

 

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

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

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

 

 

 

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

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

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

 

 

 

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

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

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

 

 

We are done.  

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

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



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

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2005