2020/10/05 by Jelani Nelson, Nelson, Jelani, Huacheng Yu +1 · 3 citations
Computer Science · #Algorithms and Data Compression #Complexity and Algorithms in Graphs #Data Structures and Algorithms (cs.DS) #Discrete Mathematics (cs.DM) #FOS: Computer and information sciences #Machine Learning and Algorithms
paper · pdf · doi:10.48550/arxiv.2010.02116
openalex publication_date 2020/10/05 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28
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/ε) + log(1/δ)) bits in expectation to provide a (1+ε)-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/ε) + 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).