/* A Monte Carlo method to compute the value of the mathematical constant pi. Simulate by "throwing darts" at quarter circle of radius 1.0. Invoke the program as follows java ComputePi 100 where 100 is the number of trials. */ import java.util.Random; public final class ComputePi2 { private static final Random RNG = new Random (Long.getLong ("seed", System.nanoTime())); public static void main (final String[] args) { final int trials = Integer.parseInt (args[0]); // number of trials int count=0; for (int t=0; t