Why it matters

Bloom filters save memory + I/O in caches, DBs. Fundamental probabilistic structure.

Advertisement

The architecture

m-bit array.

k hash functions.

Insert: set k bits.

Query: all k bits set = maybe.

Bloom filterBit arraym bitsk hashesset bitsQueryall set = maybe presentFalse positive rate ~ (1 - e^(-kn/m))^k; tune m, k for target FPR
Bloom filter.
Advertisement

How it works end to end

False positive rate p = (1 - e^(-kn/m))^k.

Optimal k = (m/n) ln 2.

No deletion in basic variant.

Counting Bloom supports deletion.