The simples case of percolation on a square latice with size N² starting from the center and checking if "liquid" arives on any border. For more information on Percolation Theory.
As a second part of this code, I added a Neural Network (NN) and a Convolutional Neural Network (CNN) to see if it can learn through supervised learning if a given matrix percolates or not. It is shown that for small N the NN and CNN learns for cases that are far away from the critical point(p_c), but the accuracy drops at p_c. That is a way to measure p_c.
[ ] Use an unsupervised learning method