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

Reservoir sampling or Algorithm R. It allows you to randomly choose a sample of k items (with equal probability) from an "infinite" stream of items. At first it sounds impossible, but the solution and proof are extremely simple and elegant.


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

Search: