Bloom Filters are a probabilistic data structure used for efficient set membership tests. They were introduced by Burton Howard Bloom in 1970. A Bloom Filter is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set or not. It uses a bit array and a set of hash functions to store and check for the presence of an element in a set.
The process of adding an element to a Bloom Filter involves passing the element through a set of hash functions which returns a set of indices in the bit array. These indices are then set to 1 in the bit array.
To check whether an element is present in the set or not, the same hash functions are applied to the element and the resulting indices are checked in the bit array. If all the bits at the indices are set to 1, then the element is considered to be present in the set. However, if any of the bits are not set, the element is considered to be absent from the set.
Since Bloom Filters use hash functions to index the bit array, there is a possibility of false positives, i.e., the filter may incorrectly indicate that an element is present in the set when it is not. However, the probability of a false positive can be controlled by adjusting the size of the bit array and the number of hash functions used. The false negative rate, i.e., the probability of a Bloom filter failing to identify an element that is actually present in the set, is zero.
Bloom Filters are widely used in various fields such as networking, databases, and web caching to perform efficient set membership tests.