Algorithms, Sampling.
t.List[A]: return self.sample Example Does it work? Let’s rerun the same experiment as before: cnt = collections.defaultdict(int) for idx in range(iters): r = Reservoir(k=5, seed=idx + 1) for x in range(6): r.add(item=x) cnt[frozenset(r.show())] += 1 {k: v / iters for k, v in cnt.items()} outputs: