public class BinomialRng extends java.lang.Object implements RandomNumberGenerator
dbinom, pbinom, qbinom, rbinom.| Constructor and Description |
|---|
BinomialRng(int n,
double p)
Construct a random number generator to sample from the binomial distribution.
|
| Modifier and Type | Method and Description |
|---|---|
double |
nextDouble()
Get the next random
double. |
void |
seed(long... seeds)
Seed the random number generator to produce repeatable sequences.
|
public BinomialRng(int n,
double p)
n - the number of trials, a natural numberp - the success probability in each trial, [0, 1]public void seed(long... seeds)
RandomNumberGeneratorseed in interface RandomNumberGeneratorseeds - the seedspublic double nextDouble()
RandomNumberGeneratordouble.nextDouble in interface RandomNumberGenerator