Package org.tweetyproject.commons.util
Class MathTools
java.lang.Object
org.tweetyproject.commons.util.MathTools
This class contains some useful math tools.
- Author:
- Matthias Thimm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaverageAndVariance
(Collection<Double> values) Compute the average value and the variance of the given list of numbers.static Integer
This method computes "n choose k".static int
faculty
(int i) Computes the faculty of the given number.
-
Constructor Details
-
MathTools
public MathTools()Constructor
-
-
Method Details
-
binomial
-
faculty
public static int faculty(int i) Computes the faculty of the given number.- Parameters:
i
- an integer.- Returns:
- the value 1*...*i or 1 if i==0.
-
averageAndVariance
Compute the average value and the variance of the given list of numbers.- Parameters:
values
- some values- Returns:
- a pair of average value (first element) and variance (second element).
-