Darts, Dice, and Coins: Sampling from a Discrete Distribution
keithschwarz.com
Earlier this year, I asked a question on Stack Overflow about a data structure for loaded dice. Specifically, I was interested in answering this question: This data structure could be used for many purposes.