Chapter 03 · Part I · What a fractal is

The classic monsters

Between 1883 and 1926 a handful of mathematicians built shapes that seemed to break geometry: a dust with no length that still has as many points as a line, a curve with no tangent anywhere, a sponge with no volume, a single unbroken line that fills a square. They were made to win arguments. They turned out to be the first fractals.

8/5the Koch snowflake's final area, as a multiple of the triangle it starts from, while its perimeter grows without limit
(20/27)ⁿ → 0the Menger sponge's volume after n steps; its surface area grows without limit at the same time
0.6309the dimension of Cantor's set, log 2 / log 3: more than a scatter of points, less than a line

Common mix-up: an infinitely long boundary does not mean an infinitely big shape. The Koch snowflake's edge is longer than any number you can name, yet the whole snowflake fits inside the circle around the triangle it grew from. Length and area are measuring different things, and a fractal can be extreme in one and tame in the other.

A gallery nobody wanted

Why they were called monsters

For most of the history of calculus, mathematicians quietly assumed that a curve you could draw without lifting your pen would be smooth almost everywhere. It might have a corner here and there, like the point of a V, but between the corners it would have a definite direction, a tangent line, at every point. Calculus is built on tangents, so this assumption mattered. Textbooks offered "proofs" of it.

In 1872 Karl Weierstrass presented a counterexample to the Berlin Academy: a function, written as an infinite sum of cosine waves, that is continuous everywhere and has a tangent nowhere. Every piece of its graph, however small, is as jagged as the whole. It was a formula, not a picture, and nobody could draw it, but the logic was airtight.

Over the next fifty years more of these objects appeared, and this time they were geometric. Georg Cantor built a set of points by throwing away thirds. Giuseppe Peano and David Hilbert built curves that pass through every point of a square. Helge von Koch built a snowflake whose edge has no tangent, deliberately so that anyone could see the Weierstrass phenomenon with a ruler and compass. Wacław Sierpiński punched holes in triangles and squares. Karl Menger did it to a cube.

Many mathematicians found these shapes distasteful, and some said so. Charles Hermite, in an 1893 letter to Thomas Stieltjes, wrote that he turned away "with fright and horror" from functions without derivatives. To that generation the shapes were pathologies, made to show where intuition fails, and they were filed away as a "gallery of monsters". Nobody thought they described anything in nature.

Benoit Mandelbrot turned that around in the 1970s. In The Fractal Geometry of Nature (1982) he argued that the monsters were not exceptions at all: coastlines, clouds, lungs and mountain ranges look much more like Koch curves than like circles and triangles. The monsters became the textbook examples of a new geometry. This chapter builds each of them, step by step, and measures what happens.

Go deeper: the recipe every monster shares

Every shape in this chapter is made the same way. Start with a simple piece: a line segment, a triangle, a square, a cube. Replace it with N smaller copies of itself, each scaled down by a factor r. Then do the same thing to each copy, and again, forever. The shape is whatever is left "at infinity".

That recipe fixes the shape's similarity dimension, the number D that solves N = rᴰ, or D = log N / log r. A line cut into 3 pieces, each a third as long, has N = 3 and r = 3, so D = 1. A square cut into 9 smaller squares has N = 9, r = 3, so D = 2. The monsters are the cases where the answer is not a whole number. Chapter 2 shows how to measure D for shapes without a neat recipe.

The second thing every monster shares is what the recipe does to ordinary measurements. If you keep N pieces each scaled by 1/r, a length multiplies by N/r at every step, an area by N/r², a volume by N/r³. When that factor is bigger than 1 the measurement runs off to infinity; when it is smaller than 1 it shrinks to zero. Only for the "right" dimension D does the factor N/rᴰ equal exactly 1. That is the whole reason a fractal can have infinite length and zero area at once.

1883 · The first monster

Cantor dust

Take the line segment from 0 to 1. Remove the open middle third, the points strictly between 1/3 and 2/3. Two segments are left. Remove the middle third of each. Four are left. Keep going forever. Whatever survives is the Cantor set, which Georg Cantor described in 1883 while studying how sets of points on a line can be arranged.

Add up what you threw away. The first cut removes 1/3. The second removes two pieces of 1/9, so 2/9. The third removes four pieces of 1/27. The total is 1/3 + 2/9 + 4/27 + … which adds up to exactly 1. You have removed the whole length of the segment. Put another way, after n steps the surviving length is (2/3)ⁿ, and that goes to zero.

So the Cantor set has no length. You might expect it to be nearly empty, perhaps just the endpoints of the pieces: 0, 1, 1/3, 2/3, 1/9 and so on. It is not. The point 1/4 is never removed, even though it is never an endpoint. And the set has exactly as many points as the whole segment you started with, uncountably many, by Cantor's own measure of the sizes of infinite sets. It is a dust: no two of its points are joined by any interval, yet it is everywhere crowded.

D = log 2 / log 3 ≈ 0.6309
Each step keeps 2 pieces, each scaled down by 3. The dimension sits between a point (0) and a line (1): the dust is too thin to have length but far too rich to be a list of points.
Go deeper: why base 3 tells you who survives

Write numbers between 0 and 1 in base 3, with digits 0, 1 and 2. The first digit after the point says which third of the segment you are in: 0 for the left third, 1 for the middle, 2 for the right. The second digit says which third of that third, and so on.

The first cut removes exactly the numbers whose first digit has to be 1. The second cut removes the ones whose second digit has to be 1. So the Cantor set is the set of numbers that can be written in base 3 without using the digit 1. The "can be" matters: 1/3 is 0.1 in base 3, but it is also 0.0222…, with 2s forever, so it stays.

That description proves both surprising facts. 1/4 in base 3 is 0.020202…, no 1s, so it survives. And every infinite string of 0s and 2s gives a different point. Swap every 2 for a 1 and read the string in binary: you get every number from 0 to 1. So the Cantor set has as many points as the whole interval. The instrument below does this arithmetic exactly, with whole-number long division, for any fraction you type.

Cantor also used the set to build a strange function, now called the Cantor function or "devil's staircase". It climbs from 0 to 1, is continuous, and yet is flat on every one of the removed middle thirds, so it does all its climbing on a set of length zero.

Instrument 1

Is it in the Cantor set?

Type any number between 0 and 1, as a fraction like 1/4 or a decimal like 0.75. The page converts it to base 3 by exact long division, finds the repeating part, and tells you whether the point survives every cut, or at which step it falls into a removed middle third.

Base 3–
First digit 1 at–

Digits in brackets repeat forever. A finite expansion that ends in a 1, like 0.1 for 1/3, can be rewritten to end in 0222…, so it survives as an endpoint.

1904 · A curve with no tangent

The Koch curve and snowflake

Helge von Koch, a Swedish mathematician, published his curve in 1904 under a title that says exactly what he wanted: a continuous curve without tangents, obtained by an elementary geometric construction. Weierstrass had done it with infinite series. Koch did it with a ruler.

Start with a segment. Divide it into thirds. Replace the middle third with two sides of an equilateral triangle, a tent pointing outward. Now you have 4 segments, each a third as long as the original. Do the same to each of them: 16 segments, each a ninth as long. Keep going. The limit is the Koch curve.

Every step multiplies the length by 4/3, since 4 pieces replace 3 pieces' worth. After 10 steps the curve is (4/3)¹⁰ ≈ 17.8 times its original length; after 100 steps, about three trillion times. The limit has infinite length. Yet the curve never leaves a small triangle above its base. And because every piece, at every size, has fresh tents growing out of it, there is no point where the curve settles into a direction: it has a corner everywhere, which is to say no tangent anywhere.

Put three Koch curves on the sides of an equilateral triangle, all tenting outward, and you get the Koch snowflake. Its perimeter after n steps is 3 × (4/3)ⁿ times the triangle's side, so it too grows without limit. Its area, though, converges. Each step adds new small triangles, but they shrink fast enough that the added area forms a geometric series, and the total settles at exactly 8/5 of the starting triangle.

Aₙ = A₀ × (8/5 − 3/5 × (4/9)ⁿ)
The snowflake's area after n steps. The (4/9)ⁿ term dies away, so the area approaches 8/5 of the first triangle, A₀. Meanwhile the perimeter, 3 × (4/3)ⁿ, has no limit at all.
Go deeper: adding up the snowflake's area

