5.13 | Sample Online Data (Reservoir Sampling) | Elements of Programming Interviews in Python (EPI)

3 years ago
37

Note that at 10:44 in the video when I say, "you want to know the chance that the "last" element was chosen". Here, I mean "last" as in the "previous" element, and not the actual last element at the end of the stream/iterator.

Helpful links explaining Reservoir Sampling:
https://en.wikipedia.org/wiki/Reservoir_sampling
https://gregable.com/2007/10/reservoir-sampling.html

EPI (Elements of programming interviews in python), Question 5.13

Loading comments...