title: Bloom filter probability for 16 bit integers
body: <p>I hava a list of 16 bit unsigned integers.</p>
  <p>The only thing I want to know if a number is in the list.</p>
  <p>I could use a bit vector for this. I just set bit[i] if i is in the list. To know if a number y is in the list i would look up bit[y]. This would be always give correct answer.</p>
  <p>But I would like to save memory. And use less bits but allow false positives. I.e a number would be allow to return that it is in the list even though it is not. But no false negatives.</p>
  <p>From my understanding bloom filter would achieve that.
  What I do not understand is that when I use a bloom filter calculator the probability by setting for example:</p>
  <ul>
  <li>400 entries (n)</li>
  <li>400 bits (m)</li>
  <li>1 hash function (k)</li>
  </ul>
  <p>The probability for false positives is not zero. For example at <a href="https://hur.st/bloomfilter/" rel="nofollow noreferrer">https://hur.st/bloomfilter/</a></p>
  <p>If I for example  on average have 400 different 16 bit numbers and want to use as little space as possible would a bloom filter be a good idea?</p>
  <p>How should one think about the probabilty?
  Clearly a bit vector gives perfect result with 16k bits. How much less space can I use with bloom filter and at which cost in in increased falsed positives.</p>
  <p>Is there something better that could solve my problem.</p>