Perfect Sampling in Turnstile Streams Beyond Small Moments
Abstract
Given a vector x ∈ Rn induced by a turnstile stream S, a non-negative function G: R R, a perfect G-sampler outputs an index i with probability G(xi)Σj∈[n] G(xj)+1poly(n). Jayaram and Woodruff (FOCS 2018) introduced a perfect Lp-sampler, where G(z)=|z|p, for p∈(0,2]. In this paper, we solve this problem for p>2 by a sampling-and-rejection method. Our algorithm runs in n1-2/p · polylog(n) bits of space, which is tight up to polylogarithmic factors in n. Our algorithm also provides a (1+)-approximation to the sampled item xi with high probability using an additional -2 n1-2/p · polylog(n) bits of space. Interestingly, we show our techniques can be generalized to perfect polynomial samplers on turnstile streams, which is a class of functions that is not scale-invariant, in contrast to the existing perfect Lp samplers. We also achieve perfect samplers for the logarithmic function G(z)=(1+|z|) and the cap function G(z)=(T,|z|p). Finally, we give an application of our results to the problem of norm/moment estimation for a subset Q of coordinates of a vector, revealed only after the data stream is processed, e.g., when the set Q represents a range query, or the set n represents a collection of entities who wish for their information to be expunged from the dataset.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.