---
answer: direct
beat: system-design
source: 1 article · updated: August 16, 2026
---

Why use the harmonic mean instead of a simple average?

The harmonic mean naturally handles the 2^(-M) probabilities that underpin the leading-zeros calculation, yielding an unbiased cardinality estimate. Simple averaging would produce systematic errors at very high cardinalities.

Answered in

Count Billions in 12 Kilobytes

HyperLogLog estimates cardinality by reading leading zeros in hashed values, trading 1% error for fixed memory.

Crashtech Editorial August 16, 2026 System Design

Read the full analysis

Other questions this article answers

More system design questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design beat.