[ovs-dev] [PATCHv6 08/14] tests: Mention binomial coefficient in hash tests.

Joe Stringer joestringer at nicira.com
Fri Sep 26 09:28:12 UTC 2014


This just makes it a bit easier for someone coming in fresh to do some
searches and figure out what the description means.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
v6: First post.
---
 tests/test-hash.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test-hash.c b/tests/test-hash.c
index f410c16..92f0e2f 100644
--- a/tests/test-hash.c
+++ b/tests/test-hash.c
@@ -129,7 +129,9 @@ test_hash_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
      * Given a random distribution, the probability of at least one collision
      * in any set of 11 bits is approximately
      *
-     *                      1 - ((2**11 - 1)/2**11)**C(33,2)
+     *                      1 - (proportion of same_bits)
+     *                          **(binomial_coefficient(n_bits_in_data + 1, 2))
+     *                   == 1 - ((2**11 - 1)/2**11)**C(33,2)
      *                   == 1 - (2047/2048)**528
      *                   =~ 0.22
      *
-- 
1.7.10.4




More information about the dev mailing list