Is there a sharp threshold at which random sites suddenly connect across a whole lattice?
▶ Launch the interactive simulationOccupy each site of a square lattice independently with probability p; find connected clusters with union-find. Sweep p and, over many random lattices at each value, measure the spanning probability Π(p) (a cluster reaching top↔bottom) and the largest-cluster fraction (the order parameter); locate p_c at the Π = ½ crossing.
a connectivity phase transition at the known site-percolation threshold p_c ≈ 0.5927 for the square lattice — below it only finite islands, above it a lattice-spanning 'infinite' cluster