Hypergeometric Probability Calculator: When Good Statistics Go Bad

Hypergeo-what?

The "simple" answer is that hypergeometric distributions are a type of statistics problem. Unfortunately this answer doesn't mean much. The basic example of this problem is the urn problem. Essentially you're looking at a container filled with marbles, some white and some black, drawing some number out, and getting the odds of each combination of black vs. white marbles. Read more on my explanation page.

Update: Curious how the hypergeometric distribution is used in the real world? Check out a real-world use case from Matthew Healy.

Compute your own odds!

Put in any numbers you want for marbles, white marbles, and draws, and I'll show you the exact odds of all possible situations occurring. Note that for processing speed concerns (as well as inability to show data nicely), you can't put in very large numbers (max. of 1500 marbles, 1000 white, and 1000 draws). The math runs right in your browser now: it's a JavaScript port of my C++ code (see below for a link to the source), with the same exact big-number arithmetic.

Source code

Want to see my hypergeometric distribution probability calculator source? Great! Click the link, get the source, maybe even read the history of this project. The original versions are here too: Perl, Ruby (library, command line) and C++ (main.cpp, HGProbabilityCalc.cpp, .h, jestatistics.cpp, .h, compile.sh).