paper

Multi-dimensional Approximate Counting

arXiv:2411.03071

Abstract

The celebrated Morris counter uses bits to count up to with a relative error , where if is the estimate of the current count , then . A natural generalization is \emph{multi-dimensional} approximate counting. Let be the dimension. The count vector is incremented entry-wisely over a stream of coordinates , where upon receiving , . A \emph{-dimensional approximate counter} is required to count coordinates simultaneously and return an estimate of the count vector . Aden-Ali, Han, Nelson, and Yu \cite{aden2022amortized} showed that the trivial solution of using Morris counters that track coordinates separately is already optimal in space, \emph{if each entry only allows error relative to itself}, i.e., for each . However, for another natural error metric -- the \emph{Euclidean mean squared error} -- we show that using separate Morris counters is sub-optimal. In this work, we present a simple and optimal -dimensional counter with Euclidean relative error , i.e., where , with a matching lower bound. The upper and lower bounds are proved with ideas that are strikingly simple. The upper bound is constructed with a certain variable-length integer encoding and the lower bound is derived from a straightforward volumetric estimation of sphere covering.

Multi-dimensional Approximate Counting · wovepaper