Dynamics

A dimension that is not a whole number

Cover a set with boxes of side ε and count how many are needed. For a line the count grows like 1/ε, for a region like 1/ε². For the Koch curve it grows like 1/ε to the power 1.26, and that exponent is as good a definition of dimension as the other two.

Worth reading first: The rectangle that eats itself · Almost none of it left, and still uncountably many.

Cover a straight segment of length 1 with boxes of side ε\varepsilon. About 1/ε1/\varepsilon of them are needed. Cover a unit square and about 1/ε21/\varepsilon^2 are needed. The exponent is the dimension, and stated that way the definition is available to any set at all — including sets for which “how many directions can be moved in” has no answer.

the Koch curve, after 5 steps. the Koch curve drawn from its own rule: replace the middle third of every segment with two sides of a triangle.
Fig. 1 The Koch curve after five rounds of replacing every segment’s middle third with two sides of a triangle. Each round multiplies the number of pieces by four and divides their size by three, so covering it at scale 3k3^{-k} needs about 4k4^k boxes — and log4/log3=1.2619\log 4/\log 3 = 1.2619 is the exponent that relates the two.

The curve is not a line and not a region. Its length is infinite — each round multiplies it by 4/34/3 — and its area is zero. Both of the usual measurements return an unhelpful answer, and the box count returns 1.2619.

The definition, and what it needs

For a bounded set SS, let N(ε)N(\varepsilon) be the number of boxes of a grid of side ε\varepsilon that meet SS. The box dimension is

dimBS=limε0logN(ε)log(1/ε),\dim_B S = \lim_{\varepsilon \to 0} \frac{\log N(\varepsilon)}{\log(1/\varepsilon)},

when the limit exists. For a segment it gives 1, for a square 2, for a finite set of points 0.

Two things about the definition matter and are easy to skip past. It is a limit, so no finite computation determines it — every number in this essay is an approximation over a stated range of scales, and the figures say which range. And it depends on the set only through how it fills space at small scales; two sets that look nothing alike can share a dimension, and a set’s dimension says nothing about whether it is connected, or a curve, or anything else.

the Koch curve in boxes of side 0.037. A set with a grid of boxes laid over it, every box containing part of the set shaded, and the number of such boxes counted.
Fig. 2 The Koch curve covered by boxes of side 0.037, with the 68 that contain part of it shaded. The rule predicts 64 at this depth, and the count is 68 because the curve doubles back through boxes the count of pieces does not distinguish. The difference is the sort of thing that vanishes in the limit and does not vanish in a drawing.

The rule, and the number it forces

For a set built by repeatedly replacing a piece with mm copies of itself scaled by rr, there is a second and much easier route to the same exponent. At scale rkr^k the set consists of mkm^k pieces each of that size, so N(rk)mkN(r^k) \approx m^k, and

dim=logmlog(1/r).\dim = \frac{\log m}{\log(1/r)}.

This is the similarity dimension, and it comes from the construction rather than from any counting. The Koch curve has m=4m = 4, r=1/3r = 1/3; the Cantor set has m=2m = 2, r=1/3r = 1/3; the Sierpinski triangle has m=3m = 3, r=1/2r = 1/2; the Sierpinski carpet has m=8m = 8, r=1/3r = 1/3.

the middle-thirds Cantor set, after 5 steps. the middle-thirds Cantor set drawn from its own rule: throw away the middle third of every interval, for ever.
Fig. 3 The middle-thirds Cantor set at five depths, each row showing what survives one more round of discarding. Two pieces at a third the size gives log2/log3=0.6309\log 2/\log 3 = 0.6309 — between a point and a line, which is exactly what the set is: uncountably many points and no interval anywhere.

The Cantor set’s dimension being strictly between 0 and 1 is worth dwelling on, because it is the cleanest case of the definition doing something the older notions cannot. Almost none of it left, and still uncountably many shows that the set has measure zero — the discarded intervals account for the whole of [0,1][0,1] — and has as many points as the interval it came from. Measure says “nothing”; cardinality says “everything”; the box count says 0.6309, and of the three that is the one that distinguishes it from the rationals, which also have measure zero and are countable but have box dimension 1.

The two numbers, put against each other

The similarity dimension is derived from a rule and the box dimension is measured by counting. When both are available they should agree, and requiring them to agree is a test with teeth.

Box counts against box size, on logarithmic axes. For each set, the logarithm of the number of occupied boxes plotted against the logarithm of one over the box size, with a straight line fitted and its slope reported.
Fig. 4 Box counts against box size on logarithmic axes for three sets. A straight line here is what having a dimension means, and its slope is the dimension. The Cantor set’s counts are exactly 2k2^k, so its slope is exact; the Koch curve’s last step reads 1.274 against 1.262, and its fitted line reads 1.223 because the coarse end of the range is not yet the set.

