FAILURE MAP
← Case archive

FA-72999 / Probabilistic sketches / Member archive

HyperLogLog cardinality estimate: linear counting uses non-empty registers · case 04

Small cardinalities are estimated from the wrong register population.

Member previewVariant 4 · 3 implementations · 10 checks per implementation

Case contract

Input {regs} with 16, 32, 64 or 128 registers. alpha is 0.673, 0.697, 0.709 for m = 16, 32, 64 and 0.7213/(1 + 1.079/m) otherwise. Raw E = alpha m^2 / sum 2^-r. If E <= 2.5m and V (zero registers) > 0, use linear counting m ln(m/V); otherwise if E > 2^32/30 apply the large-range correction -2^32 ln(1 - E/2^32). Return [round(E), V].

Why this case matters

Distinct-count dashboards and query planners rely on the bias corrections of the HyperLogLog estimator at both small and large cardinalities.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
sparse m=16[16, 10][8, 10]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