HN Hall of Fame Weekly email

Algorithm No One Knows About (2016)

getkerf.wordpress.com Books & learning Tutorials & guides Computer science Class of 2022-03 Hall of Fame
Screenshot of getkerf.wordpress.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 4 calendar years, with breakout response in 2 of them.

submissions
5
submitters
4
observed span
2016–2022
peak thread · 190 comments
286 pts
latest 20+ return · 2019-09-13
286 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

A bunch of comments here are missing the main point: Unless you have an Exabyte of memory, you can't use any kind of data structure to remember which cards you've already picked among 2^64 of them. The goal here is an algorithm that generates the selected cards, one by one, in order, as if from a coroutine that only uses a tiny, constant amount of memory. So, no arrays, lists, sets, hash tables, bitmaps, etc., even if they're hidden in…

drfuchs·286-point thread·

> The first obstacle that makes the “dealing” (without replacement) hard is that the “draw” method doesn’t work. If you draw (with replacement) over and over again, ignoring cards you’ve already picked, you can simulate a deal, but you run into problems. The main one is that eventually you’re ignoring too many cards and the algorithm doesn’t finish on time (this is the coupon collector’s problem). I don't think this is true! First note that if you want to pick…

The article mentions the challenges of working with a deck of 2^64 cards, but I don't see how the algorithm helps - seems like it's going to encounter the limits of double-precision values well before that. For instance, the initial setup of "qu1real": qu1real = -nreal + 1.0 + Nreal will behave poorly if N > 2^52 or so. The cited paper refers to this in the Appendix, mentioning that "Roughly log10(N) + 1 digits of precision will suffice", so…

al2o3cr·2-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
409

reference only — not used in Hall rules or ranking

Total comments
265

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2016-04-04Vitter's reservoir sampling algorithm D: randomly selecting unique itemsFirst breakoutcolinprince11774
2018-05-13The Best Algorithm No One Knows Aboutonuralp21
2019-09-08The Best Algorithm No One Knows About (2016)ColinWright30
2019-09-13Algorithm No One Knows About (2016)Best thread · Latest 20+ point returnColinWright286190
2022-03-15The algo no one knows about (2016)Hall inductiongraderjs10