Let's say we want to calculate a simple integral of the form:
But we are unable do anything else with
We could use a riemann sum, but this won't work well for high dimensional integrals, such as the rendering equation, due to the curse of dimensionality - there is just too much space to cover in the integration domain.
Instead, we can use monte carlo methods, which are stochastic methods relying on random sampling of the domain.
The basic idea of monte carlo methods is to sample the domain randomly many times, and average the results.
For our purposes, we are interested in a specific kind of monte carlo method typically called monte carlo integration, which is used for estimating definite integrals like ours.
In probability theory, we have a theorem called the Law Of The Unconcious Statistician (LOTUS):
Note that we only need the probability density on
The cornerstone of monte carlo integration is the monte carlo estimator. For our simple placeholder integral, it can be written as so: