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

You can:

(a) Use Fischer-Yates, which is fast and, if correctly implemented, unbiased, or

(b) Come up with an ad-hoc scheme like this, do some fancy math to bound its total variation distance (or, worse, some weaker concept of distance), convince yourself that the distance to the uniform distribution is acceptable, and end up with a slower algorithm when you’re done.



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

Search: