Java examples for Algorithm:Statistics
Standard Gaussian
public class StdGaussian { public static void main(String args[]) { double u = Math.random(); double v = Math.random(); double z = 0; z = (Math.sin(Math.PI * 2 * v)) * (Math.sqrt(-2 * Math.log(u))); System.out.println(z);/*from w w w .j a v a2s . c o m*/ } }