🧵

I did promise to tell about my BSc thesis topic one day. So get ready for a thread on... fractals! Along the way we'll also meet measure theory, a bit of function theory and several bad jokes.

I'll try to keep this as accessible as possible, even though I'll use some maths terminology. Feel free to ask if something is unclear! If the LaTeX equations do not render correctly for you, try opening the thread on mathstodon.xyz.

This is going to be a long thread, so let's get started!

🧵

First off, what is a fractal? There isn't really a precise definition, but often fractals are sets that
• don't play by the rules of classical geometry,
• look pretty much the same regardless of how much you zoom in,
• are generated by a recursive procedure.

The Mandelbrot set is the poster child of fractals. I'm not going to touch it, though. The Mandelbrot set involves complex numbers; I'd rather stick with basic geometry.

🧵

Instead, I'll pose you a question: How long is the coastline of [your preferred non-landlocked country here]?

I'll use mainland Finland as an example, for some local flavour.

I fired up a measurement tool (map.meurisse.org), clicked around for a while and got 1040 kilometres.

🧵

Hold on a second. The lines I drew don't follow the coastline, like, at all. It might have something to do with the fact that the coast is not composed of 80-kilometre-long straight lines.

So let's do it again, with the points closer to each other. This time I get 1180 kilometres.

🧵

The visual or geographical among you may observe that I still missed quite a few bays and peninsulas.

Fine, let's measure it once more. It's not like I have anything more interesting to do than click on a map. With the points placed 5 kilometres apart, I get a total length of 1870 kilometres.

🧵

You probably see a pattern here. As the precision increases, so does the result. This is because every measurement always misses a bay there or a rock there.

To get a precise result, I should freeze the sea and measure around every grain of sand. No, around every molecule on those grains!

Ignoring the apparent finiteness of our physical world, you could say that the coastline is actually infinitely long.

🧵

The features of the coastline look roughly the same at different scales, and it has infinite length despite seeming like it shouldn't have. These are precisely the things you would expect from a fractal. Thus, with only a bit of mathematical hand-waving, we can say that coastlines are fractals! Think about it the next time you go on a beach.

🧵

Another example, shall we?

Take a square, with sides one unit long. Divide it into nine squares in a 3x3 grid. Then punch out the central square (to be precise, keeping the edges in place) and recycle it according to your local guidelines.

Now you have eight squares. Divide each of those into nine squares and remove the centre one. Continue doing this until you reach infinity.

🧵

This set is known as the Sierpinski carpet. It's not really a good fit for your living room, since it is full of holes and has zero area, thus making the price per square metre awful.

Jokes aside, we've got another fractal. This time it is seemingly two-dimensional, yet has zero area. After the first iteration, the area is $$8/9$$, after the second, $$(8/9)^2$$, and so on. With each iteration, the exponent grows by one.

🧵

One more example.

Take a unit line segment, and do the same thing as for the (unfortunate) carpet. Cut the line into thirds, throw out the middle segment, and repeat. You should again leave the endpoints in place.

The result is called a Cantor set. It's fascinating in its own right: It is composed of disconnected points (the endpoints of the line segments). Despite this, there are still as many points as in the original interval! Things go weird at infinity.

🧵

What's important for our discussion is that the Cantor set has zero length. Not a huge surprise, since we're talking about a bunch of disconnected points. What's odd is that this bunch is uncountably infinite. It is "as large" as the unit interval, yet the two do not have the same "measure".

Enough with the examples for now. We have three geometrical objects where "length" or "area" do not work as expected. Let's find out why.

🧵

In the last toot, I used the word "measure" for a reason. When we talk about length or area or volume or whatever higher-dimensional analogue, we actually talk about the n-dimensional Lebesgue measure.

Skipping the boring details, a measure is a function that takes a set and tells how large it is. In everyday life, we use practically two:
• the "how many apples are in the basket" measure, AKA the counting measure,
• the Lebesgue measure.

We are going to define a third one.

🧵

If you double the length of a line, the length, well, becomes twice as large.

If you double the side length of a square, the area becomes four times as large.

If you double the side length of a cube, the volume becomes eight times as large.

So, in $$n$$ dimensions, doubling the side makes the Lebesgue measure $$2^n$$ times as large.

What if $$n$$ wasn't an integer?

🧵

Technically speaking, the Lebesgue measure works by "covering" the set in question. At school, you might have estimated the area of something by counting the number of squares it takes on notebook paper. These squares cover the set, and you know how to calculate the total area of some squares. Then you just try out all the possible ways to cover the set with various squares, and say that the least area (technically, the infimum) is the area of the set.

🧵

Now instead of squares we use arbitrary sets, and instead of area we consider the diameters of those sets raised to $$n$$. Then we start making those covering sets smaller. The measurement becomes more and more precise... and we land on the exact value, if $$n$$ happens to match the dimension of the set.

🧵

Let's look back at our Sierpinski carpet example.

You can cover the carpet with one unit square (diameter $$\sqrt 2$$). You can also cover it with eight squares with side length $$1/3$$, or sixty-four squares with side length $$1/9$$. In general, if the squares have side length $$1/3^m$$, the sum of diameters (raised to $$n$$) is
$\sqrt 2 \cdot 8^m \cdot \left(\frac{1}{3^m}\right)^n.$

What happens when $$m \to \infty$$?

🧵

You can rewrite the sum as
$\sqrt 2 \cdot \left(\frac{8}{3^n}\right)^m,$
and then it becomes evident that if the thing within parentheses is at most one, the sum does not blow up. Solving that, you get that $$n \geq \log(8)/\log(3) \approx 1.89$$.

It turns out that the Sierpinski carpet is approximately 1.89-dimensional!

🧵

This "raise diameters to n, then sum them" measure is called the Hausdorff measure. It turns out that the Hausdorff measure of a set is infinite when the dimension is too small – think about the area of a cube – and zero when too large – think about the volume of a square. The threshold is called the Hausdorff dimension.

The Sierpinski carpet is not "dense" enough to have area, but it's still "almost" two-dimensional. Hausdorff dimension captures this nuance.

🧵

Coastlines are usually 1.1 to 1.3 -dimensional, and the Cantor set is about 0.63-dimensional (you can work this out by modifying the calculation above).

Wikipedia has an excellent collection of examples at en.wikipedia.org/wiki/List_of_

🧵

As an aside, we don't really care about the Hausdorff measure here, just the dimension.

When we calculated the dimension of the Sierpinski carpet, we only got an upper bound. To get equality, we also need a lower bound. In general this is difficult, but there is a theorem for these kinds of self-similar sets with regular structure. Don't ask me about the proof, though. The measure theory involved is at high MSc level.

🧵

@petrilaarne Hi Petri, great introduction. I did a bit of this around 2000 to study clouds, for which fractals are a reasonable approximation. I hope it did not die afterwards.

I could not see the equations, also not going to the mathstodon server. Do I need any software myself, some MathJax add-on?

🧵

@VictorVenema Thanks! I too have some trouble seeing the equations. I guess I’ve made some silly mistake, or MathJax is misbehaving. I saw some rendered, then not rendered after a refresh, suggesting the latter. @christianp?

🧵

@petrilaarne @VictorVenema yeah, I need to look into it. Something's up, that's for sure The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!