Lesson 14 of 15
20. Probabilistic Data Structures

Sources

3 min read+10 XP

Source notes

  • Bloom filters: Burton H. Bloom, "Space/Time Trade-offs in Hash Coding with Allowable Errors", Communications of the ACM, 1970. Sizing formulas are the standard results; numbers computed by the chapter's code.
  • Counting Bloom filters: Li Fan et al., "Summary Cache: A Scalable Wide-Area Web Cache Sharing Protocol", 2000.
  • HyperLogLog: Philippe Flajolet et al., "HyperLogLog: the analysis of a near-optimal cardinality estimation algorithm", 2007 (standard error ≈ 1.04/√m). Redis HyperLogLog: up to 12 KB per key, 0.81% standard error, PFADD/PFCOUNT/PFMERGE: Redis documentation, checked 2026-10-08.
  • Count-min sketch: Graham Cormode and S. Muthukrishnan, "An Improved Data Stream Summary: The Count-Min Sketch and its Applications", 2005.
  • Space-Saving: Ahmed Metwally, Divyakant Agrawal and Amr El Abbadi, "Efficient Computation of Frequent and Top-k Elements in Data Streams", 2005. Misra-Gries: Jayadev Misra and David Gries, "Finding Repeated Elements", 1982.
  • Bloom filters per SSTable in Cassandra and RocksDB: Apache Cassandra and RocksDB documentation.
  • Account, visitor and search volumes are illustrative assumptions; arithmetic computed 2026-10-08.
  • Level 3 and Level 4 code: tested 2026-10-08 (code/ch20_probabilistic.py, all checks pass).