Skip to content

Commit

Permalink
tests: Mention binomial coefficient in hash tests.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
joestringer committed Sep 30, 2014
1 parent ec47af5 commit a2b59fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit a2b59fd

Please sign in to comment.