Lesson 12 of 15
Percolation Theory
Percolation Theory
Percolation theory studies how connectivity emerges in random systems. It has applications in epidemic spreading, oil recovery, and network resilience.
Site Percolation on a 1D Chain
In site percolation, each site on a lattice is independently occupied with probability . A cluster is a maximal connected group of occupied sites.
In 1D, sites are connected only to their immediate left and right neighbors.
Percolation Threshold
The percolation threshold is the minimum at which an infinite cluster exists:
- 1D chain: — you must occupy all sites for the cluster to span the system
- 2D square lattice:
- 3D cubic lattice:
Key Quantities
Mean cluster size (average over all clusters):
Percolation probability (fraction of sites in the largest cluster):
Near the threshold: with in 1D.
Random Number Generator
We use a Linear Congruential Generator (LCG): with , , . A site is occupied if .
Implementation
def generate_1d_lattice(N, p, seed=42):
# LCG: a=1664525, c=1013904223, m=2**32
# Each step: state=(a*state+c)%m; occupied if state/m < p
...
def find_clusters_1d(lattice):
# Scan left to right, track contiguous runs of 1s
# Return list of cluster sizes
...
def mean_cluster_size(cluster_sizes):
# Return average cluster size
...
def percolation_probability(cluster_sizes, N):
# Return max(cluster_sizes) / N
...Python runtime loading...
Loading...
Click "Run" to execute your code.