Bloom filters

hip-hop, educational

Listen on 93

Lyrics

[Verse 1]
False positive probability, that's the tradeoff we embrace
Memory compact, space efficient, never wastes a single place
Hash functions multiply, spreading elements through the grid
Membership queries lightning fast, but deletions are forbid

[Chorus]
Bloom filter never lies when it says "definitely not"
But when it whispers "maybe yes" - verification's what you've got
Probabilistic data structure, memory thrifty, queries hot
Hash it once, hash it twice, hash it thrice into the slot

[Verse 2]
Bit array foundation, zeros filling every cell
Hash functions independent, mapping stories they will tell
Insert an element, flip the bits from dark to bright
Query checks those same positions, all must glow to signal "might"

[Chorus]
Bloom filter never lies when it says "definitely not"
But when it whispers "maybe yes" - verification's what you've got
Probabilistic data structure, memory thrifty, queries hot
Hash it once, hash it twice, hash it thrice into the slot

[Bridge]
Size matters for precision, more bits means fewer mistakes
Formula calculates the sweet spot that your application takes
Web crawlers, cache systems, distributed databases too
When approximate membership is exactly what you need to do

[Verse 3]
Counting Bloom adds integers where standard version holds just one
Decrement enables deletion, but the memory cost has begun
Cuckoo filters alternative, relocating when they're full
Each technique serves different needs, understanding is the pull

[Chorus]
Bloom filter never lies when it says "definitely not"
But when it whispers "maybe yes" - verification's what you've got
Probabilistic data structure, memory thrifty, queries hot
Hash it once, hash it twice, hash it thrice into the slot

[Outro]
Mathematical elegance in bits and hash collisions
Approximate but guaranteed for negative decisions
When perfect accuracy costs too much space to store
Bloom filters trade precision for efficiency and more

← Consistent hashing | Strassen's matrix multiplication →