In order to evaluate an integral:
Monte-Carlo method offers the conversion of this problem into an equivalent expected value computation problem:
where p(x) is an arbitrary probability density function.
The expectation value, on the other hand, can be estimated from M samples , generated with probability density function p: