data-structures algorithms probability
Definition
Bloom Filter
A Bloom filter is a space-efficient, probabilistic data structure used to test whether an element is a member of a set. It is designed to be incredibly fast and use minimal memory, at the cost of providing false positive results.
- False Positives: The filter may report that an element is in the set when it is not.
- False Negatives: The filter never reports that an element is not in the set if it has been inserted (i.e., it is 100% accurate for negative results).
Mechanism
A Bloom filter consists of a bit array of
Insertion
To insert an element
Query
To query for an element
Mathematical Properties
False Positive Probability
The probability of a false positive
For a given
Complexity
| Operation | Time Complexity |
|---|---|
| Insertion | |
| Query |
Space complexity is