Hyperloglog, Probability, Hash Function, Cardinality Estimation, Dynamic Programming.
using remaining 22 bits q = h & ((1<<v)-1) # Remainder is first p=10 bits r = h >> v # Number of trailing zeros of quotient q j = get_trailing_zeros(q, v) self.buckets[r] = max(self.buckets[r], j+1) def get_size(self): u = 1 << self.N v = [2**x for x in self.buckets] n = self.alpha*self.m*hmean(v)