25package umontreal.ssj.randvar;
27import umontreal.ssj.probdist.*;
28import umontreal.ssj.rng.*;
48 protected double p = -1.0;
95 if (p < 0.0 || p > 1.0)
96 throw new IllegalArgumentException(
"p not in range [0, 1]");
98 throw new IllegalArgumentException(
"n <= 0");
Extends the class DiscreteDistributionInt for the binomial distribution slaw00a (page 321) with para...
static int inverseF(int n, double p, double u)
Computes , the inverse of the binomial distribution.
BinomialGen(RandomStream s, BinomialDist dist)
Creates a random variate generator for the binomial distribution dist and the random stream s.
double getP()
Returns the parameter of this object.
BinomialGen(RandomStream s, int n, double p)
Creates a binomial random variate generator with parameters and , using stream s.
static int nextInt(RandomStream s, int n, double p)
Generates a new integer from the binomial distribution with parameters  n and  p,...
int getN()
Returns the parameter of this object.
void setParams(int n, double p)
Sets the parameter and of this object.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...
double nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval , using this stream,...