Call the starting triangle's area A₀. Step 1 adds 3 triangles, each with sides a third as long, so each has a ninth of the area: 3 × A₀/9. Step 2 adds one triangle for every segment of step 1, and there are 12 segments, each new triangle a ninth of the size of the last ones: 12 × A₀/81. In general step n adds 3 × 4ⁿ⁻¹ triangles of area A₀/9ⁿ.

Factor out the first term and the rest is a geometric series with ratio 4/9: A₀ × (1 + 1/3 × (1 + 4/9 + (4/9)² + …)). The bracket sums to 1/(1 − 4/9) = 9/5, so the total is A₀ × (1 + 3/5) = 8/5 A₀.

The dimension comes from the recipe: 4 pieces, each scaled by 3, so D = log 4 / log 3 ≈ 1.2619. That number shows up on real coastlines too. Lewis Fry Richardson's measurements of Britain's west coast, published in 1961, behave like a curve with D about 1.25, which is the observation that launched Mandelbrot's 1967 paper "How Long Is the Coast of Britain?". Chapter 2 has the whole story.

1915 and 1916 · Holes all the way down

Sierpinski's triangle and carpet

Wacław Sierpiński described the triangle in 1915. Take a filled triangle. Join the midpoints of its sides; that cuts it into four smaller triangles, and you remove the one in the middle, upside down. Three remain, each half the size. Do the same to each of them. In the limit you have the Sierpinski triangle, sometimes called the gasket.

Each step keeps three quarters of the area, so after n steps the area is (3/4)ⁿ of the original, which goes to zero. Meanwhile the total length of all the triangle edges grows by 3/2 each step. In the limit you have a shape with no area and an infinite web of edges. Its dimension is log 3 / log 2 ≈ 1.585, comfortably between a curve and a surface.

A year later Sierpiński did the same thing with a square. Cut it into a 3 × 3 grid of nine smaller squares and remove the center one. Eight remain. Repeat on each. The limit is the Sierpinski carpet, with area (8/9)ⁿ → 0 and dimension log 8 / log 3 ≈ 1.8928. It is mostly hole, yet it is all one piece: you can travel from any point of it to any other without leaving it.

Sierpiński was not making art. The carpet answered a real question: is there one curve that contains a copy of every possible curve that can be drawn in the plane? He proved the carpet is such a "universal" plane curve. Any curve you can draw on paper, however tangled, can be found, suitably bent, inside the carpet.

Go deeper: the triangle hiding in Pascal's triangle

Write out Pascal's triangle, where each number is the sum of the two above it, and color the odd numbers dark and the even numbers light. The odd numbers draw a Sierpinski triangle, more detailed the more rows you write. That is because, reading the triangle modulo 2, a row is built from the one above by the same rule that builds the triangle's three copies from one: 2ⁿ rows contain three copies of the first 2ⁿ⁻¹ rows, with a block of even numbers in the middle.

The triangle also appears when you play the chaos game, the subject of Chapter 4: pick three corners, start anywhere, and repeatedly jump halfway toward a randomly chosen corner. The dots you leave can only land on the Sierpinski triangle, because each jump is exactly one of the three "shrink by half toward a corner" maps that build it.

Instrument 2

The iteration builder

Pick a monster and step the generation slider from 0 to 7. The picture is rebuilt from scratch with the real construction, and the readouts are computed from it: the number of pieces, how big each is, and the total length, area or volume. For the Koch shapes the length and area are measured from the drawn polygon itself. For the carpet the page also counts the pixels it painted. Watch which numbers race off to infinity and which collapse toward zero.

Pieces–
Piece size–
Total–
Boundary–
Dimension–
Estimate at this step–

1926 · The carpet in three dimensions

The Menger sponge

Karl Menger described the sponge in 1926. Take a solid cube and cut it into a 3 × 3 × 3 grid of 27 smaller cubes. Remove the one in the very center and the six in the centers of the faces. That leaves 20 cubes, a frame with a square tunnel bored through each pair of opposite faces. Do the same to each of the 20. Then to each of the 400. In the limit you have the Menger sponge.

