Questions tagged [reservoir-sampling]

17 questions
0
votes
2 answers

Proof of stream reservoir sampling

I'm quite familiar with Reservoir Sampling algorithm and I'm thinking what if the total size N is given. What benefit can we get under this situation? As a result, here's the algorithm: Let n be the total size of data Let k be the total size of…
old_bear
  • 279
  • 1
  • 5
  • 14
-2
votes
1 answer

Random selection in reservoir sampling

My question is related to sample code in 'Algorithm R' section of this link https://en.m.wikipedia.org/wiki/Reservoir_sampling I copied below code snippet from that section. Why this code is replacing elements with gradually decreasing probability?…
Pradeep
  • 419
  • 5
  • 14
1
2