jb55 on Nostr: I was randomly thinking about loot/drop table implementations in games and naturally ...
I was randomly thinking about loot/drop table implementations in games and naturally started thinking of the fastest way to implement large drop tables.
gpt5 pointed me to this fascinating algorithm that is barely mentioned online, but it can turn sample any discrete probability distribution in O(1)
https://y7k4.github.io/2021/03/23/alias-method.htmlits a bit brain bending and it took a good 20 minutes of staring to understand how it works, but its pretty cool.
#nerdsnipe
Published at
2025-08-14 04:31:39 UTCEvent JSON
{
"id": "8cacc8344e6e25b385fe09745d5bfc791b2ff2d11454a829e3c3af26aaa61a92",
"pubkey": "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245",
"created_at": 1755145899,
"kind": 1,
"tags": [
[
"client",
"Damus Notedeck"
],
[
"t",
"nerdsnipe"
]
],
"content": "I was randomly thinking about loot/drop table implementations in games and naturally started thinking of the fastest way to implement large drop tables.\n\ngpt5 pointed me to this fascinating algorithm that is barely mentioned online, but it can turn sample any discrete probability distribution in O(1)\n\nhttps://y7k4.github.io/2021/03/23/alias-method.html\n\nits a bit brain bending and it took a good 20 minutes of staring to understand how it works, but its pretty cool.\n\n#nerdsnipe",
"sig": "d9cc45ce4a7fa4d17b6216be43f3a0bad049881cd0d50e1aff2ce7d631cda084bd5724a692cfef8f6579b5e8b66384a3cb239a8b6d901b4d1dfbc8627aa8989a"
}