reservoir sampling: Nonlinear Function
Created: May 10, 2022
Modified: May 10, 2022

reservoir sampling

This page is from my personal notes, and has not been specifically reviewed for public consumption. It might be incomplete, wrong, outdated, or stupid. Caveat lector.

Reservoir samplers solve the following task: sample kk items without replacement from a stream of unknown length nn.

Because the length is unknown, the algorithm must be ready to return a sample at all times, so we could also think of reservoir samplers as 'online' or 'streaming' samplers.

Reference: https://en.wikipedia.org/wiki/Reservoir_sampling