An engineer must retain a uniform random sample of exactly 10,000 records from a stream whose final size is unknown but exceeds 10,000 records. Records can be read only once, memory is limited to the sample, and arrivals follow a repeating operational cycle. Which technique BEST meets these requirements?
Show the answer
Correct answerD. Reservoir sampling with randomized replacement
AWhy not this: Buffering the full stream violates the memory limit, even though sampling afterward could produce a uniform sample.
BWhy not this: A fixed sampling interval does not ensure the required final size and can align with the repeating operational cycle.
CWhy not this: Independent inclusion with a fixed probability produces a variable count when the stream size is unknown.
DWhy this is right: Reservoir sampling maintains the required sample size while giving each record equal inclusion probability.
Reservoir sampling maintains a fixed-size uniform random sample in one pass without knowing the final stream size. Fixed-probability Bernoulli sampling produces a variable sample size; systematic sampling can also align with repeating arrival patterns.