English

Succinct Approximate Rank Queries

Data Structures and Algorithms 2017-04-26 v1

Abstract

We consider the problem of summarizing a multi set of elements in {1,2,,n}\{1, 2, \ldots , n\} under the constraint that no element appears more than \ell times. The goal is then to answer \emph{rank} queries --- given i{1,2,,n}i\in\{1, 2, \ldots , n\}, how many elements in the multi set are smaller than ii? --- with an additive error of at most Δ\Delta and in constant time. For this problem, we prove a lower bound of B,n,Δ\mathcal B_{\ell,n,\Delta}\triangleq nΔ/\left\lfloor{\frac{n}{\left\lceil{\Delta / \ell}\right\rceil}}\right\rfloor log(max{/Δ,1}+1)\log\big({\max\{\left\lfloor{\ell / \Delta}\right\rfloor,1\} + 1}\big) bits and provide a \emph{succinct} construction that uses B,n,Δ(1+o(1))\mathcal B_{\ell,n,\Delta}(1+o(1)) bits. Next, we generalize our data structure to support processing of a stream of integers in {0,1,,}\{0,1,\ldots,\ell\}, where upon a query for some ini\le n we provide a Δ\Delta-additive approximation for the sum of the \emph{last} ii elements. We show that this too can be done using B,n,Δ(1+o(1))\mathcal B_{\ell,n,\Delta}(1+o(1)) bits and in constant time. This yields the first sub linear space algorithm that computes approximate sliding window sums in O(1)O(1) time, where the window size is given at the query time; additionally, it requires only (1+o(1))(1+o(1)) more space than is needed for a fixed window size.

Keywords

Cite

@article{arxiv.1704.07710,
  title  = {Succinct Approximate Rank Queries},
  author = {Ran Ben Basat},
  journal= {arXiv preprint arXiv:1704.07710},
  year   = {2017}
}
R2 v1 2026-06-22T19:27:17.566Z