The gap between the fitted slope and the true value is the honest part of the picture. Fitting a line through all the counts weights the coarse boxes equally with the fine ones, and at the coarse end a set five rounds into its construction is not the set — the Koch curve at scale 1/31/3 is barely distinguishable from a segment, and the count reflects that.

Taking the ratio of one count to the previous one gives a much better estimate, because it is a local slope at the fine end. That is what the figures report as “the last step”.

Dimension from the rule, and dimension from the count. A table of five sets with the dimension their construction rule forces and the dimension obtained by counting occupied boxes at shrinking sizes.
Fig. 5 Five sets with the dimension their rule forces against the dimension the counting finds. Two of them agree exactly: the Cantor set and the carpet are unions of pieces that line up with the grid, so the count really is 2k2^k and 8k8^k. The Sierpinski triangle’s pieces are not axis-aligned and its estimate approaches from above.

That the two exactly-agreeing rows are the two aligned with the grid is not a coincidence about those sets; it is a fact about the grid. Box counting is a measurement made with a particular ruler, and a set whose structure happens to match the ruler is measured perfectly at every scale, while one that does not is measured with an error that only vanishes in the limit.

Where the rule runs out

None of the above applies to a set with no construction rule, and those are the interesting ones.

the Sierpinski triangle, after 6 steps. the Sierpinski triangle drawn from its own rule: three half-size copies at the corners, the middle left out.
Fig. 6 The Sierpinski triangle after six rounds: three half-size copies at the corners with the middle left out, 36=7293^6 = 729 pieces. Its similarity dimension is log3/log2=1.5850\log 3/\log 2 = 1.5850; its box count, on an axis-aligned grid the triangle’s pieces do not line up with, closes on that from above.

The Hénon attractor is the orbit of x11.4x2+yx \mapsto 1 - 1.4x^2 + y, y0.3xy \mapsto 0.3x, and it is not built by copying anything. It has a visible fine structure — a set of curves that, magnified, turn out to be more curves — but no rule says how many or at what scale.

the Hénon attractor, after 5 steps. the Hénon attractor drawn from its own rule: the orbit of x ↦ 1 − 1.4x² + y, y ↦ 0.3x, which obeys no self-similar rule.
Fig. 7 Thirty thousand points of one orbit of the Hénon map. There is no self-similar rule behind this: the bands are produced by a stretching-and-folding that repeats, and the picture at any magnification is similar to but not a copy of the picture at another.

For this set the box count is not a check on anything — it is the definition, and the only definition available. Over the range of scales computed it gives about 1.24, which is between a curve and a region and is consistent with what the picture suggests: a set that is locally a stack of curves, so more than one-dimensional, and nowhere filling an area.

That is where the whole subject earns its place. A definition that only works on sets built by a rule is a definition of the rule, and the reason to define dimension by counting is that the counting can be done on anything — including the attractor of a system nobody designed. Two lobes and no cycle draws the Lorenz attractor, whose dimension is about 2.06 and is known only by this kind of measurement.

Where the definition disagrees with itself

Box dimension is one of several definitions and they do not always agree.

Hausdorff dimension is the older and more delicate one: instead of a grid of equal boxes it allows covers by sets of varying size, and takes an infimum. It is always at most the box dimension and is sometimes strictly less. For every set in this essay the two agree; for the rationals in [0,1][0,1] the Hausdorff dimension is 0 — a countable set is a countable union of points, each of dimension 0 — while the box dimension is 1, because any grid box containing a rational meets the set and every box does.

That disagreement is instructive rather than a defect. Box counting is a measurement of a set’s closure, since a box meeting a set meets its closure and conversely; the rationals and the whole interval have the same closure, so no grid can tell them apart. Hausdorff dimension can, at the cost of being far harder to compute — there is no algorithm, and for most sets of interest the value is known only by proving upper and lower bounds separately.

Upper and lower box dimension differ when the limit does not exist, which happens for sets whose structure at scale ε\varepsilon oscillates as ε\varepsilon shrinks. Such sets can be built deliberately and rarely arise otherwise.

What a fractional dimension does not mean

Three things are commonly read into a non-integer dimension and none of them follows.

It does not mean the set is complicated to describe. The Cantor set is specified in one sentence and every point of it is named by an infinite sequence of two symbols. Its description is shorter than that of a circle.

It does not mean the set is self-similar. Self-similar sets are the ones where the dimension is easy to compute, which is why they dominate the examples. The Hénon attractor is not self-similar and has a dimension; a generic set has a dimension and no structure at all.

