code: protected static int computeRequiredNumberOfBits(double approximateNumberOfElements, double acceptableFalsePositiveRate) {
  
      double numberOfBits = Math.abs((approximateNumberOfElements * Math.log(acceptableFalsePositiveRate))
        / Math.pow(Math.log(2.0d), 2.0d));
  
      return Double.valueOf(Math.ceil(numberOfBits)).intValue();
    }
docs: Computes the required number of bits needed by the Bloom Filter as a factor of the approximate number of elements
  to be added to the filter along with the desired, acceptable false positive rate (probability).
  
  m = n * (log p) / (log 2) ^ 2
  
  m is the required number of bits needed for the Bloom Filter.
  n is the approximate number of elements to be added to the bloom filter
  p is the acceptable false positive rate between 0.0 and 1.0 exclusive
  
  @param approximateNumberOfElements integer value indicating the approximate, estimated number of elements
  the user expects will be added to the Bloom Filter.
  @param acceptableFalsePositiveRate a floating point value indicating the acceptable percentage of false positives
  returned by the Bloom Filter.
  @return the required number of bits needed by the Bloom Filter.