# HyperLogLog Estimates Vocabulary Size with 2.71% Error Using Only 4,096 Registers

Original title: Sorting, hashing, and sketches on 370,103 words

> Hacker News story 49209971 · language: en · submitted 2026-08-07
> Web version: https://zeli.app/story/49209971
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 18 · by [Anon84](<https://news.ycombinator.com/user?id=Anon84>) · 💬 1
[original](<https://stochastic.blog/sorting-hashing-and-sketches-on-370-103-words/>) · [HN discussion](<https://news.ycombinator.com/item?id=49209971>)

## Summary

In this post, we put Python's core containers to the test on a real dataset: 370,103 unique English words. We sort them six ways, hash them into four structures, and sketch them with four probabilistic algorithms, tracking time and memory costs. The standout result: HyperLogLog estimates vocabulary size with just 2.71% error using only 4,096 registers. We also explore complexity analysis, showing how Big-O, Big-Theta, and amortized analysis predict real behavior, and implement classic sorts like quicksort from scratch.

## Key quote

> The headline: HyperLogLog estimates the vocabulary size with just 2.71 percent error using only 4,096 registers.

---

## Cite

- Page: https://zeli.app/story/49209971
- Date: 2026-08-07
- Source: stochastic.blog (https://stochastic.blog/sorting-hashing-and-sketches-on-370-103-words/)
- Hacker News: https://news.ycombinator.com/item?id=49209971

## Other languages

- zh: https://zeli.app/zh/story/49209971 · markdown: https://zeli.app/zh/story/49209971.md
- ja: https://zeli.app/ja/story/49209971 · markdown: https://zeli.app/ja/story/49209971.md
- ko: https://zeli.app/ko/story/49209971 · markdown: https://zeli.app/ko/story/49209971.md
- de: https://zeli.app/de/story/49209971 · markdown: https://zeli.app/de/story/49209971.md
- es: https://zeli.app/es/story/49209971 · markdown: https://zeli.app/es/story/49209971.md
