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

This reminds me of "power of two" balls and bins, which is useful for load balancing. Throwing work onto a random machine doesn't work well. Picking two random machines, and throwing the work on to the less loaded machine is asymptotically better.

I think you'd see something very similar with this type of simulation.



I've tried this and the distribution stays pretty close to constant. You can check it out, just comment line 13 and uncomment 15-18: https://www.khanacademy.org/computer-programming/yet-another...


It makes sense intuitively: one bit of information (i.e. which machine to assign work to) splits the space into two options and you pick the better one at every comparison




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: