Hilbert’s Curve: What an Infinite Path Reveals About Finite Images

A recursive path through pixels leads to a continuous curve that fills a square.

Kanal
3Blue1Brown
Veröffentlicht
21. Juli 2017
Video
18:18
Lesezeit
4 Min.
Folien
4
Original
Englisch
Auf YouTube öffnen
Beim Scrollen schrumpft das Video in die rechte untere Ecke und läuft weiter. Untertitel folgen Ihrer Lesesprache.
LesespracheIn 2 Sprachen verfügbar
Diesen Artikel gibt es noch nicht auf Deutsch, daher wird das Original (Englisch) angezeigt.
ZUSAMMENFASSUNG

In 30 Sekunden

3Blue1Brown uses a proposed audio representation of images to motivate Hilbert’s recursive curve, then explains how increasingly fine paths lead to a continuous space-filling limit and why that limit helps illuminate finite approximations.

  1. 1A proposed audio mappingNeighboring frequencies could be assigned to nearby pixels.
  2. 2Recursive constructionRotate and connect copies to refine the grid.
  3. 3Stability under refinementAt a fixed path position, locations settle into smaller regions.
  4. 4A continuous space-filling mapThe limiting map reaches every point of the square and may revisit points.
  5. 5Separate claims need proofPointwise convergence alone does not establish continuity or coverage.

Das Wichtigste

  1. A recursively ordered pixel grid can preserve locality as resolution increases.
  2. A finite Hilbert approximation visits finitely many grid positions; its limit fills a continuous square.
  3. Continuity means sufficiently close inputs have arbitrarily close outputs, even when points are revisited.
  4. The infinite construction clarifies a pattern that also appears in finite approximations.
VOLLTEXT

Den bearbeiteten Text nach Kapiteln lesen

Nur das Transkript
01

A picture made of sound

Use a path to assign frequencies to pixels.

Can an infinite mathematical construction tell us anything useful about a finite problem? Imagine converting a camera image into sound so that a listener could learn to recognize shapes. Each pixel might control a frequency, with brightness represented by volume.

The difficult choice is how to assign frequencies to positions. If neighboring pixels have neighboring frequencies, a recognizable feature might produce a more coherent pattern of sound. This is a thought experiment, not a demonstrated sensory device.

A path through the image gives us an ordering: follow it from low to high frequencies, assigning a frequency to each pixel as we go. We want successive points on the path to lie close together in the image.

The first path I will build is a finite approximation to the Hilbert curve. Its winding shape may look complicated, but its construction follows a simple recursive rule.

02

Build the recursive path

Rotate and connect four smaller copies at each stage.

Start with a U-shaped route through four positions. To make a finer route, put a copy in each of four quadrants, rotate the copies as needed, and connect them. Repeat the same operation to obtain finer grids.

Four recursive pieces
FOLIE 1 / 4Four recursive piecesCopies in four quadrants are oriented and connected to make the next approximation.

At order n, the grid has 2ⁿ positions on each side. An order-eight approximation therefore visits the pixels of a 256 by 256 grid. Each finite path has a definite resolution and visits a finite number of pixel locations.

03

Compare refinement behavior

A Hilbert ordering is more stable across resolutions than a row-by-row snake.

Why use this ordering instead of a simple row-by-row snake? Both paths can move between neighboring pixels, but their behavior as we increase the resolution differs. Imagine keeping the frequency assigned to a point fixed while refining the image.

A row-by-row alternative
FOLIE 2 / 4A row-by-row alternativeA snake-like ordering provides a contrast in how locations change as resolution grows.

For the row-by-row path, refining the grid can send the same relative position along the path to a distant horizontal location. A small change in resolution may therefore change the sound assigned to a visual feature substantially.

The recursive Hilbert approximations behave more stably: at a fixed relative position along the path, successive locations settle into smaller regions as the grid is refined. That makes the ordering attractive for a gradual increase in detail.

This locality has a direction. Nearby inputs along the path map to nearby positions in the square; it does not mean that every pair of neighboring pixels must be adjacent in the one-dimensional ordering.

