Inside sphere Outside sphere
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Quasi-Monte Carlo: Low-Discrepancy vs Pseudorandom Integration

This simulator races two sampling strategies at the same classic Monte Carlo task — estimating π by sampling a unit sphere inscribed in a cube — and renders every point in 3D as it lands. One stream draws points with ordinary pseudorandom numbers; the other uses a Halton low-discrepancy sequence built from the van der Corput construction in bases 2, 3 and 5, which spreads samples across the cube far more evenly than chance would. Live readouts track both running π estimates and their errors against the true value side by side, so the accuracy gap between random Monte Carlo sampling and deterministic quasi-Monte Carlo sampling is visible in real time rather than just asserted — the same convergence advantage that makes low-discrepancy sequences the workhorse of high-dimensional numerical integration in computational finance and physically based rendering.