# Optimal bounds for approximate counting

arXiv: https://arxiv.org/abs/2010.02116 · HTML: https://mlsanity.com/paper/2010.02116/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 5 Oct 2020.

## Built on by (most cited first, 1 of 1)

- [Bounded Memory Active Learning through Enriched Queries](https://mlsanity.com/paper/2102.05047/) (2021)

## Abstract (arXiv)

Storing a counter incremented N times would naively consume O(log N) bits of memory. In 1978 Morris described the very first streaming algorithm: the "Morris Counter". His algorithm's space bound is a random variable, and it has been shown to be O(loglog N + log(1/varepsilon) + log(1/δ)) bits in expectation to provide a (1+varepsilon)-approximation with probability 1-δ to the counter's value. We provide a new simple algorithm with a simple analysis showing that randomized space O(loglog N + log(1/varepsilon) + loglog(1/δ)) bits suffice for the same task, i.e. an exponentially improved dependence on the inverse failure probability. We then provide a new analysis showing that the original Morris Counter itself, after a minor but necessary tweak, actually also enjoys this same improved upper bound. Lastly, we prove a new lower bound for this task showing optimality of our upper bound. We thus completely resolve the asymptotic space complexity of approximate counting. Furthermore all our constants are explicit, and our lower bound and tightest upper bound differ by a multiplicative factor of at most 3+o(1).
