Devlog #78 – Wave 58: Galton Board, BZ Reaction & Turing Machine

Wave 58 spans probability, chemistry, and theoretical computer science — with an animated Galton board demonstrating the Central Limit Theorem live, a Belousov-Zhabotinsky excitable-medium simulation producing self-organizing spiral waves, and a step-by-step Turing machine with five built-in programs. The library now stands at 550 simulations.

Wave 58 — 3 simulations added
550
Total simulations
3
New this wave
58
Wave number
78
Devlog #

New Simulations

🎯

Galton Board — Binomial Distribution & CLT

Animated bean machine: balls cascade through n rows of pegs with probability p per deflection. Side-by-side histogram shows B(n,p) PMF and normal approximation overlay. Live mean and Οƒ tracking.

πŸŒ€

Belousov-Zhabotinsky Reaction — Chemical Spiral Waves

3-state excitable-medium CA (Greenberg-Hastings model) producing self-organizing spiral waves. Click to plant sparks. Four colour schemes, adjustable threshold and refractory steps.

πŸ–₯️

Turing Machine — Step-by-Step Tape Simulator

Animated infinite tape with read/write head. Highlighted transition table updates in sync. Five programs: binary increment, unary addition, palindrome check, copy, busy beaver.

🎯 Galton Board β€” Binomial Distribution & Central Limit Theorem

The bean machine

Francis Galton's bean machine (1889) is a physical demonstration of the Central Limit Theorem. Balls drop from a single slot at the top and encounter n rows of pegs. At each peg a ball deflects left with probability p or right with probability q = 1 βˆ’ p. If we count the number of rightward deflections k, the resulting distribution is the binomial:

P(k) = C(n, k) Β· p^k Β· (1-p)^(n-k)     k = 0, 1, ..., n

The mean is ΞΌ = nΒ·p and standard deviation Οƒ = √(nΒ·pΒ·q). By the Central Limit Theorem, as n increases this binomial distribution converges to a normal distribution N(np, npq) regardless of the value of p. The simulator shows the binomial PMF as a dashed curve and the smooth normal approximation in teal, both updating live as balls fall.

Simulation design

Balls are animated through the peg grid. Each ball's bin destination is pre-computed at spawn from a Bernoulli sequence, so it follows the exact binomial distribution. The left panel shows the animated cascade; the right panel renders a real-time histogram of bin counts with the theoretical overlay.

πŸŒ€ Belousov-Zhabotinsky Reaction β€” Excitable-Medium CA

The chemistry behind the spiral

The Belousov-Zhabotinsky reaction is an oscillating chemical system discovered by Boris Belousov in 1951 (and independently by Anatol Zhabotinsky in 1961). A mixture of malonic acid, sodium bromate and a cerium or ferroin catalyst spontaneously cycles between oxidized and reduced states, producing concentric colour waves visible to the naked eye. The Oregonator is the standard kinetic model, but a simpler cellular automaton captures the essential behaviour.

Greenberg-Hastings model

The 3-state excitable-medium CA (Greenberg & Hastings, 1978) uses three cell states:

Initial asymmetric seeds produce spiral wave pairs. Spontaneous ignition (a tunable rate) seeds new wave centres over time. All rendering uses ImageData pixel arrays for performance, supporting grids up to 300Γ—300 at 60 fps.

πŸ–₯️ Turing Machine β€” Computability Made Visible

Why simulate a Turing machine?

Alan Turing's 1936 paper "On Computable Numbers" introduced a hypothetical machine that reads and writes symbols on an infinite tape, one cell at a time, using a finite set of rules. Despite its simplicity, the Church-Turing thesis states that any effectively computable function can be computed by such a machine. Visualising execution step by step makes abstract concepts like accepting/rejecting states, halting, and the transition function concrete and graspable.

Five built-in programs

Tape display

The canvas renders a sliding window of tape cells centred on the read/write head. The active cell is highlighted with a purple glow; blank cells show a β–‘ symbol. The transition table scrolls to highlight the rule executed at each step. The head pointer turns green on accept, red on reject.

What's Next

Wave 59 will continue expanding coverage across category gaps. High-priority candidates include stochastic resonance (noise-enhanced signal detection in threshold systems), elastic waves (longitudinal and transverse wave propagation with reflection and interference), and cell growth and morphogenesis (reaction-diffusion Turing patterns driving cell differentiation).

← Devlog #77 β€” Wave 57 All posts β†’