### Question:
MathUtil { public static final double nextGaussionDouble() { double r = FastMath.abs(randomData.nextGaussian(U, Q)) / RANGE; return r; }  static final double nextDouble(); static final double nextGaussionDouble(); static final double nextGaussionDouble(double u, double q); static final int nextGaussionInt(int low, int high); static final int nextGaussionInt(int low, int high, double q); static final int nextGaussionInt2(int low, int high, double q); static final int nextFakeInt(int max); static final int[] nextPermuate(int n, int k); static final Object[] randomPick(Collection<T> collection,
			int count); static final List<T> randomPickShuffle(Collection<T> collection,
			int count); static final Collection<T> randomPickGaussion(
			Collection<T> collection, int count, double q); static final double solveCubicEquation(double a, double b, double c, double d);  }### Answer:
@Test public void testNextGuassionDouble() throws Exception { int max = 10000; final int range = 12; final int[] ratio = new int[range]; TestUtil.doPerform(new Runnable() { public void run() { double v = MathUtil.nextGaussionDouble(); int r = (int)(v * range); ratio[r%range]++; } }, "Normal Random", max); printRatio(ratio, max); }
@Test public void testNextGaussianDouble() throws Exception { int max = 100000; final RandomData commonRandom = new RandomDataImpl(); final double[] result = new double[2]; result[0] = Double.MAX_VALUE; result[1] = Double.MIN_NORMAL; TestUtil.doPerform(new Runnable() { public void run() { double r = MathUtil.nextGaussionDouble(); if ( result[0]>r ) { result[0] = r; } if ( result[1]<r ) { result[1] = r; } } }, "Uniform Random", max); System.out.println("Normal Distribution ["+result[0]+", "+result[1]+"]"); }
@Test public void testNextGaussianDoubleDistribution() throws Exception { int max = 100000; final int[] ratio1 = new int[10]; TestUtil.doPerform(new Runnable() { public void run() { int r = (int)(MathUtil.nextGaussionDouble() * 10); ratio1[r%ratio1.length]++; } }, "Uniform Random", max); printRatio(ratio1, max); }
@Test public void testNextGaussianDoubleDistribution2() throws Exception { int max = 100000; final int[] ratio1 = new int[10]; final double q = 2.0; TestUtil.doPerform(new Runnable() { public void run() { int r = (int)(MathUtil.nextGaussionDouble(0.0, q) * 10); ratio1[r%ratio1.length]++; } }, "U=0.0, Q="+q, max); printRatio(ratio1, max); }