News for hackers. Stuff that matters.

maxpagels

Re:What are Bloom filters, and why are they useful? on Thursday February 25, 2016 @11:25AM (#11175456)
Ideally, you'd initialise the filter with all the elements at startup. Obviously, the complexity for this is dependent on the number of elements to be added + a constant overhead for the number of hash functions k. So, for n elements, it would be O(kn) or O(n).

Adding elements degrades the filter and and deciding when to stop adding elements is purely down to what worse-case false positive probability you are willing to accept. The equation for this can be readily found online, but put simply, the probability p is a function not only of the number of bits in the filter's array, but also the number of elements already added to the set.