Skip to main content
QUICK REVIEW

[Paper Review] Simple set cardinality estimation through random sampling

Marco Bressan, Enoch Peserico|arXiv (Cornell University)|Dec 24, 2015
Machine Learning and AlgorithmsComputer Science3 references9 citations
TL;DR

This paper presents a simple, black-box algorithm for estimating the cardinality $ n $ of a set $ V $ using uniform random sampling. It guarantees a $ (1\pm\epsilon) $-approximation with probability $ 1-\delta $, requiring $ O\big{(}\sqrt{n}\cdot\epsilon^{-1}\sqrt{\log(\delta^{-1})}\big{)} $ samples, leveraging martingale concentration bounds for tight sample complexity analysis.

ABSTRACT

We present a simple algorithm that estimates the cardinality $n$ of a set $V$ when allowed to sample elements of $V$ uniformly and independently at random. Our algorithm with probability $(1-δ)$ returns a $(1\pmε)-$approximation of $n$ drawing $O\big(\sqrt{n} \cdot ε^{-1}\sqrt{\log(δ^{-1})}\big)$ samples (for $ε^{-1}\sqrt{\log(δ^{-1})} = O(\sqrt{n})$).

Motivation & Objective

  • To design a practical and analyzable algorithm for estimating the size of a set using only uniform random sampling.
  • To provide tight, non-asymptotic bounds on the number of samples required to achieve a $ (1\pm\epsilon) $-approximation with high probability $ 1-\delta $.
  • To apply modern martingale concentration inequalities to analyze the sampling process and derive sample complexity guarantees.
  • To enable the algorithm to be used as a plug-in primitive in larger algorithms requiring cardinality estimation.

Proposed method

  • The algorithm maintains a set $ S $ of seen elements and tracks the total weight $ w $ of samples and the number of repeats $ r $.
  • It uses a stopping threshold $ k = \lceil \frac{2+4.4\epsilon}{\epsilon^2} \ln(3/\delta) \rceil $ based on $ \epsilon $ and $ \delta $.
  • The algorithm terminates when the cumulative number of repeats $ r $ reaches $ k $, returning $ \hat{n} = w/r $ as the estimate.
  • It applies a martingale tail inequality (Theorem 2.2 from [1]) to bound the deviation of the repeat count from its expectation.
  • The analysis uses the martingale $ Z_i = \sum_{j=1}^i (\chi_j - P_j) $, where $ \chi_j $ indicates a repeat and $ P_j $ its conditional probability.
  • Concentration bounds are applied to both under- and over-estimation events, ensuring error probability less than $ \delta/3 $ for each tail.

Experimental results

Research questions

  • RQ1What is the minimum number of uniform random samples needed to estimate the cardinality of a set within a $ (1\pm\epsilon) $-factor with probability $ 1-\delta $?
  • RQ2Can a simple, black-box algorithm for cardinality estimation be rigorously analyzed using modern concentration inequalities?
  • RQ3How does the sample complexity scale with $ \epsilon $ and $ \delta $, and can it be bounded independently of $ n $?
  • RQ4What is the probability that the algorithm exceeds a given sample budget, and how can this be bounded?

Key findings

  • The algorithm returns a $ (1\pm\epsilon) $-approximation of the true cardinality $ n $ with probability greater than $ 1-\delta $.
  • The expected number of samples is bounded by $ \min(n, 2\lceil \sqrt{kn} \rceil) + k $, where $ k = \lceil \frac{2+4.4\epsilon}{\epsilon^2} \ln(3/\delta) \rceil $.
  • The sample complexity is $ O\big{(} \sqrt{n} \cdot \epsilon^{-1} \sqrt{\log(\delta^{-1})} \big{)} $, which is sublinear in $ n $ for small $ \epsilon $.
  • The error probability for under- or over-estimation is each bounded by $ \delta/3 $, ensuring total failure probability less than $ \delta $.
  • The analysis shows that the probability of exceeding the sample bound is less than $ \delta/3 $, completing a union bound over all failure modes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.