public final class RandomVariates extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
nextBinomial(int n,
double p)
Generates a pseudorandom integer from a binomial distribution.
|
static int |
nextBinomial(int n,
double p,
Random r)
Generates a pseudorandom integer from a binomial distribution.
|
static int |
nextBinomial(int n,
double p,
SplittableRandom r)
Generates a pseudorandom integer from a binomial distribution.
|
static double |
nextCauchy(double scale)
Generates a pseudorandom number from a Cauchy distribution with median 0
and chosen scale parameter.
|
static double |
nextCauchy(double median,
double scale)
Generates a pseudorandom number from a Cauchy distribution.
|
static double |
nextCauchy(double median,
double scale,
Random r)
Generates a pseudorandom number from a Cauchy distribution.
|
static double |
nextCauchy(double median,
double scale,
SplittableRandom r)
Generates a pseudorandom number from a Cauchy distribution.
|
static double |
nextCauchy(double scale,
Random r)
Generates a pseudorandom number from a Cauchy distribution with median 0
and chosen scale parameter.
|
static double |
nextCauchy(double scale,
SplittableRandom r)
Generates a pseudorandom number from a Cauchy distribution with median 0
and chosen scale parameter.
|
public static int nextBinomial(int n,
double p)
ThreadLocalRandom
class, and thus this method is both safe and efficient for use with threads.n - Number of trials for the binomial distribution.p - The probability of a successful trial.public static int nextBinomial(int n,
double p,
Random r)
n - Number of trials for the binomial distribution.p - The probability of a successful trial.r - The source of randomness.public static int nextBinomial(int n,
double p,
SplittableRandom r)
n - Number of trials for the binomial distribution.p - The probability of a successful trial.r - The source of randomness.public static double nextCauchy(double median,
double scale)
median - The median of the Cauchy.scale - The scale parameter of the Cauchy.public static double nextCauchy(double scale)
scale - The scale parameter of the Cauchy.public static double nextCauchy(double median,
double scale,
Random r)
median - The median of the Cauchy.scale - The scale parameter of the Cauchy.r - The source of randomness.public static double nextCauchy(double scale,
Random r)
scale - The scale parameter of the Cauchy.r - The source of randomness.public static double nextCauchy(double median,
double scale,
SplittableRandom r)
median - The median of the Cauchy.scale - The scale parameter of the Cauchy.r - The source of randomness.public static double nextCauchy(double scale,
SplittableRandom r)
scale - The scale parameter of the Cauchy.r - The source of randomness.Copyright © 2005-2020 Vincent A. Cicirello. All rights reserved.