**NOTE: I am currently doing freelance consulting work for machine learning solutions. For all enquires please contact me at george(dot)m(dot)dallas@gmail(dot)com (replace (dot) with a . – this is to prevent spam bots)**

Fractal geometry is a field of maths born in the 1970’s and mainly developed by Benoit Mandelbrot. If you’ve already heard of fractals, you’ve probably seen the picture below. It’s called the Mandelbrot Set and is an example of a fractal shape.

The geometry that you learnt in school was about how to make shapes; fractal geometry is no different. While the shapes that you learnt in classical geometry were ‘smooth’, such as a circle or a triangle, the shapes that come out of fractal geometry are ‘rough’ and infinitely complex. However fractal geometry is still about making shapes, measuring shapes and defining shapes, just like school.

There are two reasons why you should care about fractal geometry:

1. The process by which shapes are made in fractal geometry is amazingly simple yet completely different to classical geometry. While classical geometry uses formulas to define a shape, fractal geometry uses **iteration**. It therefore breaks away from giants such as Pythagoras, Plato and Euclid and heads in another direction. Classical geometry has enjoyed over 2000 years of scrutinisation, Fractal geometry has enjoyed only 40.

2. The shapes that come out of fractal geometry **look like nature. **This is an amazing fact that is hard to ignore. As we all know, there are no perfect circles in nature and no perfect squares. Not only that, but when you look at trees or mountains or river systems they don’t resemble any shapes one is used to in maths. However with simple formulas iterated multiple times, fractal geometry can model these natural phenomena with alarming accuracy. If you can use simple maths to make things look like the world, you know you’re onto a winner. Fractal geometry does this with ease.

This blog post shall give a quick overview of how to make fractal shapes and show how these shapes can resemble nature. It shall then go on to talk about dimensionality, which is a cool way to measure fractals. It ends by discussing how fractal geometry is also beneficial because randomness can be introduced into the structure of a fractal shape. The post requires almost no maths and includes lot of pretty pictures

## How to make a fractal shape

In normal geometry shapes are defined by a set of rules and definitions. For instance a triangle consists of three straight lines that are connected. The rules are that if you have the length of all three sides of the triangle it is completely defined, also if you have the length of one side and two corresponding angles the triangle is also defined. Though the rules defining a triangle are simple, huge amounts of useful maths has come out of it, for instance Pythagoras’ Theorum, sin() cos() and tan(), the proof that the shortest distance between two points is a straight line, etc.

Fractal geometry also defines shapes by rules, however these rules are different to the ones in classical geometry. In fractal geometry a shape is made in two steps: first by making a rule about how to change a certain (usually classically geometric) shape. This rule is then applied to the shape again and again, until infinity. In maths when you change something it is usually called a function, so what happens is that a function is applied to a shape recursively, like the diagram below.

After it has repeated an infinite amount of times, the fractal shape is produced. What are these functions then? What do you mean by repeating infinitely? As always, this is best explained by an example…

A good fractal shape is called the von Koch curve. The rules, or function, are extremely simple. First you start with a straight line. This is your ‘initial shape’:

The rules are as follows:

1. Split every straight line into 3 equal segments.

2. Replace the middle segment with an equilateral triangle, and remove the side of the triangle corresponding to the initial straight line.

The process is shown in the figure below:

This is what happens to the straight line, our initial shape, when it goes through the function the first time, the first iteration. Now, the shape it has produced is fed back into the function again for a second iteration:

Remember the rule was that any straight line would be split into thirds, so now 4 lines are split up and made into triangles. The shape that is produced after the second iteration is then fed through the function for a third time. This gets hard to draw in MS paint so I’ve used a couple of pictures from this website for the next few stages:

After this has iterated an infinite amount of times the fractal shape is defined. This may sound bewildering but it is still possible to analyse it mathematically and visually you can see what the shape starts to look like. The gif below (from Wikipedia) is a good illustration of what the curve looks like by zooming in on it:

The von Koch curve is a great example of a fractal: the rule you apply is simple, yet it results in such a complex shape. This kind of shape is impossible to define using conventional maths, yet so easy to define using fractal geometry.

So who cares about the von Koch curve? Isn’t it just mathematicians wasting time on weird shapes? I guess that depends on how you look at it, but I’m convinced it’s useful because it looks exactly like a snowflake. This is made more clear if the initial shape you start with is a triangle rather than a straight line:

There’s a whole debate to be had on the purpose of maths, but as an Engineer I am inclined to say that one of its purposes is to try and replicate the world around us. The shapes that come out of fractal maths are so different to conventional mathematical shapes and so similar to the world around us that I cannot help but be seduced by this topic. Two other shapes that are favorites of mine are the Barnsley Fern:

And fractal trees:

These aren’t drawings or pictures, but mathematical shapes. If you look at the shapes you can see what function repeats itself. For instance on the Barsley Fern the function is to draw 30 or so perpendicular lines out of each straight line. The function repeats itself to and looks like a fern. On the tree you can see that each line branches out twice, which will be the function that repeats itself. Another property about these shapes (though strictly not for all fractals) is that they are** self-similar. **This means that the shape looks like itself however much you zoom in or out. For instance on the tree above, if you snapped a branch off it and stood it up, it would look like the original tree. If you took a twig from the branch and stood it up, it would still look like the original tree. Again, this is a property that occurs in nature, but until fractal geometry there was not a good way to put it into maths.

