http://www.perlmonks.org?node_id=908274


in reply to Re^2: Fastest way to calculate hypergeometric distribution probabilities (i.e. BIG factorials)?
in thread Fastest way to calculate hypergeometric distribution probabilities (i.e. BIG factorials)?

You may need a less than or equal to in the condition of the for loop. This probably won't make a difference in most cases, as the final probability is usually very small.
my $hypercdf = 0; for (my $iref=$i; $iref <= min($N,$n); $iref++) { $hypercdf += hypergeom($n,$m,$N,$iref); } print $hypercdf;