There is something elegant about a quarter-circle arc drawn on a square tile. On its own it means nothing. Rotate it at random and place it beside another — and another, and another — and emergent large-scale patterns appear that no single tile anticipated. This is Truchet tiling: a two-century-old mathematical toy that turns out to encode deep ideas about randomness, connectivity and percolation. It is also the first of ten simulations in Wave 108, a release that ranges from nineteenth-century number theory to twentieth-century error-correcting codes to classical Islamic art.
Generative Art: Tiles, Spirals & Star Polygons
Truchet Tiles
Father Sébastien Truchet described his tiling system in 1704: take a square tile bearing a diagonal line from one corner to its opposite, rotate it into one of four orientations, and lay them at random. The resulting patterns are surprisingly rich — arc-connected regions form clusters whose size distribution is related to percolation theory, and the boundary between connected domains is a random curve with known fractal dimension. The modern quarter-circle variant (two arcs per tile instead of a diagonal) was popularised by Cyril Smith and Pauline Boucher in 1987 and has since become a staple of generative art practice.
The simulation lets you adjust grid resolution from 4 to 64 tiles per side, toggle between the diagonal and arc variants, and re-randomise with a single keystroke. A live connectivity overlay highlights the largest connected region in a contrasting colour so the percolation structure is immediately legible.
Cyclic Cellular Automata
Cyclic cellular automata (CCA) are among the most visually compelling systems in discrete
mathematics. The rule is deceptively simple: a cell in state s advances to
state s+1 (mod k) if at least one of its neighbours is already in state
s+1. On a random initial grid, small nuclei of ordered cells compete,
coalesce and eventually organise the entire lattice into rotating spiral waves that sweep
across the grid like a cellular aurora.
The number of states k, the neighbourhood radius, and the threshold (how
many neighbours must be in state s+1) are all adjustable. Low thresholds
produce dense spirals; high thresholds produce sparse, slow-moving fronts. The transition
between regimes is sharp and exhibits characteristics reminiscent of a phase transition in
a statistical mechanical system.
Islamic Geometric Patterns
Islamic geometric ornament developed over more than a millennium into one of the most
sophisticated mathematical art traditions in human history. The underlying construction
method uses girih tiles — a set of five polygon shapes (decagon, pentagon,
elongated hexagon, bowtie, and rhombus) whose angles are multiples of 36° — to
tile the plane with ten-fold and five-fold local symmetry. Star polygons of the form
{n/k} are inscribed in the tiles and their lines extended to produce the
interlocking strap patterns seen in mosques from Cordoba to Samarkand.
The simulation generates star polygon families parametrised by n (number of
points) and k (skip interval) and tiles the canvas using the corresponding
girih construction. You can choose any symmetry group from the 17 wallpaper groups that
Islamic craftsmen exploited, and export the pattern as an SVG for use in design work.
Probability: From Fraud Detection to Stochastic Finance
Benford's Law
In 1938, Frank Benford noticed that the leading digit of numbers drawn from many real-world
datasets is not uniformly distributed. The digit 1 appears as the first digit roughly 30%
of the time; the digit 9 appears only about 4.6% of the time. The distribution is
logarithmic: P(d) = log10(1 + 1/d) for d ∈ {1, ..., 9}.
This counterintuitive law holds for populations of cities, physical constants, financial
ledger entries, river lengths, and Fibonacci numbers — essentially any dataset that
spans several orders of magnitude without an artificial upper bound.
Benford's Law is now used routinely to detect fraud in tax returns, election results, and corporate accounting records: fabricated numbers tend to start with 1 less often than genuine data. The simulation lets you upload a CSV or choose from built-in datasets (Fibonacci sequence, powers of 2, populations, and random uniform data) and overlays the observed first-digit distribution against the theoretical Benford curve, with a chi-squared test result displayed in real time.
Gambler's Ruin
The Gambler's Ruin problem is one of the oldest results in probability theory. A gambler
starts with k dollars and bets one dollar per round at probability
p of winning each bet, against a house with n - k dollars. The
probability that the gambler reaches n dollars before going bankrupt is:
P(ruin) = 1 - (1 - (q/p)^k) / (1 - (q/p)^n) when p ≠ q
P(ruin) = 1 - k/n when p = q = 0.5
The simulation runs thousands of simultaneous random walks, plotting the empirical ruin
probability against the theoretical curve as k, n, and
p are adjusted. The convergence of simulation to theory is itself instructive:
even with a fair coin and equal stakes, any finite gambler facing an infinitely rich house
is certain to be ruined in the long run.
Wiener Process & Stochastic Calculus
The Wiener process (standard Brownian motion) is the continuous-time limit of the simple random walk. It is the building block of modern stochastic calculus and underpins the Black-Scholes options pricing formula, the Ornstein-Uhlenbeck model of mean-reverting processes, and the diffusion equation in physics. The simulation renders three related processes simultaneously:
- Standard Brownian motion
W(t): independent Gaussian increments with variancedt. - Geometric Brownian motion
S(t) = S(0) exp((μ - σ²/2)t + σW(t)): the canonical model for stock prices, with driftμand volatilityσ. - Ornstein-Uhlenbeck process
dX = θ(μ - X)dt + σdW: mean-reverting, used in interest rate models and physics of colloidal particles.
Sample path envelopes, empirical variance growth, and the stationary distribution of the OU process are all displayed alongside the paths, making the theoretical predictions directly verifiable at interactive speed.
Regression to the Mean
Francis Galton discovered regression to the mean in 1886 while studying the heights of parents and their adult children. Tall parents tend to have children shorter than themselves; short parents tend to have taller children. This is not because of some biological correction mechanism, but because extreme values in any noisy measurement process are partly due to luck — and luck does not persist. The effect is ubiquitous: it explains why the “Sports Illustrated cover curse” appears to doom athletes who appear on the cover, why students who score highest on a pre-test tend to improve less than average on a post-test, and why many medical interventions appear effective even when they are not.
The simulation generates bivariate normal data with adjustable correlation r
and shows the regression line, the elliptical equal-density contours, and the classic
Galtonian “regression towards mediocrity” arrow. A companion panel demonstrates the effect
in a repeated-measurement scenario so the mechanism is viscerally clear rather than
abstractly stated.
Fluid Dynamics: Viscous Flow in a Pipe
Pipe Flow Profiles
The flow of a viscous fluid through a circular pipe under a steady pressure gradient is one of the few problems in fluid mechanics that has an exact analytic solution. For laminar flow, the Hagen-Poiseuille equation gives a parabolic velocity profile:
u(r) = (ΔP / 4ηL) (R² - r²)
where ΔP is the pressure drop, L the pipe length,
η the dynamic viscosity, R the pipe radius and
r the radial distance from the centreline. The maximum velocity at the centre
is exactly twice the mean velocity — a result that appears in every fluid mechanics
course. When the Reynolds number Re = ρuD/η exceeds roughly 2300,
the flow transitions to turbulence and the profile flattens into a logarithmic law-of-the-wall
shape.
The simulation displays both the laminar parabola and the turbulent profile side-by-side, with a slider that sweeps Re through the transition. Streaklines show individual fluid particle trajectories; a cross-sectional colour map displays local velocity magnitude in the pipe interior. The sharp transition between the two regimes — one of the great unsolved problems of classical physics — is visible as an abrupt change in the velocity profile shape.
Algorithms: Error Correction and Coding Theory
Hamming Error-Correcting Codes
Richard Hamming invented his error-correcting codes in 1950 out of frustration with the Bell Labs computer that kept discarding his weekend batch jobs whenever it encountered a parity error. The Hamming(7,4) code encodes 4 data bits into 7 bits by adding 3 parity bits placed at positions that are powers of two. Each parity bit covers a specific subset of data positions, forming a system of equations that can pinpoint exactly which single bit has been flipped — not merely detect that an error occurred, but correct it.
Syndrome = P1 P2 P3 (XOR of covered bit positions)
If syndrome = 0: no error
If syndrome = 5: bit 5 is flipped — correct it
The simulation walks you through encoding, transmission with injected single-bit errors, and syndrome decoding step by step. You can flip individual bits with a click and watch the syndrome computation update in real time. Extended Hamming codes with an overall parity bit (SECDED — single error correct, double error detect) are also available; these are the codes used in ECC RAM in every modern server. Understanding Hamming codes is the gateway to Reed-Solomon codes (used in QR codes and CDs), LDPC codes (used in Wi-Fi and 5G), and the deep connection between coding theory and information-theoretic capacity.
Geometry: Polyhedra in Three Dimensions
Polyhedra Explorer
Euler's polyhedron formula V - E + F = 2 is one of the oldest and most
beautiful results in mathematics. It holds for any convex polyhedron: subtract edges from
vertices, add faces, and you always get 2. The five Platonic solids — tetrahedron,
cube, octahedron, dodecahedron, icosahedron — are the only convex polyhedra whose
faces are all congruent regular polygons. The 13 Archimedean solids relax this to allow
multiple face types while preserving vertex-transitivity.
The Polyhedra Explorer lets you rotate and inspect all 18 of these solids in 3D, toggling between wireframe, solid face, and vertex-label views. A statistics panel confirms Euler's formula for each solid in real time as you switch between them. Truncation relationships are highlighted: the cuboctahedron is the truncated cube, the icosidodecahedron is the truncated dodecahedron, and the rhombicuboctahedron sits halfway between the cube and the octahedron in the symmetry-group hierarchy. These relationships are easier to see in an interactive 3D view than in any static diagram.
A note on difficulty ratings: All ten simulations in Wave 108 are rated difficulty 2 or 3 out of 5 — accessible enough that a motivated secondary school student can engage with the controls, but deep enough that an undergraduate will find the mathematical background genuinely enriching. The goal is not to simplify the mathematics but to make it tangible.
Try It Yourself
Three simulations to start with if you are new to this wave:
The full Wave 108 catalogue is browsable via the category index.
All ten simulations are also available in Ukrainian via the /uk/ language
prefix.
What Comes Next
Wave 108 closes a sprint focused on classical mathematical models that sit in the space between pure mathematics and applied science — models with exact analytical solutions that are illuminated rather than replaced by simulation. Seeing the parabolic Poiseuille profile sweep into a turbulent logarithmic law as you drag a Reynolds number slider communicates something that the equations alone do not: the abruptness of the transition, the way the flat top of the turbulent profile still curves near the wall, the visual difference between laminar order and turbulent chaos.
Wave 109 is in planning. Current targets include stochastic resonance, Ising model critical exponents, Delaunay triangulation with interactive point insertion, and a revisit of the Lorenz system with Lyapunov exponent computation. If you have a simulation you would like to see built, or a model you think is underrepresented in browser science education, the contact page is always open.