public static void main(String[] args) { // test client (described below) int N = Integer.parseInt(args[0]); int T = Integer.parseInt(args[1]); PercolationStats test = new PercolationStats(N, T); StdOut.println("mean = " + test.mean()); StdOut.println("stddev = " + test.stddev()); StdOut.println("95% confidence interval = " + test.confidenceLo() + ", " + test.confidenceHi()); }
public static void main(String[] args) { int N = Integer.parseInt(args[0]); int T = Integer.parseInt(args[1]); PercolationStats ps = new PercolationStats(N, T); System.out.printf("mean = %.16f\n", ps.mean()); System.out.printf("stddev = %.16f\n", ps.stddev()); System.out.printf( "95%% confidence interval = %.16f %.16f\n", ps.confidenceLo(), ps.confidenceHi()); }
public static void main(String[] args) { int N, T; PercolationStats p; N = Integer.parseInt(args[0]); T = Integer.parseInt(args[1]); p = new PercolationStats(N, T); System.out.println("mean = " + p.mean()); System.out.println("stddev = " + p.stddev()); System.out.println("95% confidence interval = " + p.ci(-1) + ", " + p.ci(1)); }
/** Test Client */ public static void main(String[] args) { Integer N = new Integer(args[0]); Integer T = new Integer(args[1]); Out out = new Out(); PercolationStats stats = new PercolationStats(N, T); out.println("mean = " + stats.mean()); out.println("stddev = " + stats.stddev()); out.println("95% confidence interval = " + stats.confidenceLo() + ", " + stats.confidenceHi()); out.close(); }
public static void main(String[] args) { int N = Integer.parseInt(args[0]); int T = Integer.parseInt(args[1]); PercolationStats stats = new PercolationStats(N, T); System.out.println("mean = " + stats.mean()); System.out.println("stddev = " + stats.stddev()); System.out.println( "95% confidence interval = " + stats.confidenceLo() + ", " + stats.confidenceHi()); }
public static void main(String[] args) { System.out.println("Start! Array size " + args[0] + " Repeat count " + args[1]); final int arraySize = Integer.parseInt(args[0]); final int repeatCnt = Integer.parseInt(args[1]); PercolationStats percStat = new PercolationStats(arraySize, repeatCnt); System.out.println("mean = " + percStat.mean()); System.out.println("stddev = " + percStat.stddev()); System.out.println( "95% confidence interval = " + percStat.confidenceLo() + ", " + percStat.confidenceHi()); percStat = null; }
public static void main(String[] args) { int n = Integer.parseInt(args[0]); int t = Integer.parseInt(args[1]); Stopwatch sw = new Stopwatch(); PercolationStats ps = new PercolationStats(n, t); double secondsElapsed = sw.elapsedTime(); StdOut.println("Seconds elapsed = " + secondsElapsed); StdOut.println("mean = " + ps.mean()); StdOut.println("stddev = " + ps.stddev()); StdOut.println("95% confidence interval = " + ps.confidenceLo() + ", " + ps.confidenceHi()); }
public static void main(String[] args) // test client { if (args.length == 2) { try { PercolationStats ps = new PercolationStats(new Integer(args[0]), new Integer(args[1])); StdOut.println("mean =" + ps.mean()); StdOut.println("stddev =" + ps.stddev()); StdOut.println("95% confidence interval = " + ps.confidenceLo() + ", " + ps.confidenceHi()); } catch (java.lang.IllegalArgumentException e) { StdOut.println("grid size and number" + "of experiments must be > 0!"); } } else { StdOut.println("Enter grid size and number of experiments"); } }
public static void main(final String[] args) { if (args.length < 2) { StdOut.println("Two arguments"); } final int n = Integer.valueOf(args[0]); final int t = Integer.valueOf(args[1]); final PercolationStats stats = new PercolationStats(n, t); final double mean = stats.mean(); final double stddev = stats.stddev(); StdOut.println("mean = " + mean); StdOut.println("stddev = " + stddev); StdOut.println( "95% confidence interval = " + (mean - (1.96 * stddev / Math.sqrt(t))) + ", " + (mean + (1.96 * stddev / Math.sqrt(t)))); }
public static void main(String[] args) { // test client (described below) int T, N; N = Integer.parseInt(args[0]); T = Integer.parseInt(args[1]); int index = 0; int openCount = 0; if (N <= 0 || T <= 0) { throw new IllegalArgumentException("N & T should be > 0"); } PercolationStats stat_obj = new PercolationStats(N, T); System.out.print("mean = " + stat_obj.mean() + "\n"); System.out.print("stddev = " + stat_obj.stddev() + "\n"); System.out.print( "95% confidence interval = " + stat_obj.confidenceLo() + ", " + stat_obj.confidenceHi() + "\n"); }
public static void main(String[] args) { int N = Integer.parseInt(args[0]); int T = Integer.parseInt(args[1]); PercolationStats ps = new PercolationStats(N, T); System.out.println("Mean: " + Double.toString(ps.mean())); System.out.println("std: " + Double.toString(ps.stddev())); System.out.println("conflow: " + Double.toString(ps.confidenceLo())); System.out.println("confhi: " + Double.toString(ps.confidenceHi())); System.out.println("avg threshold: " + Double.toString(ps.mean() / N)); }
public static void main(String[] args) { if (args.length < 2) { return; } int N = Integer.parseInt(args[0]); int T = Integer.parseInt(args[1]); if (N <= 0 || T <= 0) { throw new IllegalArgumentException(); } PercolationStats percolationStats = new PercolationStats(N, T); double part = 1.96 * percolationStats.stddev() / Math.sqrt(T); System.out.println("mean\t\t\t\t= " + percolationStats.mean()); System.out.println("stddev\t\t\t\t= " + percolationStats.stddev()); System.out.println( "95% confidence interval\t\t= " + (percolationStats.mean() - part) + ", " + (percolationStats.mean() + part)); }
public static void main(String args[]) { PercolationStats ps = new PercolationStats(20, 42); System.out.println(ps.mean()); }