3 ms·
Another neat property of Poisson processes is that when raced against one another, they win in proportion to their underlying rates. This property is the basis
by tmoertel 2y ago
Another neat property of Poisson processes is that when raced against one another, they win in proportion to their underlying rates. This property is the basis of a clever random sampling algorithm that works well in SQL:
SELECT *
FROM Population
WHERE weight > 0
ORDER BY -LN(1.0 - RANDOM()) / weight
LIMIT 100 -- Sample size.
For an explanation of how it works, see
https://blog.moertel.com/posts/2024-08-23-sampling-with-sql.html https://blog.moertel.com/posts/2024-08-23-sampling-with-sql....
- foldU 2y ago(author of OP) That post of yours was actually what got me tooling around with this stuff again :) it's a really excellent one
- tmoertel 2y agoThanks! That was very kind of you to say. Whenever I write stuff like that, I wonder, "Does anyone find this useful?" It helps to hear every once in a while that the answer is sometimes yes.
- gmfawcett 2y agoNice article!