Fig. 1 in words
Two models + 1 000 real quakes · same data as code 05
1 One city, twice
- two maps of the same 40 × 40 city, before and after: start 0.50 · asks ½ 0.79
- Each resident asks only that ½ of its neighbours be like it
- 40 × 40 · 25% empty · seed 37
2 Asked vs got
- the share the city ends with, for asks from .1 to .7: every point above the dashed “asked” line and the “start 0.50” line
- 0.79 at .5
- x: share each resident asks for
- y: share the city ends with
3 Sandpile
- grains by topplings: 0: 17 037 · 1-9: 4 806 · 10-99: 4 054 · 100-999: 3 282 · 1 000+: 821
- largest: 5 902
- topplings per grain, last 30 000
- no typical size, nothing tuned
4 Real quakes
- count of quakes (1 to 1 000, log scale) against M 4.0 to 6.4: one dashed fit, b 1.08 from 4.5; dotted lines mark the cuts at 4.5 and 4.7 (b 1.22 from 4.7)
- quakes of magnitude ≥ M, Fiji
- 1 000 real events, log scale
01 More Is Different Emergence
- Anderson (1972): reducing to simple laws “does not imply the ability to start from those laws and reconstruct the universe”
- Emergent: a pattern of the whole that no single rule states
- I find these patterns only by running the rules
Simple parts; the pattern belongs to the whole.
02 Micromotives Schelling
- Schelling (1971): residents move only when too few neighbours are like them
- Asking for half, the city ends 0.79 alike; asking for 0.3, it ends 0.65
- On his small board he found the effect “slight” near a third, “striking” at a half
Claim tested: “a sorted map means people wanted it sorted.” It fails here.
03 Self-Organised Criticality
- Bak, Tang & Wiesenfeld (1987): a site holding 4 grains gives one to each neighbour
- Nothing is tuned, yet avalanches run from 1 to 5 902 topplings
- 57% of grains move nothing; 821 set off 1 000 or more
Sprint 38 asks whether such a spread earns the name “power law”.
04 Real Quakes Data
- Gutenberg & Richter (1944): log N = a − bM; b ≈ 1 means ten times fewer per magnitude
- 1 000 Fiji quakes: b = 1.08 ± 0.04 for M ≥ 4.5, the most common magnitude
- For M ≥ 4.7, the +0.2 Woessner & Wiemer (2005) advise: b = 1.22
Aki (1965), half-bin shift (Utsu 1966); ± = b ÷ √n.
05 Try It Yourself PYTHON 3.13.16 · NUMPY 2.5.3
sprint37_emergence_and_self_organisation.py
import numpy as np
def nb(g, i, j, c): # like and occupied neighbours
a = g[max(i-1, 0):i+2, max(j-1, 0):j+2]
s, o, k = (a == c).sum(), (a > 0).sum(), g[i, j]
return s - (k == c), o - (k > 0)
def alike(g): # mean share of like neighbours
r = [nb(g, *p, g[tuple(p)]) for p in np.argwhere(g)]
return np.mean([s / o for s, o in r if o])
def city(want, n=40, seed=37): # Schelling (1971)
rng = np.random.default_rng(seed)
g = rng.choice(3, (n, n), p=[.25, .375, .375])
s0 = alike(g)
for _ in range(100):
moved = 0
for i, j in rng.permutation(np.argwhere(g > 0)):
c = g[i, j]; s, o = nb(g, i, j, c)
if o == 0 or s >= want * o: continue
g[i, j] = 0; E = np.argwhere(g == 0)
d = ((E - [i, j])**2).sum(1) # nearest first
for a, b in E[np.argsort(d, kind="stable")]:
s, o = nb(g, a, b, c)
if o == 0 or s >= want * o:
g[a, b] = c; moved += 1; break
else: g[i, j] = c # nowhere better: stay
if moved == 0: break
return s0, alike(g)
s0, s1 = city(1/2)
print(f"start {s0:.2f} alike; wants 1/2, ends {s1:.2f}")
print("ends by demand .1-.7:",
*(f"{city(w / 10)[1]:.2f}" for w in range(1, 8)))
rng = np.random.default_rng(37) # BTW (1987) sandpile
z, sizes = rng.integers(0, 4, (50, 50)), []
for k in range(40000):
i, j = rng.integers(0, 50, 2); z[i, j] += 1; n = 0
while (z > 3).any(): # topple; edges lose grains
t = (z > 3).astype(int); n += t.sum(); z -= 4 * t
z[1:] += t[:-1]; z[:-1] += t[1:]
z[:, 1:] += t[:, :-1]; z[:, :-1] += t[:, 1:]
if k >= 10000: sizes.append(n) # skip warm-up
s = np.array(sizes)
print(f"30000 grains: {(s==0).mean():.0%} topple none,",
f"largest {s.max()}")
print("sizes 1-9, 10-99, 100-999, 1000+:", *np.histogram(
s, [1, 10, 100, 1000, 10**6])[0])
q = np.loadtxt("quakes.csv", delimiter=",", skiprows=1)
q = q[:, 4] # Fiji magnitudes, real (R: quakes)
for mc in (4.5, 4.7): # Aki (1965), half-bin shift
m = q[q > mc - .01]
b = np.log10(np.e) / (m.mean() - (mc - .05))
print(f"Fiji M >= {mc}: {len(m)} quakes,",
f"b = {b:.2f} +- {b / len(m)**.5:.2f}")
Output, as printed on the image
Output printed on the image:
start 0.50 alike; wants 1/2, ends 0.79
ends by demand .1-.7: 0.52 0.54 0.65 0.71 0.79 0.92 0.97
30000 grains: 57% topple none, largest 5902
sizes 1-9, 10-99, 100-999, 1000+: 4806 4054 3282 821
Fiji M >= 4.5: 623 quakes, b = 1.08 +- 0.04
Fiji M >= 4.7: 415 quakes, b = 1.22 +- 0.06
Run it. sprint37_emergence_and_self_organisation.py · versions, data and steps
Check: 17 037 + 12 963 = 30 000 grains · 101.08 = 12 · 1.08 ÷ √623 = 0.04
06 General Notes Practice
- Epstein (1999): “If you didn’t grow it, you didn’t explain its emergence”; growing it is not proof either
- A sandpile and a fault share a heavy tail; faults are not sandpiles
- Mild wishes are enough to sort a model city; that does not show what sorts a real one
Same people, other rule: asking 0.3 ends at 0.65.
07 Mini Project Hands-on
- Seeds 1–5 at a demand of ½: the city ends 0.78 to 0.80 alike
- Move residents to a random empty cell instead of the nearest one that suits them
- Fit b for cuts from M 4.3 to 4.7: 0.89 rising to 1.22
Then grow the sandpile to 100 × 100 and compare the largest avalanche.
R Trusted Sources
- Anderson (1972) More Is Different, Science 177(4047), 393–396
- Schelling (1971) J. Math. Sociol. 1, 143–186
- Bak, Tang & Wiesenfeld (1987) PRL 59(4), 381–384
- Gutenberg & Richter (1944) BSSA 34(4), 185–188
- Aki (1965) Bull. Earthq. Res. Inst. 43, 237–239
- Utsu (1966) J. Phys. Earth 14(2), 37–40
- Woessner & Wiemer (2005) BSSA 95(2), 684–698
- Epstein (1999) Complexity 4(5), 41–60
- R quakes data (Harvard PRIM-H; Woodhouse)
