public class Factorials
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static double |
factorial(int n) |
Calculates the factorial.
|
static double |
gammaln(double x) |
Calculates the logarithm of the Gamma function using the Lanczos approximation.
|
static double |
logChoose(int n,
int k) |
Returns the logarithm of the binomial coefficient (n, k)
In other notation: log (n choose k)
(n choose k) represents the number of ways of picking k unordered outcomes from n possibilities
|
static double |
logFactorial(int n) |
Returns log (n!) = log (n * (n-1) * ...
|
static double |
poisson(double nu,
int n) |
Returns the Poisson distribution (nu^n e^(-nu) / n!)
|
public static double gammaln(double x)
x - doublepublic static double factorial(int n)
n - intpublic static double logFactorial(int n)
n - public static double poisson(double nu,
int n)
nu - n - public static double logChoose(int n,
int k)
n - k -