Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> There is some p probability that a given filter with less than 24 set bits has 4 elements (since some of their bits overlapped).

> there is a non-zero probability that some filters have > 4, or even higher.

Overlapped bits don't contribute to false positive rate. As a unlikely-but-simple example, consider a filter with 3 items, marking 15 distinct indexes, and a new 'fourth' item whose 5 indexes all align with one of the existing 15 indexes. Adding this new item does not change the filter at all, and so cannot change the false positive rate.

In general the false positive rate (assuming our hash function is good, ie H(X) is independently uniformly random for each X) is the chance that a uniformly random hash passes the filter. For a N bit filter with P bits marked, and K bits per element, that's (P/N)^K (select K random indexes, and check if they're all marked, which they will be with probability P out of N each). Since N and K are fixed, the FPR only depends on the popcount P. A straightforward bloom filter can't depend on the number of items inserted (seperately from the number of marked bits), because that information isn't even present.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: