Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
unsupported
on Oct 17, 2018
|
parent
|
context
|
favorite
| on:
Ask HN: What's your favorite elegant/beautiful alg...
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: