An iterative random walk accumulates small random steps to produce an organic wandering line
A random walk steps through a sequence where each position is offset from the last by a random amount: y += random(20) - 10. The result is a line that drifts organically without abrupt jumps. Three sketches in ch_3 build this progressively: IterativeVariance1 draws a flat horizontal baseline; IterativeVariance2 replaces y with a fully random value each step (no memory — jagged); IterativeVariance3 adds only a small random delta to y each step (cumulative memory — smooth drift). The distinction between independent randomness (memoryless) and cumulative randomness (drift) is the core lesson. The latter is essentially a 1D random walk and approximates many real-world phenomena (Brownian motion, price series).
Examples
ch3_2_IterativeVariance3.pde: ystep = random(20)-10; y+=ystep; — each x-step adds a random signed offset to y. ch3_2_IterativeVariance2.pde: y = bordery + random(height - 2* bordery); — y is fully random each step, no drift.
Assessment
Explain the visual difference between IterativeVariance2 and IterativeVariance3. Then predict what happens to the IterativeVariance3 walk if you increase the maximum step size from 10 to 100.