The Programmer's Guide to Fractals |

Written by Mike James | ||||

Page 2 of 3
## The Fractional DimensionSelf-similarity may sound like an innocent concept but it leads to most of the clever things we associate with fractals and, in particular, their name. If you think about a theoretically perfect line then it is clear that it’s one-dimensional. Similarly a perfect plane is a two-dimensional surface and there really doesn't seem to be a way that you can make a line into something two-dimensional. Well if it wiggles enough you can! The idea is that if a curve can wiggle enough then it can visit enough points to have an area and not just a length. Consider for example a line that passes though every point in the unit square. The line when you look at any part of it must be just a line and hence one dimensional. However as the line passes though every point in the square it must have an area of one just like the square. So a such a line has an area and in some sense must be more than one dimensional. Curves that pass through every point in some space are called space filling and the first were thought up by the mathematician Giuseppe Peano (1852-1932). Peano curves are very similar to better known fractal curves such as the snowflake but they are designed so that they provably pass though every point. So lines can behave as if they are more than one dimensional but the problem is to find a measure of the dimension that works and gives the usual answer for standard lines, areas and volumes. Mandelbrot defined the fractal dimension of a line as the ratio of the log of its lengths at two zoom factors and the log of the zoom factors. Using this definition of dimension, a line can have a fractional dimension between 1 and 2 – hence the name “fractal”, i.e. fractional dimension. Mandelbrot's dimension is just one of a number of possible measures and it isn't the most convenient to work with in most cases but it is where it all started from. ## Iterated mapsOK, so now we know that fractals are about wiggly lines and the possibility of fractional dimension – but what has all of this got to do with the part of fractals that everyone knows about, that is the Mandelbrot set and perhaps fractal compression. The link is two-fold. The first thing to realise is that self-similarity of a curve at all levels of zoom implies a fractional dimension between 1 and 2 and hence fractals are often self similar. The second link is that there are many processes which give rise to self-similar curves and patterns. Most involve some sort of iteration, i.e. repeated operation. For example the Sierpenski triangle is a fractal created by drawing a triangle and then drawing a triangle inside of it. This process of drawing a triangle inside of another is then iterated by drawing a triangle inside each of the triangles so formed by the previous drawing of a triangle – look at a Sierpenski triangle again and it will become obvious.
There are many types of iterated process that we could examine to see if they produce fractals but the best known is the one that produces the Mandelbrot set and so we had probably better look at this one in some detail. I should warn you at this point that the Mandelbrot set is simple to define but much misunderstood. ## The Mandelbrot IterationThe definition of the Mandelbrot set is very simple, as long as you know how to do arithmetic with complex numbers. The iteration at the heart of the set is just:
That is, we take an initial For example, if A complex number is really a two-dimensional thing and can be written as:
where
where In this case you can see that it isn’t 100% certain that the value that you get will simply increase. The minus Of course in this case we have to define what we mean by “getting bigger” or the “size” of a complex number. If you think of The set of points that doesn’t vanish off to infinity is the Mandelbrot set. That is the Mandelbrot set is the set of values of c for which the iteration doesn't diverge to infinity. ## Coloring The Mandelbrot SetThere are many things that are interesting about the Mandelbrot set and the first is that it isn’t colored as shown in almost every picture of it. In fact the Mandelbrot set is the black shape in the usual picture not the amazingly colored region that everyone enjoys looking at! These pictures are colored by assigning a color to points that go off to infinity according to how fast they do it! In other words, the color points in the picture are definitely NOT part of the Mandelbrot set!
The really interesting thing about the Mandelbrot set is how complicated it is. You would think that points that don’t go off to infinity would be close to other points that do go off to infinity and that this would be determined by some simple condition and hence the set should have a simple shape. Well none of these obvious facts seem to be true and the Mandelbrot set is very complicated and far from smooth. If you zoom in on it then you see more and more detail that seems to go on without end. The Mandelbrot set is fractal. |