Sep 26Liked by Abhinav Upadhyay

If I'm reading your _hash function properly I think all of the returned hashes will be consecutive values wrapping around at self.size. The seed doesn't contribute to the generated hash value and as _hash is called with the same item value and consecutive seeds are used it will result in a continuous block of bits being set to 1.

Is that the intention? That doesn't make sense to me.

Expand full comment
Sep 16·edited Sep 17Liked by Abhinav Upadhyay

Hey Abhinav,

great post! I've an article about bloom filter on my private website. But I really liked your version with Python code.

Expand full comment

The math equation has an extraneous / at the end.

(\begin{equation} \text{False Positive Rate} \approx \left(1 - e^{-\left(\frac{kn}{m}\right)^k}\right) \end{equation} \)

I believe should be

(\begin{equation} \text{False Positive Rate} \approx \left(1 - e^{-\left(\frac{kn}{m}\right)^k}\right) \end{equation})

Expand full comment