data-structures

Definition

Bloom Filter

The bloom filter is a probabilistic data structure for testing whether a set contains a certain element. It operates using hash functions.

It’s probabilistic because the bloom filter might cause false-positives with a certain probability.

Operations

Insertion

To insert an element into the bloom filter, the element must be hashed by every hash function of the bloom filter:

All values at the indices are set to .

Query

To test whether an element exists in the bloom filter, hash the element using all hash functions:

Then, element is contained iff: