Abelian Sandpile — Avalanche Criticality

Drop grains of sand one at a time on a grid. When any site reaches 4 grains it topples, distributing one grain to each neighbor. This simple rule generates self-organized criticality: avalanche sizes follow a power law P(s) ~ s⁻τ with τ ≈ 1.2, and fractal boundary patterns emerge.

Grid: 50×50
Total grains: 0
Avalanches: 0
Last size:
Max size: 0
Mean size:
if z[x,y] ≥ 4:
z[x,y] -= 4
z[neighbors] += 1

P(s) ~ s^{-τ}, τ ≈ 1.2
Colors: black=0, dark=1, mid=2, bright=3 grains
Abelian: order of topplings doesn't matter — same final state regardless.
The recurrent states form a group under addition. Self-organized criticality discovered by Bak, Tang & Wiesenfeld (1987).