Fill a random grid where each site is independently open with probability p. At the critical threshold pc ≈ 0.5927 a spanning cluster connecting top to bottom first appears — this is a continuous (second-order) phase transition studied in statistical physics.
pc ≈ 0.5927 (2D square lattice, site percolation)
D = 91/48 ≈ 1.896 (fractal dimension at criticality)
τ = 187/91 ≈ 2.055 (cluster-size exponent: n(s) ~ s^{-τ})
ν = 4/3 (correlation-length exponent)
β = 5/36 (order-parameter exponent)
The critical exponents of 2D percolation were proven rigorously by Smirnov (Fields Medal 2010) using conformal invariance and SLE (Schramm–Loewner Evolution). The fractal cluster at pc has the same geometry on any 2D lattice — a property called universality.
Percolation theory studies how connected paths form through random media. In site percolation, each cell on a grid is independently declared 'open' with probability p. When p crosses a critical threshold pc, an infinite spanning cluster appears — a classic continuous phase transition.
For site percolation on a 2D square lattice pc ≈ 0.5927. Below this value all clusters are finite; above it a giant spanning cluster emerges with probability approaching 1 as grid size increases.
A spanning cluster is a connected component of open sites that bridges the grid from the top row to the bottom row. Its first appearance at pc marks the percolation phase transition, analogous to liquid freezing or a magnet forming.
Union-Find groups sites into connected components. Each new open site is unioned with its open neighbours. With path compression and union by rank, each operation runs in nearly O(1) amortised time — making it far faster than flood-fill for large grids.
Exactly at p = pc the spanning cluster is a fractal with Hausdorff dimension D = 91/48 ≈ 1.896 in 2D. This means if you measure the cluster's "mass" (number of sites) inside a circle of radius r, it scales as r^D rather than r^2.
In site percolation each vertex is independently open with probability p. In bond percolation each edge (link between neighbours) is open with probability p. Both have phase transitions, but at different thresholds: for bond percolation on a square lattice pc = 0.5 exactly, due to a self-duality symmetry.
At the critical point correlations extend to all length scales, producing scale-free behaviour. The probability that a site belongs to a cluster of size s follows n(s) ~ s^(-τ) with τ = 187/91 ≈ 2.055 in 2D. On a log-log histogram this appears as a straight line — visible in this simulation at p ≈ 0.593.
Percolation models fluid flow through porous rock, electrical conductivity in composite materials, forest-fire spread, epidemic spreading on contact networks, and quantum tunnelling in disordered media. The phase transition maps to a critical point in each system.
On a finite L×L grid the transition is smeared over a width ~L^(-1/ν) around pc, where ν = 4/3. Larger grids produce sharper transitions. This is why small simulations show apparent thresholds scattered around the true pc, and why the histogram power law is only clean on large grids.
Universality means critical exponents (D, τ, ν, β) depend only on the spatial dimension, not microscopic lattice details. All 2D percolation models — square, triangular, honeycomb, site or bond — share the same exponents, forming one universality class. This was proven rigorously by Smirnov using Schramm-Loewner Evolution.