Reservoir Sampling – Once and for all

Today I'll talk about a topic which I consider very important – Reservoir Sampling. Imagine that you have a set of N numbers. You would like to generate a random subset of size K, such that any such subset has equal probability to be generated. In other words, every element of the set has equal…

0