FUNCTION
CDF
Evaluates the hypergeometric cumulative density function.
Interface
#include <codecogs/statistics/distributions/discrete/hypergeometric/cdf.h>
using namespace Statistics::Distributions::Discrete::Hypergeometric;
This function evaluates the hypergeometric cumulative density function.
\graph x=1:8:8 a=17 b=9 n=8
Example 1
#include <iostream>
#include <codecogs/statistics/distributions/discrete/hypergeometric/cdf.h>
int main()
{
std::cout << "hypergeometric CDF (6, 17, 9, 8) = ";
std::cout << Statistics::Distributions::Discrete::Hypergeometric::CDF(6, 17, 9, 8) << std::endl;
return 0;
}Output:
hypergeometric CDF (6, 17, 9, 8) = 0.872403Parameters
x
the maximum number of type-A items drawn (upper limit of the cumulative sum), 0 <= x <= n
a
the number of type-A items in the population
b
the number of type-B items in the population
n
the sample size (number of items drawn from the population, without replacement)
Returns
the cumulative probability P(X <= x) that at most x of the n items drawn are type-A
Interactive Calculator
x
a
b
n
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.