Each step keeps 20 of 27 parts of the volume, so after n steps the volume is (20/27)ⁿ. That goes to zero: after 10 steps about 5% of the cube is left, after 30 steps about one part in 8,000. The surface does the opposite. Every new tunnel exposes fresh walls, and the surface area after n steps is 2 × (20/9)ⁿ + 4 × (8/9)ⁿ for a unit cube. The first term grows without limit, so the sponge ends up with infinite surface wrapped around zero volume.

Look straight at any face and you see a Sierpinski carpet; every face of the sponge is one. Cut the sponge along a diagonal and the cross-section is a pattern of six-pointed stars. Its dimension is log 20 / log 3 ≈ 2.7268, much closer to a solid than to a surface, even though it has no solid inside at all.

Menger was not decorating either. He was working on what it means for a space to be one-dimensional, and the sponge is the three-dimensional cousin of Sierpiński's result: it is a universal curve. Every curve, meaning every compact one-dimensional space, however tangled, can be bent to fit inside it. In Menger's sense the sponge is a curve, a one-dimensional object, that happens to need three dimensions to hold all its loops.

Vₙ = (20/27)ⁿ · Sₙ = 2 × (20/9)ⁿ + 4 × (8/9)ⁿ
Volume and surface area of the sponge after n steps, for a cube of side 1. At n = 0 they give 1 and 6, a plain cube. The volume shrinks by 20/27 each step; the surface eventually grows by about 20/9.
Go deeper: checking the surface formula by counting faces

The formula is easy to doubt, so the iteration builder checks it. For levels 0 to 3 it builds the sponge as a list of little cubes (1, 20, 400 and 8,000 of them), then counts every square face that is not glued to a neighbor, including the faces lining the tunnels. Divide that count by 9ⁿ, the area of one little face, and you get exactly the formula's 6, 8, 352/27 and 6,016/243.

Where do the two terms come from? Think of the sponge seen from each of the six directions. Looking along one axis, you see a Sierpinski carpet; the faces pointing that way add up to the carpet's area, (8/9)ⁿ, from each side. That accounts for 6 × (8/9)ⁿ of "outward" surface. The tunnels add walls that face sideways inside the sponge, and those grow like (20/9)ⁿ. Rearranged, the sum is the formula above.

1890 and 1891 · Lines that fill space

A curve that fills a square

Cantor had shown something unsettling in the 1870s: a line segment and a square contain the same number of points. You can pair them up one to one. But his pairing tears the line to shreds; nearby points on the line end up far apart in the square. In 1879 Eugen Netto proved that this is unavoidable: no pairing can be both one-to-one and continuous. You cannot lay a line over a square, without gaps or overlaps, without tearing it.

In 1890 Giuseppe Peano found out how close you can get. He dropped the "one-to-one" and kept "continuous", and wrote down a curve, a continuous path traced as time runs from 0 to 1, that passes through every single point of a square. His paper had no picture; it defined the curve by digits in base 3. The next year David Hilbert published a simpler version based on halving instead of thirding, and this time with a figure showing the first few stages.

The Hilbert curve is built from a U shape that visits the four quarters of a square in order. At the next stage each quarter gets its own smaller U, rotated or flipped so that the end of one meets the start of the next. Order n visits a 2ⁿ × 2ⁿ grid of cells, 4ⁿ in all, one after another, each step moving to an edge-neighbor. The limit, as n goes to infinity, is a continuous curve whose image is the entire filled square.

Because Netto's theorem still holds, the limit curve must hit some points more than once. It does: points where several cells meet are visited several times. That is the price of filling a square with a line.

Order n: 4ⁿ cells, path length (4ⁿ − 1) / 2ⁿ
Measured in units of the square's side. Order 7 already visits 16,384 cells along a path about 128 sides long; the limit path is infinitely long and its dimension is 2, the same as the square it fills.
Go deeper: why space-filling curves are useful

The Hilbert curve's best property is locality. Two moments close together in time are always at nearby points of the square. The reverse mostly holds too: most points close together in the square are visited at nearby times. Not always, since the curve has to cross from one quadrant to the next somewhere, and the tracer below shows how big those jumps can be.

