Consider the example


If xmax = ymax = 3, the answer is meaningful. If xmax = ymax = 100, the answer is slightly smaller, while for xmax = ymax = 1000, the answer is zero. This means that QuasiMonteCarlo method evaluates the integral to zero if in most part of the integration domain the integrand is zero.

Could you please tell me whether there is some way to fix this problem?

  • 2
    $\begingroup$ The chance that a random point thrown into a square of size $1000 \times 1000$ to land in the quarter of the disk of radius 3 is about 7.06858*10^-6. So if it comes to Monte Carlo methods, that just does never happen. $\endgroup$ Commented Oct 5, 2018 at 22:37

1 Answer 1

xmax = ymax = 1000;
NIntegrate[UnitStep[9 - x^2 - y^2], {x, 0, xmax}, {y, 0, ymax}, 
 Method -> {"QuasiMonteCarlo", "SymbolicProcessing" -> True}]



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.