The distance histogram — watch near and far become the same word
Scatter 200 random points in a box, measure all pairwise distances, draw the histogram. In 2D it's wide: some pairs are neighbors, some are strangers — distance carries information. Now drag the dimension slider. The histogram squeezes into a needle: in 1,000 dimensions the closest pair and the farthest pair differ by a few percent. Every measurement is redone live as you drag.
Slider is powers of two, 1 → 1024 dimensions. Distances are normalized by √d so the histograms are comparable; the squeeze you see is the concentration-of-measure phenomenon, computed, not illustrated.
The empty middle — a warehouse where everything's stacked against the walls
Take a box and mark its "core": the inner region at 90% of the side length. In 2D the core holds 81% of the volume — most of the box is middle. Drag the slider: at d=50, the core holds half a percent. The volume didn't disappear; it moved into a thin shell near the walls and corners. The dots below are a live 3,000-point Monte Carlo — green lands in the core, orange in the shell.
The theoretical curve 0.9^d is drawn in grey; the gold dots are the measured Monte Carlo fraction at each d you visit — watch them agree.
Watch a classifier rot — the noise-feature experiment
Two classes of points, cleanly separated in 2 informative dimensions — a nearest-neighbor classifier scores ~95%. Now do what real datasets do to you: add irrelevant features. Each extra dimension is pure noise, no signal. Drag the slider and watch the measured accuracy of the exact same algorithm decay toward a coin flip, because the useless dimensions drown the two useful ones inside every distance computation.
Real kNN (k=5) on 300 training / 150 test points, re-run per click. The left panel shows the 2 informative dims (always separable to the eye) — the algorithm just can't see them through the noise.
The exponential bill — how many samples to cover the space?
Coverage: drop N reference points, then ask — for a random query, how far is its nearest reference? In 2D, 1,000 points blanket the box; queries always land near one. Raise the dimension with N fixed and the measured gap explodes: your 1,000 points become a few lonely lighthouses in fog. Try to fix it with the N slider and watch how little each doubling buys.
Gap measured over 200 random queries per setting (normalized by √d). The bar chart accumulates your measurements so you can compare settings side by side.
The escape hatch — real data cheats
So why does anything work? Because real data doesn't fill high-dimensional space — it lies on thin manifolds inside it. Here's a 1-dimensional spiral embedded in a 100-dimensional box. Ambient dimension: 100. The kNN classifier that died in EP 03 — run it here: it thrives, because distances along the manifold still mean something. Then drag the off-manifold noise slider and watch the curse seep back in.
Data: two interleaved spiral arcs rotated into 100 dimensions (intrinsic dim ≈ 1), 300 train / 150 test, real kNN each click. The left panel shows the first two coordinates — the shadow of the manifold.