Cluster size distribution for Bernoulli bond percolation on a square lattice
Channel: Nils Berglund
Date: 20/08/2022

This new percolation video shows the distribution of cluster sizes for Bernoulli bond percolation on a square lattice. This lattice was previously featured in the video https://youtu.be/agSrT-FFyOg with a different color code. Here closed bonds are shown in dark blue, while open clusters (which are sets of connected open bonds) are shown in various shades of gray or yellow, depending on their size. The plot shows a histogram of cluster sizes: the x-axis shows cluster sizes on an adaptive scale, with 30 bins of equal range. The y-axis shows the number of clusters having a size in the corresponding bin, on a logarithmic scale, which also adapts to the cluster distribution.
Percolation models describe the ability of a liquid to flow through a porous medium, such as oil flowing through certain types of rock, or water flowing through a coffee machine. One striking feature of these models is that when the probability p of a bond being open is smaller than a critical value pc, there are many clusters, and they are all quite small. When p exceeds pc, one giant cluster emerges, which gradually absorbs the smaller clusters. The picture looks most interesting when p is close to pc, and there are clusters of many different sizes. The value of pc is known to be equal to 0.5 for this particular lattice. 
The simulation has seven parts, featuring lattices of increasing size. 
60x31 grid: 0:00
120x62 grid: 0:34
240x124 grid: 1:08
480x248 grid: 1:42
960x496 grid: 2:16
1920x992 grid: 2:50
In each part of this simulation, all sites are given random values between 0 and 1. These values are independent, and follow a uniform distribution. The probability p of sites being open is increased smoothly from 0 to 1. A site becomes open when its value is smaller than the increasing parameter p. Then a variant of depth-first search algorithm is used to find all clusters.
The fact that for bond percolation on a square lattice, pc is equal to 0.5  can be intuitively understood by a duality argument: There exists an open cluster joining the left and right boundaries if, and only if, there is no open cluster on the dual lattice joining the upper and lower boundaries. The dual lattice is obtained by rotating every bond of the original lattice by 90 degrees. The critical probabilities for the original and dual lattice must add up to 1. By symmetry, at least for a perfectly square domain, the values of pc for both lattices must be equal, hence their common value is 0.5. For a more detailed explanation, see the video https://youtu.be/a-767WnbaCQ by the Spectral Collective. 

Render time: 14 minutes 51 seconds
Color scheme:  Cividis by Jamie R. Nuñez, Christopher R. Anderton, Ryan S. Renslow
https://doi.org/10.1371/journal.pone.0199239

Music: "Pluckandplay" by Kwon@Kwonbeats

Current version of the C code used to make these animations: 
https://github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html

Some outreach articles on mathematics:
https://images.math.cnrs.fr/_Berglund-Nils-1343_.html
(in French, some with a Spanish translation)