This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
Fill a square grid at random, site by site, and ask when a path of neighboring filled sites first connects the top edge to the bottom. Simon Broadbent and John Hammersley posed the question in 1957, thinking of gas masks: how porous must a filter be before gas finds a way through? The answer is sharp. On a large grid, below a critical fraction every cluster stays finite, and above it one cluster spans the whole grid, however large the grid is. The same transition describes fluid seeping through rock, current through a disordered conductor, and an epidemic that does or does not reach everyone.
What you see
A 150 by 150 grid fills up in a random order, 8 sites per frame, until the fraction of filled sites reaches the target . Each cluster of filled sites connected through their four nearest neighbors (up, down, left, right) gets a color; the cluster that touches both the top and the bottom edge is drawn in gold. Empty sites are black.
Because the filling order is fixed for a run, the grid at any moment is a random sample at the current fill level, and watching it fill is a sweep through . On this grid the gold cluster first appears at about 58% filled: earlier than in some runs, later in others, since on a finite grid the transition is smeared over a few percent.
Theory
At the spanning cluster is a fractal: it has holes on every scale, and its mass grows with the grid size as
Below the number of clusters of sites falls off as up to a cutoff size that diverges at , with . These exponents are exact for every two-dimensional lattice; the threshold itself is not, and is known only numerically for site percolation on the square lattice.
Presets
Below critical (p = 0.40): only small, separate clusters; nothing connects top to bottom.
At critical (p = 0.593): a spanning cluster forms after about 27 seconds of filling, once 58% of the sites are filled. At the end it holds about half of all filled sites, a ragged network with large holes and dead ends.
Above critical (p = 0.70): the spanning cluster appears at the same point and then absorbs almost everything: at it holds 98% of the filled sites.
Parameters
Occupation p: the target fraction of filled sites, 0 to 1. Moving it while the grid is shown fills or empties sites in the same random order, so the gold cluster can be watched appearing and breaking up around .
Fill speed: sites added or removed per frame, 1 to 50.
Resolution: grid size; changing it starts a new grid.