Abelian sandpile four grains and it topples
Each cell of an n×n grid holds grains. A cell with 4 or more topples: it gives one grain to each of its four neighbours, and grains pushed off the edge are lost. Bak, Tang and Wiesenfeld (1987) used this toy for self-organised criticality; Dhar (1990) noticed the end result never depends on the order of topplings, so stable piles can be added — and the recurrent ones form a finite abelian group with as many elements as the grid has spanning trees.
Colour = height: 0 1 2 3. Click the grid to drop a grain.
grid
heights of the driven pile — centre window, vs the exact infinite-lattice law
bigger than a browser tab wants to compute

