English

Universal Perfect Samplers for Incremental Streams

Data Structures and Algorithms 2024-07-09 v1 Probability

Abstract

If G:R+R+G : \mathbb{R}_+ \to \mathbb{R}_+, the GG-moment of a vector xR+n\mathbf{x}\in\mathbb{R}_+^n is G(x)=v[n]G(x(v))G(\mathbf{x}) = \sum_{v\in[n]} G(\mathbf{x}(v)) and the GG-sampling problem is to select an index v[n]v_*\in [n] according to its contribution to the GG-moment, i.e., such that Pr(v=v)=G(x(v))/G(x)\Pr(v_*=v) = G(\mathbf{x}(v))/G(\mathbf{x}). Approximate GG-samplers may introduce multiplicative and/or additive errors to this probability, and some have a non-trivial probability of failure. In this paper we focus on the exact GG-sampling problem, where GG is selected from the class G\mathcal{G} of Laplace exponents of non-negative, one-dimensional L\'evy processes, which includes several well studied classes such as ppth moments G(z)=zpG(z)=z^p, p[0,1]p\in[0,1], logarithms G(z)=log(1+z)G(z)=\log(1+z), Cohen and Geri's soft concave sublinear functions, which are used to approximate concave sublinear functions, including cap statistics. We develop GG-samplers for a vector xR+n\mathbf{x} \in \mathbb{R}_+^n that is presented as an incremental stream of positive updates. In particular: * For any GGG\in\mathcal{G}, we give a very simple GG-sampler that uses 2 words of memory and stores at all times a v[n]v_*\in [n], such that Pr(v=v)\Pr(v_*=v) is exactly G(x(v))/G(x)G(\mathbf{x}(v))/G(\mathbf{x}). * We give a ``universal'' G\mathcal{G}-sampler that uses O(logn)O(\log n) words of memory w.h.p., and given any GGG\in \mathcal{G} at query time, produces an exact GG-sample. With an overhead of a factor of kk, both samplers can be used to GG-sample a sequence of kk indices with or without replacement. Our sampling framework is simple and versatile, and can easily be generalized to sampling from more complex objects like graphs and hypergraphs.

Cite

@article{arxiv.2407.04931,
  title  = {Universal Perfect Samplers for Incremental Streams},
  author = {Seth Pettie and Dingyu Wang},
  journal= {arXiv preprint arXiv:2407.04931},
  year   = {2024}
}
R2 v1 2026-06-28T17:31:01.752Z