java.lang.Object
org.unifi.mecvirtualresourceallocation.evaluation.util.MathUtils

public final class MathUtils extends Object
Utility class for mathematical operations.
  • Method Details

    • sumOfBinomials

      public static int sumOfBinomials(int n, int k)
      Calculates the sum of binomial coefficients from 1 to k for a given n.
      Parameters:
      n - the number of elements
      k - the upper limit for binomial coefficients
      Returns:
      the sum of binomial coefficients from 1 to k for a given n
    • binomialCoefficient

      public static int binomialCoefficient(int n, int k)
      Calculates the binomial coefficient "n choose k".
      Parameters:
      n - the number of elements
      k - the number of selections
      Returns:
      the binomial coefficient "n choose k"