Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I hoped to hear a positive response. At the same time, I was trying to impart a lesson that it took young-engineer-me a lot of time to really grasp, which is that you can trust PRNGs and randomness as engineering building blocks (and reciprocal-2-to-the-power-of-a-lot events are unintuitively rare).

On the first:

PRNGs work because they are not random in ways that are very weakly correlated with things you might want to simulate, but there are cases where you do get correlation, and I'm not really sure what those cases are, and read some technical explanations but nothing intuitive enough to be able to look at a real world scenario like this and intuitively grasp that here is one of those rare situations where an LCG is not enough but a Mersenne Twister is, or harder - a Mersenne Twister is not enough but real random data sampled from some physical system and normalized by XORing to a Mersenne Twister is. If you're one of those people that have this skill, maybe you can explain it to me intuitively.

On the second:

The best example is trusting cryptographic hashes. When I was young I saw systems that use a file's hash as that file's unique identifier, that were built on the completely unflexible assumption that there will never, ever be a collision, because that would completely bork the system. I had a bad feeling whenever I saw this assumption being made, because, I mean, yeah, hashes have many bits, but can't it happen even once, somewhere around the world, that two files would be found that have the same hash? There are still so many more files than hashes...

And the answer is no. It can't. Oncce a decade or so your hash algorithm will be successfully broken and you'll need to replace it with a stronger one, but it probably never happened in the entire history of humanity and never will that two files were created that have the same cryptographic hash by coincidence. It's completely reasonable to make this assumption. Just as it is completely reasonable to use a long number as an authentication token, etc' etc'.

We humans simply don't have a mechanism in our brain for representing "a nonzero chance that might happen but is so small that it is inconceivable that it would ever happen even once in the history of the world". So we see "possible" and feel deep in our bones "might happen". And we're worse engineers for it.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: