This and this agree that there will be near 100% false positive rate with Bloom's filter should number of elements in the set ($n$) be greater than the number of bits in the filter ($m$).
E.g. if $n=100$, $m=10$ with a single hashing function $k=1$, then we get a probability of false positives worth:
$$\begin{split} p &= \left(1-e^{kn/m}\right)^k\\ &= \left(1-e^{k100/10}\right)^1\\ &= 0.9999546000702375\\ \end{split}$$
I.e. almost every query will be a false positive.
I find this to be useless, as such small filters are meant to reduce set membership queries to a database with much larger number of elements that there are bits in the filter.
In this example ($n=100$, $m=10$), I can achieve a much lower false positives rate if I simply use the first $10$ bits of a cryptographically secure hash function. E.g.
for i in 0,1,...,99:
print(hash10bit(i))
where hash10bit(i)
returns the first $10$ bits of a cryptographically secure hash function, such as ChaCha20, when given $i$ as input. This implies a logarithmic growth in number of bits.
Question:
So, why would one use Bloom's filter, if simply using the few bits of a cryptographically hashing function does a much better job?
Or is it that I'm missing something fundamental? What is it?