Class MathUtil

java.lang.Object
org.oristool.math.expression.MathUtil

public final class MathUtil extends Object
Mathematical calculations.
  • Constructor Details

    • MathUtil

      public MathUtil()
  • Method Details

    • calculateBinomialCoefficient

      public static BigInteger calculateBinomialCoefficient(Integer n, Integer k)
      Computes the binomial coefficient "n choose k".
      Parameters:
      n - set size
      k - elements to choose
      Returns:
      number of ways to choose k elements, disregarding their order
    • calculateFactorial

      public static BigInteger calculateFactorial(int n)
      Computes the factorial n!.
      Parameters:
      n - set size
      Returns:
      distinct ordered permutations of n objects