3 ms·
Actually you'd expect a collision with 50% probability after only a much smaller fraction of the 2^64 space. This would be the birthday paradox, and unfortunat
by simcop2387 8y ago
Actually you'd expect a collision with 50% probability after only a much smaller fraction of the 2^64 space. This would be the birthday paradox, and unfortunately I can't find a calculator or software at the moment that can handle 2^64 power factorial to calculate it properly.
- Gasparila 8y agoBack of the envelope math for birthday paradox is root n. So in this case with ~50% probability you'll get a collision after 2^32 IDs (or after 4 seconds of 1 billion writes a second)
- andreareina 8y agoSquare rooting will get you in the proper ballpark. I imagine that's why UUIDs are 128-bit values.
- garmaine 8y agoCorrect on both counts.
- throwawaymath 8y agoAh, good point. I'm aware of the birthday paradox but I took (2^n)/2 = 2^(n-1) instead of 2^(n/2) as the birthday bound. Nice correction :)