/** * Constructs a binomial distribution. Example: n=1, p=0.5. * * @param n * the number of trials (also known as <i>sample size</i>). * @param p * the probability of success. * @param randomGenerator * a uniform random number generator. * @throws IllegalArgumentException * if <tt>n*Math.min(p,1-p) <= 0.0</tt> */ public Binomial(int n, double p, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setNandP(n, p); }
/** * Constructs a binomial distribution. Example: n=1, p=0.5. * * @param n * the number of trials (also known as <i>sample size</i>). * @param p * the probability of success. * @param randomGenerator * a uniform random number generator. * @throws IllegalArgumentException * if <tt>n*Math.min(p,1-p) <= 0.0</tt> */ public Binomial(int n, double p, DoubleRandomEngine randomGenerator) { setRandomGenerator(randomGenerator); setNandP(n, p); }