That makes the curve a good way to turn two-dimensional data into a one-dimensional list while keeping neighbors near each other. Spatial databases use Hilbert ordering to store map data so that a query for a region reads mostly contiguous records, and image and scientific-computing code uses it to walk grids in a cache-friendly order.

Peano's own curve divides the square into 3 × 3 cells, visited in a snake pattern, and divides each cell the same way. His original definition is pure arithmetic: write the time t in base 3, split its digits into alternating x-digits and y-digits, and flip some of them depending on the digits before. Hans Sagan's book Space-Filling Curves works through both constructions in detail.

Instrument 3

The space-filling curve tracer

Choose a Hilbert order from 1 to 7 and press play. The path is generated cell by cell with the standard index-to-coordinates algorithm, and the page keeps a tally: which cells have been visited, how often, and whether any step was longer than one cell. Tap any cell to see its position along the curve and how far along the curve its grid neighbors are.

Cells–
Visited–
Path length (sides)–
Steps longer than one cell–
Tapped celltap a cell
Biggest jump to a grid neighbor–

Every step moves to an edge-neighbor, and when the path finishes every cell has been visited exactly once.

Side by side

The gallery, measured

Every monster follows the same recipe with different numbers. The dimension, log N / log r, decides which ordinary measurement blows up and which vanishes.

ShapeYearCopies N, scale rDimensionWhat happens in the limit
Cantor set18832, 30.6309Length (2/3)ⁿ → 0, yet uncountably many points
Peano curve18909, 32Fills the square
Hilbert curve18914, 22Fills the square; path length (4ⁿ − 1)/2ⁿ → ∞
Koch curve19044, 31.2619Length (4/3)ⁿ → ∞, no tangent anywhere
Koch snowflake1904edge: 4, 31.2619 (edge)Perimeter → ∞, area → 8/5 of the triangle
Sierpinski triangle19153, 21.585Area (3/4)ⁿ → 0, edge length (3/2)ⁿ → ∞
Sierpinski carpet19168, 31.8928Area (8/9)ⁿ → 0, still one connected piece
Menger sponge192620, 32.7268Volume (20/27)ⁿ → 0, surface → ∞
Go deeper: from monsters to models

The classic monsters are perfectly self-similar: every small piece is an exact, shrunken copy of the whole. Nature is rarely that tidy. A real coastline is only statistically self-similar: a small stretch looks like a big stretch in roughness, not in detail. Mandelbrot's step was to keep the dimension and drop the exact copying, which turns monsters into models. Randomized Koch curves look like coastlines; randomized midpoint subdivision makes convincing mountains, as the history chapter recounts.

The monsters also come back later in this book in disguise. The Sierpinski triangle is what the chaos game draws (Chapter 4). The Koch curve is an L-system with one rule (Chapter 5). And Cantor dust is what most Julia sets turn into when their parameter wanders outside the Mandelbrot set (Chapter 9).

Cheat sheet

Terms from this chapter

Self-similar
Made of smaller copies of itself. Exactly, for the classic monsters; statistically, for coastlines and clouds.
Generation
One application of the replacement rule. The fractal itself is the limit after infinitely many.
Similarity dimension
log N / log r, for a shape made of N copies each scaled down by r.
Cantor set
What survives removing middle thirds forever. No length, uncountably many points.
Koch curve
A segment with its middle third replaced by a tent, repeated forever. Infinite length, no tangent.
Koch snowflake
Three Koch curves around a triangle. Infinite perimeter, area 8/5 of the triangle.
Sierpinski triangle
A triangle with its middle quarter removed, repeated forever. Dimension about 1.585.
Sierpinski carpet
A square with its middle ninth removed, repeated forever. A universal plane curve.
Menger sponge
A cube keeping 20 of 27 sub-cubes, repeated forever. Zero volume, infinite surface.
Space-filling curve
A continuous curve that passes through every point of a square (or cube). Peano 1890, Hilbert 1891.
Locality
The property that nearby times on a curve are nearby points in space, and mostly the reverse.
Where this comes from

Sources