English

Optimal streaming and tracking distinct elements with high probability

Data Structures and Algorithms 2019-01-07 v2

Abstract

The distinct elements problem is one of the fundamental problems in streaming algorithms --- given a stream of integers in the range {1,,n}\{1,\ldots,n\}, we wish to provide a (1+ε)(1+\varepsilon) approximation to the number of distinct elements in the input. After a long line of research an optimal solution for this problem with constant probability of success, using O(1ε2+logn)\mathcal{O}(\frac{1}{\varepsilon^2}+\log n) bits of space, was given by Kane, Nelson and Woodruff in 2010. The standard approach used in order to achieve low failure probability δ\delta is to take the median of logδ1\log \delta^{-1} parallel repetitions of the original algorithm. We show that such a multiplicative space blow-up is unnecessary: we provide an optimal algorithm using O(logδ1ε2+logn)\mathcal{O}(\frac{\log \delta^{-1}}{\varepsilon^2} + \log n) bits of space --- matching known lower bounds for this problem. That is, the logδ1\log\delta^{-1} factor does not multiply the logn\log n term. This settles completely the space complexity of the distinct elements problem with respect to all standard parameters. We consider also the \emph{strong tracking} (or \emph{continuous monitoring}) variant of the distinct elements problem, where we want an algorithm which provides an approximation of the number of distinct elements seen so far, at all times of the stream. We show that this variant can be solved using O(loglogn+logδ1ε2+logn)\mathcal{O}(\frac{\log \log n + \log \delta^{-1}}{\varepsilon^2} + \log n) bits of space, which we show to be optimal.

Keywords

Cite

@article{arxiv.1804.01642,
  title  = {Optimal streaming and tracking distinct elements with high probability},
  author = {Jarosław Błasiok},
  journal= {arXiv preprint arXiv:1804.01642},
  year   = {2019}
}

Comments

Preliminary version of this paper appeard in SODA 2018

R2 v1 2026-06-23T01:14:20.544Z