English

Probabilistic Counting in Generalized Turnstile Models

Data Structures and Algorithms 2023-10-24 v1 Databases Distributed, Parallel, and Cluster Computing

Abstract

Traditionally in the turnstile model of data streams, there is a state vector x=(x1,x2,,xn)x=(x_1,x_2,\ldots,x_n) which is updated through a stream of pairs (i,k)(i,k) where i[n]i\in [n] and kZk\in \Z. Upon receiving (i,k)(i,k), xixi+kx_i\gets x_i + k. A distinct count algorithm in the turnstile model takes one pass of the stream and then estimates \normx0={i[n]xi0}\norm{x}_0 = |\{i\in[n]\mid x_i\neq 0\}| (aka L0L_0, the Hamming norm). In this paper, we define a finite-field version of the turnstile model. Let FF be any finite field. Then in the FF-turnstile model, for each i[n]i\in [n], xiFx_i\in F; for each update (i,k)(i,k), kFk\in F. The update xixi+kx_i\gets x_i+k is then computed in the field FF. A distinct count algorithm in the FF-turnstile model takes one pass of the stream and estimates \normx0;F={i[n]xi0F}\norm{x}_{0;F} = |\{i\in[n]\mid x_i\neq 0_F\}|. We present a simple distinct count algorithm, called FF-\pcsa{}, in the FF-turnstile model for any finite field FF. The new FF-\pcsa{} algorithm takes mlog(n)log(F)m\log(n)\log (|F|) bits of memory and estimates \normx0;F\norm{x}_{0;F} with O(1m)O(\frac{1}{\sqrt{m}}) relative error where the hidden constant depends on the order of the field. FF-\pcsa{} is straightforward to implement and has several applications in the real world with different choices of FF. Most notably, it makes distinct count with deletions as simple as distinct count without deletions.

Cite

@article{arxiv.2310.14977,
  title  = {Probabilistic Counting in Generalized Turnstile Models},
  author = {Dingyu Wang},
  journal= {arXiv preprint arXiv:2310.14977},
  year   = {2023}
}
R2 v1 2026-06-28T12:59:01.599Z