Evaluates the inverse of the hypergeometric cumulative density function.

You're viewing an older version of this page (#5446). View the current version.

View versions (2)

Interface

#include <codecogs/statistics/distributions/discrete/hypergeometric/cdf_inv.h>

using namespace Statistics::Distributions::Discrete::Hypergeometric;

This function evaluates the inverse of the hypergeometric cumulative density function.

\graph p=0:1:20 a=2 b=3 n=2:5:2

Example 1

#include <iostream>
#include <codecogs/statistics/distributions/discrete/hypergeometric/cdf_inv.h>

int main()
{
  std::cout << "hypergeometric CDF inverse (0.9, 2, 3, 2) = ";
  std::cout << Statistics::Distributions::Discrete::Hypergeometric::CDF_inv(0.9, 2, 3, 2) << std::endl;
  return 0;
}

Output:

hypergeometric CDF inverse (0.9, 2, 3, 2) = 1

Parameters

p
the target cumulative probability, 0 <= p <= 1
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 smallest x such that P(X <= x) >= p, where X follows the hypergeometric distribution
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

p
a
b
n
Result