Algorithms, Sampling.
Motivation Can we sample k elements from a large stream of data (with n elements) where at any point with n >= k elements, we have a uniformly random sample of size k? Say k=5 and n = 1,000,000, obviously we can just do this: np.random.seed(0) # for reprodubility n = 1_000_000 k = 5 data_stream =