Monte Carlo Method to Estimate Volume

421 Views Asked by At

I am trying to use the Monte Carlo method to estimate the volume of spheres from 1D up to 10D (the actual volumes are listed here). I am trying to work out if my theory here is correct. Say I draw $n=10000$ uniformly distributed points from 0 to 1.

For the 2D case, I'd consider dimensions $x_1$ and $x_2$ and count the number of points $A$ such that $x_1^2+x_2^2<1$. The estimate of the volume of the 2D unit circle (area in this case), would be the number of points $A$ divided by $n$ and multiplied by four to make it the volume of a full circle (not just a quarter of one).

To increase this by one dimension (3D), I'd just add an extra dimension $x_3$ and count the number of points $A$ such that $x_1^2+x_2^2+x_3^2<1$. The estimate of the volume of the unit sphere would then again be the number of points $A$ divided by $n$, but this time multiplied by eight.

So an $d$ increase in dimension corresponds to an added $x_d$ variable to be considered, and to calculate volume you'd just use the same previous formula for $d-1$ dimensions and multiply that by 2?

Is this correct? Sorry if my explanation isn't perfect, I'm just trying to confirm that I'm on the right track here.