English

Approximate counting with a floating-point counter

Data Structures and Algorithms 2009-08-24 v2

Abstract

Memory becomes a limiting factor in contemporary applications, such as analyses of the Webgraph and molecular sequences, when many objects need to be counted simultaneously. Robert Morris [Communications of the ACM, 21:840--842, 1978] proposed a probabilistic technique for approximate counting that is extremely space-efficient. The basic idea is to increment a counter containing the value XX with probability 2X2^{-X}. As a result, the counter contains an approximation of lgn\lg n after nn probabilistic updates stored in lglgn\lg\lg n bits. Here we revisit the original idea of Morris, and introduce a binary floating-point counter that uses a dd-bit significand in conjunction with a binary exponent. The counter yields a simple formula for an unbiased estimation of nn with a standard deviation of about 0.6n2d/20.6\cdot n2^{-d/2}, and uses d+lglgnd+\lg\lg n bits. We analyze the floating-point counter's performance in a general framework that applies to any probabilistic counter, and derive practical formulas to assess its accuracy.

Keywords

Cite

@article{arxiv.0904.3062,
  title  = {Approximate counting with a floating-point counter},
  author = {Miklos Csuros},
  journal= {arXiv preprint arXiv:0904.3062},
  year   = {2009}
}

Comments

Updated content (fixed errors in the previous version)

R2 v1 2026-06-21T12:53:13.682Z