/******************************************************************************
  *  Compilation: javac-alg4 PercolationStats.java
  *  Execution: java PercolationStats
  * 
  *  Percolation Monte Carlo experiment
  *  Author: Ketong Wang
  */

public class PercolationStats {
    // Some private names to hold data
    private double[] thresholds;
    
    /**
     * Initializes the percolation
     */
    public PercolationStats (int N, int T) { //N dimension, T repeating times
        thresholds = double[]
    }
    
    /**
     * Sample mean of percolation threshold
     */
    public double mean() {}
    
    /**
     * Sample standard deviation of percolation threshold
     */
    public double stddev() {}
    
    /**
     * returns lower bound of the 95% confidence interval
     */
    public double confidenceLo() {}
    
    /**
     * returns upper bound of the 95% confidence interval
     */
    public double confidenceHi() {}
    
    /**
     * test client, described below
     */
    public static void main(String[] args) {}
    
    
    
    
}
@@ -496,24 +496,28 @@
 sholds =
+ new
  double%5B
 %5D%0A    %7D%0A
@@ -508,17 +508,388 @@
  double%5B
-%5D
+T%5D;%0A        for (int i = 0; i %3C T; i++) %7B // run T experiments%0A            Percolation percolationItem = new Percolation(N);%0A            StdOut.println(percolationItem.percolates());%0A            while (!percolationItem.percolates()) %7B%0A                int row = new StdRand.uniform(1, N + 1);%0A                int col = new StdRand.uniform(1, N + 1);%0A            %7D%0A        %7D
 %0A    %7D%0A 
@@ -944,32 +944,34 @@
 reshold%0A     */%0A
+//
     public doubl
@@ -978,24 +978,24 @@
 e mean() %7B%7D%0A
-
     %0A    /**
@@ -1053,32 +1053,34 @@
 reshold%0A     */%0A
+//
     public doubl
@@ -1089,24 +1089,24 @@
 stddev() %7B%7D%0A
-
     %0A    /**
@@ -1164,32 +1164,34 @@
 nterval%0A     */%0A
+//
     public doubl
@@ -1206,24 +1206,24 @@
 enceLo() %7B%7D%0A
-
     %0A    /**
@@ -1281,32 +1281,34 @@
 nterval%0A     */%0A
+//
     public doubl
@@ -1323,24 +1323,24 @@
 enceHi() %7B%7D%0A
-
     %0A    /**
@@ -1376,32 +1376,32 @@
 d below%0A     */%0A
-
     public stati
@@ -1428,16 +1428,284 @@
  args) %7B
+%0A        StdOut.print(%22Enter the grid dimension N: %22);%0A        int N = StdIn.readInt();%0A        StdOut.print(%22Enter the repeating times of experiments T: %22);%0A        int T = StdIn.readInt();%0A        %0A        PercolationStats pStats = new PercolationStats(3, 100);%0A    
 %7D%0A    %0A 

Initialize new variable