Perfect Sampling in a Data Stream
arXiv:1808.05497
Abstract
In this paper, we resolve the one-pass space complexity of sampling for . Given a stream of updates (insertions and deletions) to the coordinates of an underlying vector , a perfect sampler must output an index with probability , and is allowed to fail with some probability . So far, for no algorithm has been shown to solve the problem exactly using -bits of space. In 2010, Monemizadeh and Woodruff introduced an approximate sampler, which outputs with probability , using space polynomial in and . The space complexity was later reduced by Jowhari, Sağlam, and Tardos to roughly for , which tightly matches the lower bound in terms of and , but is loose in terms of . Given these nearly tight bounds, it is perhaps surprising that no lower bound exists in terms of ---not even a bound of is known. In this paper, we explain this phenomenon by demonstrating the existence of an -bit perfect sampler for . This shows that need not factor into the space of an sampler, which closes the complexity of the problem for this range of . For , our bound is -bits, which matches the prior best known upper bound in terms of , but has no dependence on . For , our bound holds in the random oracle model, matching the lower bounds in that model. Moreover, we show that our algorithm can be derandomized with only a blow-up in the space (and no blow-up for ). Our derandomization technique is general, and can be used to derandomize a large class of linear sketches.
An earlier version of this work appeared in FOCS 2018, but contained an error in the derandomization. In this version, we correct this issue, albeit with a (log log n)^2 -factor increase in the space required to derandomize the algorithm for p<2. Our results in the random oracle model and for p = 2 are unaffected. We also give alternative algorithms and additional applications."