Design Bloom filter, compute false positive rate for k hashes, m bits
Analyze the design bloom filter, compute false positive rate for k hashes, m bits.
Examples
Input:"test_input_1"
Output:"output_1"
Input:"test_input_2"
Output:"output_2"
Hints
Recall that a Bloom filter uses k independent hash functions to map each element to m bit positions in a bit array. How does the probability of a single hash function setting a bit to 1 relate to the false positive rate?
The false positive rate is determined by the probability that all k bit positions for a non-inserted element are already set to 1. Derive this probability using the expected fraction of bits set to 1 after inserting n elements.
Express the false positive rate in terms of m, n, and k. Then, optimize k to minimize this rate for given m and n by differentiating the false positive rate formula with respect to k.
Design Bloom filter, compute false positive rate for k hashes, m bits
Analyze the design bloom filter, compute false positive rate for k hashes, m bits.