Home▸Algorithms & AI▸Walker Alias Method: Two-Colour Slots, Live Histogram and Chi-Square Convergence (2D)

Walker Alias Method: Two-Colour Slots, Live Histogram and Chi-Square Convergence (2D)

A flat view of the same sampler: the alias table with the last drawn slot highlighted, the live histogram against the target probabilities, and the chi-square and comparison counts. Same data and numerical checks as the 3D version.

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Walker Alias Method: Two-Colour Slots, Live Histogram and Chi-Square Convergence (2D) ↗ Open standalone

See how the alias method draws from an uneven distribution with one slot lookup and one coin flip. The Vose construction turns any set of weights into a row of equal-height slots, each holding at most two outcomes; every draw picks a slot at random and then decides between its own and its alias colour. Watch balls fly from the table into a live histogram, compare it with the target, follow the chi-square statistic towards its expected value and see how many comparisons an inverse-CDF binary search would need instead. A Blender-built scene with independent numerical checks.

⚙ Under the hood

A flat view of the same sampler: the alias table with the last drawn slot highlighted, the live histogram against the target probabilities, and the chi-square and comparison counts. Same data and numerical checks as the 3D version.

Alias MethodWeighted Random SamplingVose AlgorithmChi-Square TestMonte CarloInverse CDFAlgorithmsProbability

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)