Integral Evaluation Using the Monte Carlo Method

Requires a Wolfram Notebook System
Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.
Consider a selection of four functions: ,
,
, and
. The area under these curves over the unit interval is
, respectively. The Monte Carlo (MC) method can be used to approximate this integral and can be generalized easily to approximate the integral of any other function. The area is approximately the fraction of points in the light blue shaded area. The expected relative error decreases with the number of points,
, as
. The theoretical relative error is the straight red line plotted to the right on a log-log scale. The blue dot in the relative error diagram is the percent relative error obtained from the MC method. As expected, this dot lies close to the red line.
Contributed by: Housam Binousand Brian G. Higgins (November 2011)
Open content licensed under CC BY-NC-SA
Snapshots
Details
detailSectionParagraphPermanent Citation
"Integral Evaluation Using the Monte Carlo Method"
http://demonstrations.wolfram.com/IntegralEvaluationUsingTheMonteCarloMethod/
Wolfram Demonstrations Project
Published: November 29 2011