We are about to show that you can get incredible structure from the simplest of algorithms when we use complex numbers.
The equation we are going to look at is an iterative equation:
with . You simply get the next from plugging in the previous one, squaring it and adding a number . I’m going to give you a value for , then you’re going to iterate this equation and see what happens. For instance, if I give you the number :
You can see that this number is just going to keep on increasing without end if we keep applying the algorithm. How about a smaller number, let’s say :
It looks like this is tending to some value. In fact it has come to a fixed point where . There are actually two solutions to this equation but one of them is 0.112702 which is where we are tending towards. I can clearly perform this procedure with being any number and I can ask whether the diverges as , or whether it always stays small. In fact I can be a bit more strict. I can ask whether the magnitude of the always stays less than or whether it becomes greater than . Let’s ask this for all numbers which are real.
It turns out that this is a pretty easy problem. If then the magnitude of always stays below 2 and if it’s outside this range, then it blows up. As an example Let’s look at the value of the as we iterate for numbers just below and just above . This is shown in the figure below}
But we’ve only looked at values of on the real line, and frankly the results were not very interesting. Why should it be any more interesting if we let be any complex number? It turns out that the answer is both surprising and beautiful.
We’ll work out what is the set of complex numbers for which always stays below 2 using a technique of picking numbers in the complex plane at random and testing them – ie. plugging them into the iterative algorithm and seeing what happens to . We’re only going to run the iterative algorithm for a maximum number of times, but if during that time the magnitude of goes above 2 we will quite the algorithm and say that that value of that we used is not in the set that we are interested in. In fact to get the set accurately we would have to be more sophisticated than this and run the algorithm in a more intelligent way so that we’re not including points in the set which should not be there. For instance, in the figure above had we only run the algorithm 50 times, we would have thoughts that 0.251 was in the set, whereas we see that eventually, the magnitude gets above 2 and so it’s not in the set. However, for the purposes of this explanation, running the algorithm 100 times will be sufficient to see the complexity emerge.
Let’s try with a random complex number. Let’s take . This, together with is shown in the figure here:
We can see immediately that the behaviour looks somewhat different. For real numbers the numbers either converged, or diverged fairly obviously, but for complex numbers they seem to oscillate before they converge or diverge and it’s not altogether clear what will happen if you look at the values at any particular .
Let’s now take random points in the complex plane (values of ) and if the value of converges, we’ll put a blue point there and if it diverges (within 100 iterations of the algorithm) we’ll put a red point there. What will this look like? This is shown in the figure here for 100,000 random points.
You can see that it looks rather like a random splotch of paint. In fact it turns out that this really isn’t a very detailed view of the set at all (the word set in ‘Mandelbrot set’ is because we are looking for the set of numbers with a particular behaviour, in this case the blue points are in the set, and the red points are not). In fact it turns out that there is an infinite amount of detail to be see. What does this mean. Well, let’s say that we take a small patch of the previous figure and try and look at it in more detail. Let’s take a region of the complex numbers with real parts between 0.2 and 0.5 and imaginary parts 0.25 and 0.8. We sample in this smaller region with 100,000 points and find the image here:
But it looks like there might be more structure at even smaller levels. Let’s zoom in on an even smaller region here. In the next figure we look at a small region in the previous one. In particular we look at complex numbers with real parts between 0.3 and 0.325 and imaginary part between 0.55 and 0.62.
Again, we zoom in on a tiny region in this figure, again sampling 100,000 points, but this time in the tiny region of with real part between 0.315 and 0.316 and imaginary part between 0.576 and 0.578. This is shown here:
In fact we could keep doing this for every and the images would never become smooth and we would never stop getting more detail. This is a fractal and you can zoom in infinitely far and keep seeing more structure. Think of this like a coastline. If you take a picture of a country from above, you will get a certain detail of the coastline, but as you zoom in more and more you will start to see the structure of individual beaches, then further in you will see structure of individual curves in the beach, then you will start to see structure in the rocks in the beach, then you will start to see structure in the sand, then in smaller and smaller particles. However, you can only zoom in so far because there seems to be a fundamental limit to the scale of the universe. However, a fractal is different. In the mathematical world you can zoom in more and more and always get more detail….always!!! This is a pretty amazing fact for such a simple equation and its because of the wonderful behaviour of complex numbers that we get this complexity!
In fact using a relatively small number of sample points (only 100,000) doesn’t give us a very good picture of the intricacy of the image. In the figure below there is an image taken from wikipedia which shows in much better detail the mandelbrot set
What we have done here is very crude, we have only zoomed in a tiny bit (in fact, what does tiny mean when we can zoom in infinitely far, in theory – isn’t anything tiny compared to that?). Here is a video of a Mandelbrot set over 200 orders of magnitude. Note that the colours are related to those numbers which are not in the set but they can be colour coded by the number of iterations it takes for the algorithm to give you a whose magnitude is greater than 2.
What is truly amazing here is that from a truly simple algorithm we are able to create infinite complexity. We have seen a number of times now how the complex numbers helps us to build a bridge between seemingly unconnected areas, and now we see how it links us to the world of chaos, fractals, and complexity. Sadly in the first year we are only able to skim the surface of what complex numbers can really bring us, but for those who are going to go on and study more mathematics through university, you will see a whole world of possibilities open up to you…