# Mandelbrot sets

Today I was reading an interview on New Scientist with Benoit Mandelbrot, a famous mathematician and founder of a branch of mathematics known as fractal geometry. Almost everybody will recognize a picture of the so-called Mandelbrot set (below), but probably very few are familiar with exactly what it is or how it comes about. In this post I hope to provide a very layman’s description of how the Mandelbrot set is constructed. First, however, I must explain what a complex number is, something which some will be familiar with, but others not.

The normal numbers that we deal with every day are the so-called real numbers and can be represented on the number line, which ranges from negative infinity in one direction to positive infinity in the other. Real numbers suffice for most things that we’ll ever want to do with numbers, however there are some limitations on what can be done with real numbers. In particular, it had long bothered mathematicians that there was no solution to the simple question ‘what is the square root of -1?‘. In fact, using real numbers there simply is no answer to this question (let me know if you think of one). In recognition that there is no numerical answer to this question, mathematicians decided to simply give it a label. And so the square root of -1 was labeled i. What’s the point you ask? Well the point is that by introducing this label we can proceed to solve problems which we otherwise would have thrown out the window. A complex number is simply a number which contains a real component, which we’ll call a, and some multiple of i, which we’ll call b, often referred to as the imaginary component. Technically, we can say that a complex number can be expressed in the form a+ib, where a and b are both real numbers. Unlike the real numbers, which can be represented on the number line, a complex number is 2-dimensional and must instead be expressed on a plane, called the complex plane, where the real component is one axis of the plane and the imaginary component the other. We can do with complex numbers all the sorts of things that we can do with ordinary numbers, like addition, subtraction, multiplication and division, all using standard algebraic rules.

The Mandelbrot set is constructed in the complex plane. We start by choosing a point on the complex plane (i.e. a complex number), which we label c. We introduce another complex number, z, which we initially set to zero. We then repeatedely apply the following simple rule: we let the new value of z be the square of the old value of z, plus c. After each iteration of applying this rule we calculate the magnitude of z, which is simply the distance from the zero-point on the complex plane (i.e. 0+0i) to z. We then compare the magnitude of z to some arbitrary threshold. We say that the depth of the complex number c into the set is how many times the rule can be applied before z exceeds the threshold. Finally we assign a colour or shade of gray to the point c on the complex plane according to its depth. This procedure is repeated for every point on the complex plane. So in summary, a picture of the Mandelbrot set is just a coloured representation of the depth of points on the complex plane into the set.

Despite being described by such an incredibly simple rule, the Mandelbrot set in incredibly complicated. In fact it is infinitely complicated. If we zoom in on a region of the Mandelbrot set things don’t begin to flatten out or become regular. Instead the phenomenal beauty and complexity continues. We notice many familiar patterns emerging, most notably the ‘bug’ silhouette appearing over and over again. Nonetheless, the pattern is not repetitive. We can zoom in, quite literally forever, and never see any repetition or reduction in complexity. This is a generic property of fractals, of which the Mandelbrot set is one. It may seem that the Mandelbrot set, while very attractive, is fairly useless, which is most likely the case. However, this is not the case for fractals in general, which can be used to describe many real world phenomena. For example, geographic formations, growth of biological organisms such as the patterns on sea shells and fern leaves, and even the dynamics of financial markets can all be described by fractals. 