The percolation threshold of my function creating a path from bottom to top is 0.1 too high
My goal is to compute an approximate value of the percolation threshold of a path from top to bottom in a matrix containing black and white cells. To do this, I randomly blacken cells and, after each step, I detect if there is a path made of black cells going from any top cell (first row) to any cell at the bottom (last row) of the matrix (without diagonal jumps). If so, the percolation will be reached. The percolation threshold is the proportion of black cells that it is probabilistically necessary to blacken to reach the percolation. This threshold is the same for any matrix that is not too small.