Article URL: https://blog.omgmog.net/post/most-popular-numbers-in-hn-post-titles/ Comments URL: https://news.ycombinator.com/item?id=48919967 Points: 12 # Comments: 7

Two consecutive titles on the HN front page yesterday had a 6 in them. This means nothing. But it’s the sort of nothing that lodges in your brain until you do something about it, so what is the most popular number in Hacker News titles? ClickHouse hosts the full HN dataset in their public playground, and I am exactly the kind of person who finds that exciting. The obvious query is barely a query at all: That’s the Vsauce jingle. This post is about to become ‘but why is 19 like that’. A table where small digits beat large ones looks, for one exciting second, like Benford’s Law: the observation that in a lot of naturally occurring datasets, the leading digit is far more likely to be 1 than 9. It shows up in river lengths, stock prices, physical constants, election results, and it’s genuinely spooky the first time you see it. It does not show up here. Benford’s Law is about the leading digit of numbers that span several orders of magnitude (populations, incomes, file sizes), not single digits extracted from headline prose. The real explanation is duller than a law of the universe. Except sixth place is 0, with 60,931 appearances. Sixty thousand titles do not contain a bare zero. What they contain is “2.0” and “1.0”, which \d+ happily splits into their component digits. The same regex pulls the 3 out of “S3”, chops “1,000 users” into a 1 and a meaningless 000, and generally treats every digit sequence as its own number regardless of context. 2’s 119k lead is mostly the ghost of Web 2.0 and a decade of version numbers with decimal points. The numbers are accurate, they’re just answering a slightly wrong question. So I tried a smarter pattern, one that captures comma-grouped numbers whole, treats decimals as single tokens, respects word boundaries, and filters years, because “years are popular on a news site” would not surprise anyone. The doubled backslashes below are because ClickHouse turns \b into a literal backspace character before the regex engine ever sees it, which produces an empty result set and takes longer than I’d like to admit to diagnose: Tokenising numbers is also more of a tar pit than it looks: “Python 3.11.2” still splits into “3.11” and “2”, and the year filter can’t tell 1984 the year from 1984 the novel. Good enough to move on from, at least. 2 loses nearly two thirds of its count and the title. 1 takes the crown. The phantom 0 is gone. The years were there all along. Without the filter, 2018, 2017 and 2020 chart at 8th to 10th; the naive regex was just inflating the small digits enough to bury them.