04

The space-filling limit

The infinite limit is a continuous map onto the square.

The history goes back to Giuseppe Peano, who described a space-filling curve in 1890, and David Hilbert, who gave another construction in 1891. The startling claim is that a continuous curve can reach every point of a square.

A finite drawing only suggests the idea. No finite grid path visits every point of a continuous square. The space-filling curve is the limit of the sequence of increasingly fine approximations, not any one drawing in the sequence.

Mathematically, the result can be expressed as a continuous map from the interval [0, 1] onto the square [0, 1]². Different inputs can reach the same output, so filling the square does not require a one-to-one correspondence.

05

Continuity and convergence

Explain closeness and define the limit from successive approximations.

What does continuous mean here? If two input values are sufficiently close, their output points must be as close as we choose. In the familiar epsilon-delta formulation, every desired output tolerance has a corresponding input tolerance.

The meaning of continuity
FOLIE 3 / 4The meaning of continuityNearby inputs must map to nearby outputs.

Continuity rules out jumps, but it does not prohibit the path from folding and revisiting places. Our ordinary picture of a smooth, finite-length line can mislead us when applied to this limiting object.

Following one input
FOLIE 4 / 4Following one inputTrack one position through successive approximations to motivate the limiting point.

To define the limit, fix one input along the interval and look at its output in each successive approximation. The recursive construction keeps those outputs in successively smaller regions, so their positions approach a limiting point.

Do this for every input, and the limiting points define a candidate function. Showing that the function is well defined, continuous, and reaches every point of the square requires arguments about the construction; pointwise convergence alone does not prove all those properties.

06

From the square to the plane

Extend the construction and return to the finite motivation.

The same idea can be extended beyond one square. Arrange a route through successive squares in the plane and connect suitably scaled or translated space-filling pieces. With an unbounded input interval, the construction can reach the whole plane.

The surprising infinite object also illuminates the finite example. We do not need infinitely many pixels or an infinitely long computation to use a finite approximation. The useful insight is the stable recursive pattern shared by successive resolutions.

Infinite mathematics can expose structure that is hard to see in a single finite drawing. In this case, the limiting curve makes the refinement behavior precise, while the practical audio mapping remains a proposal to investigate.

Mehr aus diesem Kanal

20 Folien40:44EN
3Blue1Brown· 16. Okt. 2026Grant Sanderson: There's never been a better time to go into mathGrant Sanderson, Constantin Kogler · 3Blue1BrownStudents fear AI has solved mathematics. Grant Sanderson argues the opposite: even if machines prove theorems better than we do, the institution of math stays valuable—and this is a rare moment when newcomers can reshape it.MathematicsAI for scienceHuman-AI Collaboration+2
29 Folien51:55EN
3Blue1Brown· 18. Sept. 2026The last IMO problem AI could not solveGrant Sanderson · 3Blue1BrownGrant Sanderson walks through IMO 2025 Problem 6 — a tiling puzzle that frontier models missed — and the visual patience it takes to prove a construction is optimal.MathematicsAI researchReasoning & test-time compute+2
0:55EN
3Blue1Brown· 24. Juli 2026The 64 Sugar Cubes Puzzle: Six Equal DistancesA 4×4×4 block has three colors; prove that six same-colored pairs share a distance.MathematicsEducation
Folien2:25EN
3Blue1Brown· 12. Juni 2026How Shannon Measured the Entropy of EnglishA guessing game helped Claude Shannon estimate how much information English text contains, and why prediction is central to compression.MathematicsAI History
Folien1:02EN
3Blue1Brown· 10. Juni 2026A Robot Walk and the Puzzle of Optimal Binary EncodingHow few bits does it take to send directions that occur with unequal frequencies?MathematicsScience Communication
4 Folien32:19EN
3Blue1Brown· 7. Juni 2026Reinventing Entropy: Why Prediction Helps Compress LanguageA robot’s movement code leads from prefix-free encoding to Shannon information and the entropy of language.MathematicsScience Communication