And it does not mean the set is a curve of infinite length. The staircase that is not the diagonal is a sequence of curves whose lengths do not converge to the limit’s length, and every one of those staircases has dimension 1. Infinite length and fractional dimension are different pathologies that happen to co-occur in the Koch curve.

Measuring a thing whose length is infinite

There is a practical version of all this that predates the theory and explains why anybody cared.

Measure a coastline with a ruler of length \ell by walking along it, and the total comes out as \ell times the number of steps. Halve the ruler and the total does not stay the same — it grows, because the shorter ruler follows inlets the longer one stepped across. Richardson measured this for several national borders in the 1950s and found the total obeying a power law: length 1D\propto \ell^{1-D} with DD between 1 and 1.3 depending on the coast.

That DD is the box dimension, arrived at by a different measurement. A ruler of length \ell walked along a set is close enough to a cover by boxes of side \ell that the exponents agree, and the reason a coastline has no length is the reason the Koch curve has none: the count of steps grows faster than 1/1/\ell, so the product does not settle.

The lesson generalises past coastlines. A quantity that depends on the resolution it is measured at is not a property of the object; what is a property of the object is how the quantity depends on the resolution. Length is the wrong measurement for these sets and the exponent is the right one — which is not a claim that lengths are unreal, but that this particular set does not have one.

the Sierpinski carpet, after 4 steps. the Sierpinski carpet drawn from its own rule: nine ninths of a square, with the middle one taken away.
Fig. 8 The Sierpinski carpet after four rounds: eight of every nine squares kept, 84=40968^4 = 4096 of them. Its dimension is log8/log3=1.8928\log 8/\log 3 = 1.8928, close to 2 and definitely not 2 — the set has zero area, since (8/9)k0(8/9)^k \to 0, while filling the plane densely enough that no disc avoids it entirely.

The carpet is the case that makes “close to two” concrete. Its area is zero and its dimension is 1.89, so a set can be arbitrarily close to two-dimensional and still be measurably nothing. Dimension and measure are answering different questions, and the exponent is the finer instrument of the two.

Where it came from

Hausdorff introduced his dimension in 1918, in a paper about measure, and it sat as a technical device for half a century. Besicovitch developed it through the 1920s and 1930s into a real theory of what he called sets of fractional dimension, and the subject was regarded as a corner of measure theory.

Mandelbrot gave it a name and an audience in the 1960s and 1970s, and the word “fractal” is his, coined in 1975 from fractus. His contribution was not a theorem but a claim about relevance: that sets of this kind are the rule rather than the exception, and that coastlines, turbulence and price series are better described by an exponent than by a length. The shape in every picture of itself is the object that made the claim visible to everybody at once.

The box-counting definition is older than the popularisation and independent of it, having been used by Kolmogorov and others under the name metric entropy — a reminder that the measurement was in place well before there was a reason to make it famous.

What the pictures cannot show

Every set here is drawn at a finite depth and every count is made on that drawing. The Koch curve at depth five has 1,024 segments, and below that scale the drawing is a polygon rather than a fractal — so a box count at a scale finer than the drawing measures the drawing. The figures choose the depth from the smallest box asked for, and assert the relation, but no picture can be the limit.

The reported dimensions are therefore estimates over a stated range of scales, five or six box sizes wide. That is a narrow range by the standards of the definition, which is about ε0\varepsilon \to 0, and the two sets whose counts are exact are exact by an alignment rather than because the range was wide.

And the Hénon attractor’s orbit is a hundred and twenty thousand points, which is a sample of an infinite set. Boxes the true attractor meets but that no sampled point landed in are counted as empty, so the count is an undercount, and the effect grows as the boxes shrink. The measurement stops at the scale where that would start to bite.

The ladder from here

Below: the rectangle that eats itself, self-similarity in its simplest form, and almost none of it left, and still uncountably many, which builds the Cantor set and measures it a different way. Sideways: two lobes and no cycle, an attractor whose dimension is known only by counting, and a curve with a corner at every point, a curve of dimension 1 with none of the smoothness that usually goes with it. Above: Hausdorff dimension and its measure, the dimension of Julia sets, multifractal spectra, and the Kaplan–Yorke formula relating an attractor’s dimension to its Lyapunov exponents.

What is worth carrying away

Dimension was a count of directions, and counting boxes gives the same answer for the sets where the old notion applies. Having agreed there, the new definition keeps working where the old one has nothing to say — and returns a number that is not a whole number, which is the sign that the extension is doing work rather than repackaging.

The number itself is a growth rate, and that is the way to hold it. It says how fast the effort of covering the set grows as the ruler shrinks, and nothing else. How fast two orbits part measures a different growth rate on a related object, and the two are connected by a formula that is beyond this rung. A great deal of what looks like geometry in this subject is an exponent in disguise.