# Confusion about Monte Carlo integration

I find I can not really understand the Monte Carlo integration, even I use it for many applications, like stochastic ray tracing.

Let us take circle-area-calculation for an example,

First, we think about the familiar integration method: Informally speaking, the integration is limit of infinite sum, and intuitively, every summand(or integrand) should have same dimension(unit) as the result of integration.

In the circle area calculation example, every summand(infinitesimal area patch) has the same unit as result of integration(that is, $m^2$).

But in Monte Carlo integration, I find it is integrating a function of random variable. This makes me confused. Because I think the random variable has no unit/dimension.

Given dimension-less(I am not sure is it dimension-less) integrand, why does the MC integration finally converge to a value represents "area", which has a unit of $m^2$?

-

In Monte Carlo integration, you are approximating $\int_a^bf(x)\,dx$ by $(1/n)\sum_1^nf(x_n)$ where the $x_n$ are chosen independently and uniformly from the interval $[a,b]$. You can interpret $(1/n)f(x_n)$ as the area of a rectangle of height $f(x_n)$ and base $1/n$, so you are adding up the areas of those rectangles. In general, the rectangles will overlap and will also miss out some of the region between the graph of $f$ and the $x$-axis, but if $n$ is large and $f$ is well-behaved these two sources of error will tend to balance out, leaving an estimate for the area.