コード例 #1
0
  public static double probabilty(
      int backgroundChipSize, int countOnBackground, int filterSetSize, int countFiltered) {

    // create the distribution
    HypergeometricDistribution dist =
        factory.createHypergeometricDistribution(
            backgroundChipSize, countOnBackground, filterSetSize);

    // return the probability
    return dist.probability(countFiltered);
  }
コード例 #2
0
public class DistributionCalculator {

  private static DistributionFactory factory = DistributionFactory.newInstance();

  public static double probabilty(
      int backgroundChipSize, int countOnBackground, int filterSetSize, int countFiltered) {

    // create the distribution
    HypergeometricDistribution dist =
        factory.createHypergeometricDistribution(
            backgroundChipSize, countOnBackground, filterSetSize);

    // return the probability
    return dist.probability(countFiltered);
  }
}