An old blog post by Keith Schwarz that builds (in an easy IMHO to follow way) sampling of a discrete distribution using "alias tables" and building via Vose's method.

https://www.keithschwarz.com/darts-dice-coins/

Comments