Not only do these shapes look like natural objects, but the process of iteration sounds intuitive when thinking about nature. When a tree is growing, its trunk will create branches, these branches create further branches, these branches create twigs. It’s as if the function is a genetic code telling the branch how to grow and repeat itself, eventually creating shapes that are ‘natural’. This may sound like pseudo-science (it definitely is) but I think these are concepts worth considering when you are able to imitate nature so closely.

Right enough about nature, time to talk about how fractals have crazy dimensions.

## Dimensions

So now we know what fractal shapes are and how to make them, we would like to know a few things about them. One of them first things to try and figure out is the length of some of these shapes. Let’s go back to the von Koch curve.

In order to figure out how long the full von Koch curve is (after being iterated an infinite amount of times), it is useful to consider what happens at the first stage again:

The line is split into three, then the middle section is replaced by two lines that are as long as it (as it’s an equal triangle). So if the original straight line had a length of 1, the length of the curve after the first iteration is 4/3. It turns out that every time you iterate the shape, it gets 4/3 longer. So the length of the curve after the second iteration is 4/3 x 4/3 = 16/9:

As 4/3 is greater than 1, the line gets longer every time it is iterated through the function. As you iterate the function an infinite amount of times, the full von Koch curve has a perimeter that is infinitely long! This is the case for all fractal shapes: they have infinitely long perimeters. That isn’t useful for mathematicians so they don’t measure the perimeter of the shape. Now the next few paragraphs require a bit of abstract thought, but if you think a bit outside the box it does make sense.

The perimeter measures the length around something. Length is a 1 dimensional measure of space. Length is 1D because it only measures a straight line. A 2D measure of space is area, 3D is volume. Now we’ve shown that it isn’t useful to measure fractal patterns in 1 dimension as they are infinitely long, but what is odd is that fractal shapes are not 1D, 2D, or 3D. Each fractal shape has it’s own unique dimension, which is usually a number with a decimal place.

The dimension of a fractal shape is a measure of how quickly the shape becomes complicated when you are iterating it. What do we mean by becoming complicated? Well in the von Koch curve you can see that the first few iterations produce quite simple shapes, however at about iteration 4 it starts to become quite small and complex.

The way to measure how fast a shape becomes complicated, and hence its dimension, is to measure how much longer the perimeter gets after each iteration. This makes sense intuitively, as if the line gets much longer after each iteration it is probably becoming very complicated very fast, whereas if the line stays pretty much the same length after each iteration then it probably isn’t getting very complex.

As we’ve already shown, the von Koch curve gets 4/3 longer each iteration. This means that the von Koch curve is 4/3 D, or 1.3333…D. Pretty crazy right? It exists somewhere between 1D and 2D. But this measure is really useful to mathematicians as it gives information about the shape (whereas perimeter doesn’t, it’s always infinite). For instance if there was another fractal shape which was 1.93D, you could say with confidence that that shape gets complex quicker than the von Koch curve, as the perimeter gets 1.93 times longer after each iteration rather than 1.3333, implying it gets complex more quickly. When studying a fractal shape, knowing its dimension is of integral importance.

## Randomness

The last thing I’m going to talk about is the fact that randomness can be inserted into fractal shapes. Random (or seemingly random) events occur in nature all the time and affect different things in a variety of different ways, for instance a large part of Information Engineering is dealing with noise, which randomly fluctuates an electronic signal. When trying to replicate this, you usually add randomness on top of a signal. For instance in electronics you would create a nice sine wave and then add noise on top of it (borrowed from this website):

The bottom image is the ‘pure’ wave, and the top image is the wave with noise added on. An inherent assumption when doing this is that there is an underlying ‘pure’ signal which is randomly altered. While this may be true for a lot of electronics, the same cannot be said for nature. Often there isn’t a ‘pure’ shape that is randomly altered around the edges (for instance there are not many fuzzy squares in nature), but rather randomness effects the structure of the shape itself at each stage of its evolution. Classical geometry is not good at incorporating randomness into shapes, whereas fractal geometry can do it easily. For the last time lets turn to the von Koch curve. However this time we will insert randomness into it.

We know the rule is that for each iteration a triangle is created in the middle third of a line. However every time the triangles always faced ‘outwards’. We could insert randomness by saying that for each triangle created, it goes either above the line or below the line depending on a coin toss:

Now the shape will develop at random according to the coin toss. For instance after multiple iterations the von Koch curve can look like this:

Or it can look completely different. What is cool about this is that you can insert randomness into the shape itself rather than adding it on top of an existing shape. This has exciting potential, for instance (going back to nature) this may be a good way to model random genetic mutations.

This blog post has provided a brief introduction to fractal geometry. I hope you’ve found it interesting!

