Skip to main content

Posts

Showing posts from April, 2024

HyperLogLog The Easy Way

Think of your recipe box, filled with cards for all your favorite dishes. You want to know how many different recipes you have, but counting them all can be tedious. HyperLogLog helps you get a close answer without the hassle. Here's the trick: Secret Code Machine: Imagine a machine that assigns a unique code to each recipe card, like a special fingerprint. This code doesn't reveal the recipe itself, but it guarantees each card has a different code. Counting Zeros: Now, for each code, you count the zeroes at the beginning, before the actual code starts. A code like "000123" has three leading zeroes, while "789456" has none. Zeroes Hint at Variety: The key thing is: the more unique recipes you have (more cards), the more likely you are to find a code with a lot of leading zeroes. It's like a bigger box - the more cards you add, the higher the chance of finding one with a long string of zeroes at the beginning. Smart Approximation: By checki