/** * Generates a random value from the {@link org.apache.commons.math3.distribution.HypergeometricDistribution Hypergeometric Distribution}. * This implementation uses {@link #nextInversionDeviate(IntegerDistribution) inversion} * to generate random values. * * @param populationSize the population size of the Hypergeometric distribution * @param numberOfSuccesses number of successes in the population of the Hypergeometric distribution * @param sampleSize the sample size of the Hypergeometric distribution * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution * @throws NumberIsTooLargeException if {@code numberOfSuccesses > populationSize}, * or {@code sampleSize > populationSize}. * @throws NotStrictlyPositiveException if {@code populationSize <= 0}. * @throws NotPositiveException if {@code numberOfSuccesses < 0}. * @since 2.2 */ public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException { return delegate.nextHypergeometric(populationSize, numberOfSuccesses, sampleSize); }
/** * Generates a random value from the {@link org.apache.commons.math3.distribution.HypergeometricDistribution Hypergeometric Distribution}. * This implementation uses {@link #nextInversionDeviate(IntegerDistribution) inversion} * to generate random values. * * @param populationSize the population size of the Hypergeometric distribution * @param numberOfSuccesses number of successes in the population of the Hypergeometric distribution * @param sampleSize the sample size of the Hypergeometric distribution * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution * @throws NumberIsTooLargeException if {@code numberOfSuccesses > populationSize}, * or {@code sampleSize > populationSize}. * @throws NotStrictlyPositiveException if {@code populationSize <= 0}. * @throws NotPositiveException if {@code numberOfSuccesses < 0}. * @since 2.2 */ public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException { return delegate.nextHypergeometric(populationSize, numberOfSuccesses, sampleSize); }
/** * Generates a random value from the {@link org.apache.commons.math3.distribution.HypergeometricDistribution Hypergeometric Distribution}. * This implementation uses {@link #nextInversionDeviate(IntegerDistribution) inversion} * to generate random values. * * @param populationSize the population size of the Hypergeometric distribution * @param numberOfSuccesses number of successes in the population of the Hypergeometric distribution * @param sampleSize the sample size of the Hypergeometric distribution * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution * @throws NumberIsTooLargeException if {@code numberOfSuccesses > populationSize}, * or {@code sampleSize > populationSize}. * @throws NotStrictlyPositiveException if {@code populationSize <= 0}. * @throws NotPositiveException if {@code numberOfSuccesses < 0}. * @since 2.2 */ public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException { return delegate.nextHypergeometric(populationSize, numberOfSuccesses, sampleSize); }