@Test public void testBinomial() { long[][] binoms = MathUtil.getBinomials(5); assertEquals(binoms[5][2], 10L); }
public static long[][] getBinomials(int m) { long[][] binoms = new long[m+1][m+1]; for (int i = 0; i<=m; i++) { binoms[i][0] = 1; for (int j=1; j<=i; j++) { binoms[i][j] = binoms[i-1][j-1] + binoms[i-1][j]; } } return binoms; }
MathUtil { public static long[][] getBinomials(int m) { long[][] binoms = new long[m+1][m+1]; for (int i = 0; i<=m; i++) { binoms[i][0] = 1; for (int j=1; j<=i; j++) { binoms[i][j] = binoms[i-1][j-1] + binoms[i-1][j]; } } return binoms; } }
MathUtil { public static long[][] getBinomials(int m) { long[][] binoms = new long[m+1][m+1]; for (int i = 0; i<=m; i++) { binoms[i][0] = 1; for (int j=1; j<=i; j++) { binoms[i][j] = binoms[i-1][j-1] + binoms[i-1][j]; } } return binoms; }  }
MathUtil { public static long[][] getBinomials(int m) { long[][] binoms = new long[m+1][m+1]; for (int i = 0; i<=m; i++) { binoms[i][0] = 1; for (int j=1; j<=i; j++) { binoms[i][j] = binoms[i-1][j-1] + binoms[i-1][j]; } } return binoms; }  static long[][] getBinomials(int m); static int[][] getChebyCoefficients(int k); static double[] shiftPowerSum(
            double[] powerSums,
            double r,
            double xc
    ); static double[] powerSumsToZerodMoments(
            double[] powerSums,
            double min,
            double max
    ); static double[] powerSumsToChebyMoments(
            double min,
            double max,
            double[] powerSums
    ); static double arrayMean(double[] xs); static void calcPowers(double x, double[] powers); static double entropy(double[] ps); static double getMSE(double[] error); }
MathUtil { public static long[][] getBinomials(int m) { long[][] binoms = new long[m+1][m+1]; for (int i = 0; i<=m; i++) { binoms[i][0] = 1; for (int j=1; j<=i; j++) { binoms[i][j] = binoms[i-1][j-1] + binoms[i-1][j]; } } return binoms; }  static long[][] getBinomials(int m); static int[][] getChebyCoefficients(int k); static double[] shiftPowerSum(
            double[] powerSums,
            double r,
            double xc
    ); static double[] powerSumsToZerodMoments(
            double[] powerSums,
            double min,
            double max
    ); static double[] powerSumsToChebyMoments(
            double min,
            double max,
            double[] powerSums
    ); static double arrayMean(double[] xs); static void calcPowers(double x, double[] powers); static double entropy(double[] ps); static double getMSE(double[] error);  }