Saramsha

No. 053  ·  8 November 2026

The Pattern Nobody Drew

Two chemicals spread across the same grid at different speeds and eat into one another wherever they meet. Nothing else is in the rule — no target shape, no plan — and yet spots, stripes, mazes and coral fall out of it anyway. Paint a seed of the second chemical anywhere and watch the rule decide what grows there.

Drag to paint. Keys: 1–5 switch the rule, R resets, P pauses.

About this piece

A mathematician who never saw a leopard explained its spots

In 1952 Alan Turing published a paper called "The Chemical Basis of Morphogenesis," which asked a question nobody had managed to answer: how does a ball of identical cells, with no picture of the adult animal anywhere inside it, end up with stripes in exactly the right places? Turing's answer didn't need a picture. He showed that two chemicals, spreading through a tissue and reacting with each other as they go, can settle into a stable pattern of high and low concentration — spots, stripes, blotches — purely from the mathematics of diffusion and reaction, with no blueprint anywhere in the system. He called them morphogens, and the mechanism is now named after him: a Turing pattern.

The crucial trick is that the two chemicals have to spread at different speeds. One of them, usually called the activator, encourages more of itself to appear nearby — but it diffuses slowly, so that effect stays local. The other, the inhibitor, is produced alongside it but spreads much further before it has any effect, suppressing the activator at a distance. Short-range help, long-range stop: wherever the activator gets a small head start, it builds a spot: wherever the inhibitor dominates, nothing grows. Which shape wins — spots, stripes, a maze — depends only on the relative rates, not on anything resembling a drawing.

The specific rule running here

This page runs a particular pair of reaction-diffusion equations published by Peter Gray and Stephen Scott in 1983, usually just called Gray–Scott. Call the two chemicals U and V. U feeds in from outside at a fixed rate and diffuses fast; V is produced only where U and V are both already present — via the reaction U + 2V → 3V — and diffuses more slowly, then decays. Every cell on the grid updates by the same two lines, using only the concentrations at its four neighbours:

ΔU = Du  · laplacian(U) − U·V² + f·(1−U)
ΔV = Dv · laplacian(V) + U·V² − (f+k)·V

Only f (how fast U is replenished) and k (how fast V is removed) differ between the five buttons above; the diffusion rates and the reaction itself never change. Mapping out which pairs of f and k give which pattern — spots here, worms there, chaos somewhere else — was done by John Pearson in 1993 and is still called Pearson's classification. It is a strange map: cross from "Coral" into "Mitosis" by the smallest possible step in k and the whole picture starts behaving like a cell dividing, spot splitting into two, forever.

The same underlying idea — not necessarily this exact rule — is a leading explanation for a surprising range of real pattern, from the spacing of hair follicles and the ridges of a fingerprint to the spots on a leopard, the stripes on an angelfish, and the gaps in some seagrass meadows and "fairy circle" grasslands, where the chemicals are better described as competing for water and nutrients than literally reacting. A closely related, much faster system — the Belousov–Zhabotinsky reaction, discovered by accident in a Soviet lab in the 1950s and nearly unpublishable because chemists of the time didn't believe a chemical mixture could organise itself — does the same thing with actual dye, visibly, in a petri dish.

The grid is 130 by 130 cells, wrapped at the edges so a pattern can grow across them with no seam, and is recomputed in full several times per rendered frame — nothing here is a stored image, every pixel you see is a live chemical concentration. Painting blends the brush in smoothly rather than stamping a hard edge, which is why a seed grows an irregular shape rather than a perfect circle. ?warm= runs the rule forward before the first frame, so a screenshot shows an established pattern rather than a blank grid.