Multi-dimensional Approximate Counting

Abstract

The celebrated Morris counter uses 22 n + O(2 σ-1) bits to count up to n with a relative error σ, where if λ is the estimate of the current count λ, then E|λ-λ|2 <σ2λ2. A natural generalization is multi-dimensional approximate counting. Let d≥ 1 be the dimension. The count vector x∈ Nd is incremented entry-wisely over a stream of coordinates (w1,…,wn)∈ [d]n, where upon receiving wk∈[d], xwk xwk+1. A d-dimensional approximate counter is required to count d coordinates simultaneously and return an estimate x of the count vector x. Aden-Ali, Han, Nelson, and Yu aden2022amortized showed that the trivial solution of using d Morris counters that track d coordinates separately is already optimal in space, if each entry only allows error relative to itself, i.e., E|xj-xj|2<σ2|xj|2 for each j∈ [d]. However, for another natural error metric -- the Euclidean mean squared error E |x-x|2 -- we show that using d separate Morris counters is sub-optimal. In this work, we present a simple and optimal d-dimensional counter with Euclidean relative error σ, i.e., E |x-x|2 <σ2|x|2 where |x|=Σj=1d xj2, 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.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…