← so1omon.net
Simulation

E. coli Chemotaxis

Temporal gradient sensing · run-and-tumble · the memory is the sensor

E. coli is too small to measure a chemical gradient spatially. At 2 micrometers, the concentration difference between its front and back is buried in noise. So it doesn't try. Instead, it measures time.

The bacterium swims in a straight line (a run), then tumbles to pick a new random direction. During each run, it compares current attractant concentration against what it sensed a second or two ago — a chemical memory encoded in methylation state. If things are improving, it suppresses tumbling and keeps running. If not, it tumbles sooner. The result is drift up the gradient, via a biased random walk.

The memory is stored in the same receptor molecules that do the current sensing. Same molecule, both jobs, simultaneously. The record of the past is the current state of the thing that is reading the present.

Simulation

Running
Tumbling
Current conc.
Memory (methylation)
Tumble signal
Gradient steepness
moderate
Adaptation rate (τ)
1.5 s
Bacteria count
4
Trails
60 steps
Background intensity shows attractant concentration (left = low, right = high). Orange dots are tumbling; white dots are running. The strip chart tracks the tracked bacterium (marked with a circle): blue = concentration it is experiencing, green = its methylation memory, orange = tumble pressure. When green > blue, it's worse than expected — tumble soon. When blue > green, improving — keep running.

Set gradient to zero to see unbiased random walk. Set adaptation fast (τ low) to see the memory erase advantage — the bacterium forgets the past too quickly to compare. Set it slow to see the opposite problem: memory lags so far behind that the comparison misfires.