public class GaussianCDF2 { public static void main (String[] argv) { Function F = makeGaussianCDF (); // INSERT YOUR CODE HERE } static Function makeGaussianCDF () { double a = -2, b = 2; int M = 50; // Number of intervals. double delta = (b-a) / M; // Interval size. double[] intervalCounts = new double [M]; double numTrials = 1000000; for (int t=0; t b) { y = b; } // Find the right interval: int k = (int) Math.floor ((y-a) / delta); // Increment the count for every interval above and including k. if (k < 0) { System.out.println ("k=" + k + " y=" + y + " (y-a)=" + (y-a)); } for (int i=k; i