public class MathTools
extends java.lang.Object
Constructor and Description |
---|
MathTools() |
Modifier and Type | Method and Description |
---|---|
static Pair<java.lang.Double,java.lang.Double> |
averageAndVariance(java.util.Collection<java.lang.Double> values)
Compute the average value and the variance of the given list of
numbers.
|
static java.lang.Integer |
binomial(java.lang.Integer n,
java.lang.Integer k)
This method computes "n choose k".
|
static int |
faculty(int i)
Computes the faculty of the given number.
|
public static java.lang.Integer binomial(java.lang.Integer n, java.lang.Integer k)
n
- an integer.k
- an integerpublic static int faculty(int i)
i
- an integer.public static Pair<java.lang.Double,java.lang.Double> averageAndVariance(java.util.Collection<java.lang.Double> values)
values
- some values