next_inactive up previous


Computing Areas, Volumes and Integrals with Monte Carlo Method

Marek R. Rychlik

The basics

The principle of the Monte Carlo Method is to use collections of randomly generated data to evaluate areas and volumes. This method is especially useful when only a rough estimate of the quantity in question is desired, and the region or solid in question is too complicated to attempt to estimate its area or volume by exact methods.

An example

A classical example of a volume that is hard to compute is that of an intersection of a sphere with a cylinder.

For instance, let $ S$ be a solid sphere of radius 4 centered at the origin, i.e.

$\displaystyle S = \{(x,y,z): x^2+y^2+z^2 < 4^2\}.$ (1)

The cylinder is an infinite cylinder whose axis is parallel to the $ z$-axis and whose circular cross-section has radius 1:

$\displaystyle C=\{(x,y,z): (x-2)^2 + y^2<1\}$ (2)

Let $ V$ be the intersection of the two volumes. Mathematical notation for intersection if $ \cap$. Thus

$\displaystyle V=S\cap C.$ (3)

In other words,

$\displaystyle V = \{(x,y,z): x^2+y^2+z^2 < 4^2$   and$\displaystyle \quad(x-2)^2 + y^2<1\}.$

How to compute the volume of $ V$?

First we note that $ V\subseteq [-4,4]^3$.

As a digression, We use the notation $ A^3$ for the Cartesian product of sets. In general, the Cartesian product of sets $ A_1$, $ A_2$, $ \ldots$, $ A_n$, is the set of all $ n$-tupples $ (a_1,a_2,\ldots,a_n)$, where $ a_i\in A_i$ for $ i=1, 2, \ldots, n$. This Cartesian product is denoted by $ A_1\times A_2\times A_3\ldots A_n$.

When $ A_1=A_2=\ldots=A_n=A$, we write $ A^n$ instead of $ A_1\times
A_2\times\ldots\times A_n$.

Thus, $ [-1,1]^3$ denotes the set

$\displaystyle \{(x, y, z) : -4\le x, y, z\le 4\}.$

Let us denote this set by $ K$.

We know that the volume of $ K$ is $ 4^3= 64$.

In general, the folume of a body $ U$ will be denoted by $ \mathop{\mathrm{Vol}}(U)$. Also, we will need the notion of cardinality of a set, which is the same as the number of elements of a set. Let $ \mathop{\mathrm{Card}}(P)$ denote the cardinality of a set. Thus $ \mathop{\mathrm{Card}}(\{apples, oranges\}) = 2$.

Let $ F$ be a finite, randomly chosen collection of points in the cube $ K$. The formula for approximating volumes based on the Monte Carlo philosophy says that

$\displaystyle \fbox{$\mathop{\mathrm{Vol}}(V)\approx\displaystyle\frac{\mathop{\mathrm{Card}}(F\cap V)}{\mathop{\mathrm{Card}}(F)}\mathop{\mathrm{Vol}}(K).$}$ (4)

About this document ...

Computing Areas, Volumes and Integrals with Monte Carlo Method

This document was generated using the LaTeX2HTML translator Version 2002 (1.62)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 0 montecarlo.tex

The translation was initiated by Marek Rychlik on 2003-09-26


next_inactive up previous
Marek Rychlik 2003-09-26