/* A Monte Carlo method to deterimine if all the permutations computed by the method 'shuffle' from the class 'Shuffle' are likely likely. Invoke the programs as follows java Experiment 11 100 where 11 is the size of the permutations and 100 is the number of trials. */ import java.util.Arrays; public final class Experiment { public static void main (final String[] args) { final int n = Integer.parseInt (args[0]); // permutation size final int trials = Integer.parseInt (args[1]); // number of trials final int[] a = new int[n]; // array to permute final int index=0; // only one position is examined final int[] freq = new int[n]; // frequency of a value in the fixed position for (int t=0; t