If you like this blog and think that I would work well in your company a copy of my CV can be found by following this link. I am available for employment from August 2014.

Feel free to email me at george.m.dallas@gmail.com

Excellent post George and a very good explanation of the subject. I will follow your work.

Thanks Ken, I appreciate it

This is the case for all fractal shapes: they have infinitely long perimeters. That isn’t useful for useful for mathematicians so they don’t measure the perimeter of the shape.

missing words here but otherwise great read.

Edited, thanks!

Ever since I discovered the field of fractal geometry years ago, they have interested me. I really enjoyed your article; I wish more people would write about fractals, they are so interesting, I just wish there was more to read about.

This was once upon a time a very popular phenomenon! Computer magazines with free CDs in them used to have fractal making software back in the 90s! Can you beat that?!!

Also, look up “Iterated Function System”

Great post. Love it.

On a side note, I would be obliged if you could also check out my blog DoubleThink. I’ll drop its link below!

“DoubleThink is an up and coming blog that is extremely satisfying for every kind of a person, be it the thinker, the optimist, the pessimist, the poet, the musician, the couch-potato, the bookworm or the photographer.We are a bunch of people with different backgrounds, contradictory opinions but one voice. And this blog is our voice.”

Come hear us at :

http://doublethinkhub.wordpress.com/

Thanks for the Blog. I have been interested in fractals for quite a while but never understanding them. I had the sense that they were a math that could be used to replicate a natural item (eg: one equation = one natural item (eg; tree) so one could communicate/publish a mathematical equation or description and anyone could replicate the image. If this is true, it would be interesting to see what some of these equations are, for example a tree in my back yard or the shape of the coastline from Boston to New York, again math used to “describe” nature. I suspect randomness is necessary to do this but then I don’t think you would get repeatable results… Thanks again for the effort to illuminate this topic.

Thank you for explaining fractals in such a simple way.. The animated diagrams really helped convey the seemingly complexity is in fact simple. I’ve always loved the beauty of fractals and knew there was math behind them but always thought it was too complicated for me to understand much less explain to another person. Now I understand and can share some basic information about them. Thank you.

Reblogged this on fullaffiliate.

Interesting read! Thanks, George.

Thanks for this interesting and easy to follow explanation!

you ruined it for me when you stated that it gets 4/3 longer after each iteration. it in fact gets only 1/3 longer. it becomes 4/3 of its original length would be the other way to say it.

Reblogged this on prior probability and commented:

We are reblogging this fascinating post on the logic of fractals; notice the role that randomness plays in the geometry of fractals …

Hey there I am adding a link to this blog on my blog entry and i was hoping this was ok. If not I can remove this any instance you want.

Lovely post by the way. This really good introduction for anyone who is new to the concept.

This served as my very first introduction to Fractals, and I’m already hooked! Thanks for making it so simple and still accurate! *thumbs up*

hi, Isnt it reverse of ‘fourier series’ where fourier says every shape can be decomposed into simple sine waves? here you are taking a simple shape and composing into a complex shape..I see similarities to fourier series.

I saw humor in this statement:

“When studying a fractal shape, knowing its dimension is of integral importance.”

“Integral” can mean described by an integer (instead of essential or fundamental)… which is an interesting play on words since the dimension is fractional and *not* and integer. 🙂

Great explanation, but you didn’t mention snowflakes. They are fractal-shaped and occur in nature.

Great post!

I wrote a gentle guide explaining the ideas behind the Mandelbrot fractal… and how to make your own with Python.

It’s really aimed at anyone who isn’t already and expert – so avoids jargon and uses a plain English tone.

https://www.amazon.co.uk/gp/product/B01EET6WUE

amazing exaplanation,but i wish to know about hilberts curve too

Is the dimension of the fractal it’s derivative?

I love the animated Koch curve!

Here’s how you can create the famous Mandelbrot set with just 25 lines of code: http://slicker.me/fractals/fractals.htm

Outstanding and explained simply and entertaining

Broski0128

Really helpful for a mathematician. Thank.

So … two lines of different lengths can both be infinitely long. Infinity doesn’t necessarily = itself. Love it! This is an outstanding explanation for any newcomer to the subject. Thanks!

Topic new to me but logically expressed and easy to follow. May have infinite possibilities in graphics. It’s something like mutation and life form itself when viewed from a macro level.

I was hoping you would go into more detail on the use of fractals in electronic noise!

Great information, thank you!

Here’s an easy fractal tutorial for Javascript developers:

http://slicker.me/fractals/fractals.htm

(Mandelbrot in only 25 lines of code)

Thank you, I really enjoyed this!

I remember the huge fuss over fractals in the 90’s. One of my fellow engineers asked me to go to a conference and presentation on them and I politely declined. I said, yes they are interesting shapes and mathematical marvels, but I bet they won’t have contributed anything of note to mathematics or science in 30 years time.

And here we nearly 30 years on and they are still only pretty shapes. Fractals are the Y2k bug of the 90’s. Hype about nothing.

thank you so much for a very simple and clear explanation! 🙂

Great!

i care about fractals too bro 😡

very nice, I love fractals!!