DASH
Repository logo
Communities & Collections
Browse DASH
DASH Stories
Statistics
  1. Home
  2. Faculty of Arts and Sciences
  3. FAS Scholarly Articles
  4. An Optimal Algorithm for the Distinct Elements Problem

An Optimal Algorithm for the Distinct Elements Problem

Open/View files
f0.pdf (331.99 KB)
Date
2010
Author(s)
Kane, Daniel M.
Woodruff, David P.
DOI
10.1145/1807085.1807094
Publisher
ACM
The Harvard community has made this article openly available. Please share how this access benefits you.
Citation
Kane, Daniel M., Jelani Nelson, and David P. Woodruff. 2010. "An Optimal Algorithm for the Distinct Elements Problem." In Proceedings of the Twenty-Ninth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems of Data: PODS '10, June 6-11, 2010, Indianapolis, Indiana: 41-52. New York, NY: ACM.
Abstract
We give the first optimal algorithm for estimating the number of distinct elements in a data stream, closing a long line of theoretical research on this problem begun by Flajolet and Martin in their seminal paper in FOCS 1983. This problem has applications to query optimization, Internet routing, network topology, and data mining. For a stream of indices in {1,...,n}, our algorithm computes a \((1 \pm \epsilon)\)-approximation using an optimal \(O(1/\epsilon^{-2} + log(n))\) bits of space with 2/3 success probability, where \(0<\epsilon<1\) is given. This probability can be amplified by independent repetition. Furthermore, our algorithm processes each stream update in O(1) worst-case time, and can report an estimate at any point midstream in O(1) worst-case time, thus settling both the space and time complexities simultaneously. We also give an algorithm to estimate the Hamming norm of a stream, a generalization of the number of distinct elements, which is useful in data cleaning, packet tracing, and database auditing. Our algorithm uses nearly optimal space, and has optimal O(1) update and reporting times.
Terms of Use
This article is made available under the terms and conditions applicable to Other Posted Material (LAA), as set forth at Terms of Service
URI
http://nrs.harvard.edu/urn-3:HUL.InstRepos:13820438
Subjects

distinct elements

streaming

query optimization

data mining

Collection
FAS Scholarly Articles
Metrics
Repository logo
  • CONTACT US
  • OSRDS
  • ABOUT DASH
  • DEPOSITING TO DASH
  • TERMS OF USE
  • REQUEST A WAIVER
  • TAKE DOWN POLICY
  • NAME CHANGE POLICY
  • HARVARD OA POLICIES
  • DASH SUBMITTER AGREEMENT
  • Accessibility
  • Privacy
Creative Commons License BY
Creative Commons Attribution 4.0 International License

Except where otherwise noted, this work is subject to a Creative Commons Attribution 4.0 International License,
which allows anyone to share and adapt our material as long as proper attribution is given.
For details and exceptions, see the Harvard Library Copyright Policy
©2024 Presidents and Fellows of Harvard College.