English

Perfect $L_p$ Sampling in a Data Stream

Data Structures and Algorithms 2019-11-12 v3

Abstract

In this paper, we resolve the one-pass space complexity of LpL_p sampling for p(0,2)p \in (0,2). Given a stream of updates (insertions and deletions) to the coordinates of an underlying vector fRnf \in \mathbb{R}^n, a perfect LpL_p sampler must output an index ii with probability fip/fpp|f_i|^p/\|f\|_p^p, and is allowed to fail with some probability δ\delta. So far, for p>0p > 0 no algorithm has been shown to solve the problem exactly using poly(logn)\text{poly}( \log n)-bits of space. In 2010, Monemizadeh and Woodruff introduced an approximate LpL_p sampler, which outputs ii with probability (1±ν)fip/fpp(1 \pm \nu)|f_i|^p /\|f\|_p^p, using space polynomial in ν1\nu^{-1} and log(n)\log(n). The space complexity was later reduced by Jowhari, Sa\u{g}lam, and Tardos to roughly O(νplog2nlogδ1)O(\nu^{-p} \log^2 n \log \delta^{-1}) for p(0,2)p \in (0,2), which tightly matches the Ω(log2nlogδ1)\Omega(\log^2 n \log \delta^{-1}) lower bound in terms of nn and δ\delta, but is loose in terms of ν\nu. Given these nearly tight bounds, it is perhaps surprising that no lower bound exists in terms of ν\nu---not even a bound of Ω(ν1)\Omega(\nu^{-1}) is known. In this paper, we explain this phenomenon by demonstrating the existence of an O(log2nlogδ1)O(\log^2 n \log \delta^{-1})-bit perfect LpL_p sampler for p(0,2)p \in (0,2). This shows that ν\nu need not factor into the space of an LpL_p sampler, which closes the complexity of the problem for this range of pp. For p=2p=2, our bound is O(log3nlogδ1)O(\log^3 n \log \delta^{-1})-bits, which matches the prior best known upper bound in terms of n,δn,\delta, but has no dependence on ν\nu. For p<2p<2, 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 O((loglogn)2)O((\log \log n)^2) blow-up in the space (and no blow-up for p=2p=2). Our derandomization technique is general, and can be used to derandomize a large class of linear sketches.

Keywords

Cite

@article{arxiv.1808.05497,
  title  = {Perfect $L_p$ Sampling in a Data Stream},
  author = {Rajesh Jayaram and David P. Woodruff},
  journal= {arXiv preprint arXiv:1808.05497},
  year   = {2019}
}

Comments

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."

R2 v1 2026-06-23T03:35:50.562Z