๐Ÿ’ง

This Page Wants to Be Heard

Every click creates a ripple โ€” in pixels and in sound.
All audio is synthesized in real time from pure mathematics.
Make sure your device isn't muted.

Set your volume to a comfortable level

The Mathematics of Diffusion

How Does
Information Spread?

From a drop of ink to the shape of the universe

Drop a stone in still water โ€” ripples expand, weaken, and vanish. A drop of ink in a glass disperses until it's everywhere. This is diffusion: one of the most fundamental processes in nature, governed by a single, elegant equation.

01 โ€” TOUCH THE SURFACE

Drop a Stone in Still Water

Click anywhere on the surface below. Watch how a concentrated point of energy spreads outward, growing weaker as it travels. This is diffusion in action โ€” information radiates from where it begins, but it never stays concentrated.

Each click creates a ripple โ€” in light and in sound
Click or tap the surface
Drops
0
Max Amplitude
0.00
Total Energy
0.00

02 โ€” THE EQUATION

One Equation Rules Them All

Joseph Fourier discovered this in 1822 while studying heat flow through metal. What he found was shockingly general โ€” the same equation governs the spread of heat, the diffusion of molecules, the flow of information through networks, even the pricing of financial options.

โˆ‚u/โˆ‚t = ฮฑ โˆ‡ยฒu

In words: the rate of change at any point is proportional to how different that point is from its neighbors. Hot spots cool. Concentrations dilute. Peaks flatten. The constant ฮฑ controls the speed.

1D Heat Equation Solver

Click on the bar to add heat. Watch it spread in real time.

ฮฑ = 0.50 ยท Click to add heat
0.50

What you're seeing โ€” The simulation solves the heat equation numerically using finite differences. Each pixel's temperature changes based on the difference between it and its neighbors: u(x, t+dt) = u(x,t) + ฮฑยทdtยท(u(x+1,t) โˆ’ 2u(x,t) + u(xโˆ’1,t))/dxยฒ. The sharp peak diffuses into a wider, lower Gaussian โ€” concentrations always spread, and total "heat" is conserved.

03 โ€” THE FUNDAMENTAL SOLUTION

The Gaussian Emerges

If you start with all the heat concentrated at a single point, the solution to the heat equation is beautiful and exact:

ฮฆ(x, t) = 1 / โˆš(4ฯ€ฮฑt) ยท exp(โˆ’xยฒ / 4ฮฑt)

This is the Gaussian โ€” the bell curve โ€” born not from statistics, but from physics. The width grows as โˆšt, and the peak height drops as 1/โˆšt. Energy is conserved: the area under the curve is always exactly 1.

Watch the Gaussian Breathe

Drag the time slider to watch the fundamental solution evolve. The curve flattens but the total area remains constant.

t = 0.10 ยท ฯƒ = 0.45
0.10
1.00
Peak Height
โ€”
Std Deviation ฯƒ
โ€”
Total Area
1.000

04 โ€” THE MICROSCOPIC VIEW

Random Walks and Brownian Motion

Zoom into the ink drop. Each molecule bounces randomly off its neighbors โ€” a random walk. In 1905, Einstein showed that this microscopic chaos produces macroscopic diffusion. The key insight:

โŸจxยฒโŸฉ = 2Dt

The average squared displacement grows linearly with time. After N steps, a particle is typically โˆšN steps from where it started โ€” not N. This is why diffusion is slow: doubling the distance takes four times as long.

Random Walk Simulator

Watch 500 particles take independent random walks. The histogram builds a Gaussian โ€” the Central Limit Theorem in real time.

Particle positions over time
Steps Taken
0
โŸจxยฒโŸฉ Measured
0.00
โŸจxยฒโŸฉ = 2Dt Predicted
0.00

The deep connection โ€” The heat equation and random walks are two faces of the same coin. At the macroscopic level, we see smooth diffusion governed by โˆ‚u/โˆ‚t = ฮฑโˆ‡ยฒu. At the microscopic level, countless random walkers produce a Gaussian distribution that satisfies the exact same equation. Einstein used this connection to prove that atoms exist โ€” and won a Nobel Prize for it.

05 โ€” TWO EQUATIONS, TWO WORLDS

Waves vs Diffusion

These two equations look almost identical โ€” but they describe fundamentally different universes:

โˆ‚ยฒu/โˆ‚tยฒ = cยฒ โˆ‡ยฒu
Wave equation
โˆ‚u/โˆ‚t = ฮฑ โˆ‡ยฒu
Heat equation

A wave preserves shape โ€” it propagates without losing information. Diffusion destroys information โ€” it smears, smooths, and forgets. One is reversible; the other is not.

Side by Side

Same initial pulse, same spatial setup โ€” watch how differently they evolve.

WAVE โ€” โˆ‚ยฒu/โˆ‚tยฒ = cยฒโˆ‡ยฒu
DIFFUSION โ€” โˆ‚u/โˆ‚t = ฮฑโˆ‡ยฒu

Wave Equation

Second-order in time. Information travels at speed c without distortion. Reversible โ€” you can run the clock backward and recover the original pulse. Governs sound, light, and seismic waves.

Heat / Diffusion Equation

First-order in time. Information spreads outward and loses its shape. Irreversible โ€” you cannot "un-diffuse" a dissolved drop of ink. Governs heat, chemical concentration, and probability.

06 โ€” THE FULL PICTURE

Diffusion in Two Dimensions

In 2D, the fundamental solution is a circular Gaussian that spreads radially. Click on the canvas to add heat sources and watch them merge, interact, and slowly equilibrate. This is what happens inside a pan of boiling water, a cell membrane, or the atmosphere of a star.

Click to place heat sources โ€” sounds accompany each drop
Click to add heat
1.20

Diffusion Is Irreversible

A drop of ink dissolves and never returns.

A hot spot cools and the heat is gone.

Information spreads, weakens, and vanishes.

The second law of thermodynamics says
you cannot un-dissolve the ink.

But what if a machine
could learn to reverse it?

In 2020, researchers discovered that the exact same equation you've been exploring
can teach a machine to generate images, videos, and music โ€” from pure noise.

Part II: Does a Machine Dream? โ†’
edu.kimsh.kr