logoalt Hacker News

tmoertel • yesterday at 8:31 PM • 0 replies • view on HN

> Poisson is such an under-utilized distribution for these kinds of phenomena.

Yeah, Poisson distributions show up everywhere if you are paying attention. You can even use the theory as the basis for a fast, elegant algorithm to take parallel, weighted random samples. You can even do it in SQL!:

    SELECT *
    FROM Population
    WHERE weight > 0
    ORDER BY -LN(1.0 - RANDOM()) / weight
    LIMIT 100  -- Sample size.
For more on the Poission connection, see: https://blog.moertel.com/posts/2024-08-23-sampling-with-sql....