HomeMathematicsQuasi-Monte Carlo: Low-Discrepancy vs Pseudorandom Integration

Quasi-Monte Carlo: Low-Discrepancy vs Pseudorandom Integration

Watch pseudorandom Monte Carlo and a Halton low-discrepancy sequence race to estimate π by sampling a sphere inscribed in a cube, with live error readouts showing which converges faster.

Mathematics3DModerate60 FPS📱 Mobile-adapted⇄ 2D version
monte-carlo-methods-mathematics ↗ Open standalone

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.

⚙ Under the hood

Race a pseudorandom Monte Carlo sampler against a Halton low-discrepancy sequence as both estimate π by sampling a sphere inscribed in a cube, with live error readouts showing which one converges faster.

monte-carloquasi-monte-carlonumerical-integrationhalton-sequenceprobabilityconvergence

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)