HNNewShowAskJobs
Built with Tanstack Start
Darts, Dice, and Coins: Sampling from a Discrete Distribution (2011)(keithschwarz.com)
5 points by davikr 6 days ago | 2 comments
  • incognito12427 minutes ago

    This is good for sampling from a "static" distribution, which has stable p_i parameters, where you can armotize the alias preprocessing step.

    If you have a distribution that changes from time to time, for example LLMs where you have a new discrete distribution for every step (N-dimensional dice roll), other methods are used. Recently I wrote a writeup comparing three methods (spoilers: simple is best):

    https://news.ycombinator.com/item?id=42596716

    • incognito1249 minutes ago |parent

      Ah my domain changed in the meantime, this is the correct URL:

      https://terra-incognita.blog/posts/9