aherbert commented on a change in pull request #140: Bloomfilter updates2
URL:
https://github.com/apache/commons-collections/pull/140#discussion_r391789974
##########
File path:
src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java
##########
@@ -312,32 +402,18 @@ public int getNumberOfItems() {
}
/**
- * Calculates the probability of false positives (AKA: {@code p} given
- * numberOfItems, numberofBits and numberOfHashFunctions. This is a method
so that
- * the calculation is consistent across all constructors.
+ * Calculates the probability of false positives ({@code p}) given
+ * numberOfItems ({@code n}), numberOfBits ({@code m}) and
numberOfHashFunctions ({@code k}).
+ * <pre>p = pow(1 - exp(-k / (m / n)), k)</pre>
+ *
+ * <p>This is the probability that a Bloom filter will return true for the
presence of an item
+ * when it does not contain the item.
*
* @return the probability of collision.
Review comment:
Is it the probability of false positives when the filter is at capacity
(contains n items)?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services