Estimate the percolation threshold by Monte Carlo simulation.
Creates n-by-n grid and uses weighted quick union-find in keeping track of open and full sites and for detecting percolation.
Given grid size and number of trials, runs Monte Carlo simulation. Prints mean threshold, standard deviation, and 95% confidence interval.