View Full Version : The Mandelbrot set explained
ceptimus
08-29-2005, 04:43 PM
You'll have all seen the pretty pictures of the Mandelbrot set, but many of you won't have understood the beautiful simplicity of the rule that creates it. Part of this is that the rule is usually defined in terms of complex numbers, and as soon as many people hear that, their eyes glaze over and they stop trying to understand...
So let's have a look at it without using any complex numbers - just using a standard graph. Anyone who has ever plotted a graph can understand this.
When we plot a point on a graph, we need to know how far across to make the point, and how far up. Traditionally we call these two values x and y. The Mandelbrot set is made by plotting the (x, y) points that satisfy a simple rule, and not plotting those points that don't. To make the pretty pictures you see, you have to plot thousands of points - this is why no one found the set before computers became common - it would have been too boring to plot the thousands of points by hand.
So what is the simple rule and how does it work? Well given the values for x and y, you use the rule to calculate two new values - call them x1 and y1, and then you use exactly the same rule again on those new numbers to work out x2 and y2 and so on. In general we calculate xn+1 and yn+1 using the previous values xn and yn.
Sometimes, after you have applied the rule a few times you find that the values of x and y are getting bigger and bigger - this means that the original (x, y) point is not part of the Mandelbrot set. But for some values of (x, y) you find that you get a whole string of new (x, y) values, and they all stay fairly small - then that original (x, y) is in the Mandelbrot set.
If we call the original (x, y) values x0 and y0 so as not to confuse them with any of the chain of new values we calculate, then the rule to create the new x and y from the previous one is just:
xn+1 = xn2 - yn2 + x0
yn+1 = 2xnyn + y0
Don't worry! There aren't any more formulae. That's it! If you can understand that simple rule for calculating a chain of (x, y) values from a starting point, and plot all those points where the numbers stay reasonably small, then you can make the Mandelbrot set yourself. You calculate the first point in the chain by using 'previous' values of x and y of zero, so in fact (x1, y1) works out to be exactly the same as the starting point (x0, y0), and the first real new value is therefore (x2, y2).
A good (and in fact accurate) definition of 'reasonably small' is 2. So when you are calculating your x and y values, if you ever get an x or y that is larger than 2 (or less than -2) then you can be sure that the (x0, y0) point that generated it is not in the Mandelbrot set.
Sorry if I frightened or bored anyone with the formulae. If just one person understands the Mandelbrot set a bit better after they read this, then it will have been worth it.
Chatter
09-02-2005, 08:59 PM
xn+1 = xn2 - yn2 + x0
yn+1 = 2xnyn + y0
Don't worry! There aren't any more formulae. That's it! If you can understand that simple rule for calculating a chain of (x, y) values from a starting point, and plot all those points where the numbers stay reasonably small, then you can make the Mandelbrot set yourself. You calculate the first point in the chain by using 'previous' values of x and y of zero, so in fact (x1, y1) works out to be exactly the same as the starting point (x0, y0), and the first real new value is therefore (x2, y2).
A good (and in fact accurate) definition of 'reasonably small' is 2. So when you are calculating your x and y values, if you ever get an x or y that is larger than 2 (or less than -2) then you can be sure that the (x0, y0) point that generated it is not in the Mandelbrot set.This gives you the black you generally see in the pictures. If you also want all the beautiful colours around it, you need slightly different rules. First off, instead of looking at each xn and yn to determine whether it is greater than 2, calculate
xn^2+yn^2
and see whether that is greater than 4. Colour the point based on how many terms of the sequence you have to go through to make the above expression greater than 4. If you start out greater than 4, colour that, say, purple. If it is only greater than 4 after the second term, colour it, say, red, and so on. Any point which never makes the above expression greater than 4 is coloured black. The black is then the Mandelbrot set, but the colourful boundary (non-technical sense) is extremely interesting also.
Sorry if I frightened or bored anyone with the formulae. If just one person understands the Mandelbrot set a bit better after they read this, then it will have been worth it.I don't think you can convey any sort of understanding of the Mandelbrot set by simply giving an algorithm to create it, but it certainly is nice seeing how easy it is to define something so monumentally complicated.
Check out
http://www.softlab.ece.ntua.gr/miscellaneous/mandel/mandel.html
Seriously. It is extremely cool.
Godwhacker
09-02-2005, 11:22 PM
Question...I often hear the term "fractal" in reference to the Mandelbrot set. Whats the connection?
BTW, my favorite rock band, Rush, used the set as the inside cover art for their album "Test for Echo"
I thought about replying to cep's op. Not having a lot of time wasn't the reason; the Mandelbrot set is too important. I wasn't happy that I could put my reaction into concise words. But let's try anyway.
It's no bad thing to understand the iterative process and formula behind the M-set, and perhaps even the possible colouring algorithms. It's vital, of course, to appreciate that the iteration and formula are incredibly simple but are able to produce one of the most complex deterministic objects.
But then, so what? Computer graphics produce amazing images; any grandad in the street knows that. To explain the Mandelbrot set, I am inclined to try to explain its structure (as an image, that's as good as anything). It's not just a heart-shape surounded by circles and squiggles.
Explore here: Mu-Ency -- The Encyclopedia of the Mandelbrot Set (http://www.mrob.com/pub/muency.html). This delves into some mathematics at various points but you can ignore that. Regrettably, most of the illustrations are in sad old ascii art.
Just as an example of the stunners hidden in the structure: you can find miniature Mandelbrots anywhere you look on the edge of the M-set (if you look away from the edge you are inevitably in a smooth blank area). Formally:
Every neighborhood of a point on the boundary of the Mandelbrot set contains infinitely many embedded copies of the Mandelbrot Set.
Like this attachment. The black blobs in the right hand side are minibrots (the largest is distorted but the others are symmetrical).
Gw, although objects with fractal properties were known before Mandelbrot's work, he I think introduced the term, and the set that bears his name, with his book The Fractal Geometry of Nature. Basically, the term refers to something squiggly enough that - on a well defined measure - it has a fractional dimension. Lines are one-dimensional, planes are two-dimensional. Fractals have properties (like infinite length in a finite area) that put them somewhere in between.
In fact, the M-set is not a fractal because its boundary has fractal dimension 2 (a whole number not a fraction), but this is almost always ignored since it has the other interesting features of fractals: the same patterns repeating at smaller scales, infinitely far down, with increasing period (complexity) and "self-similarity".
So the Mandelbrot set is a poster-bearer or icon for the whole world of deterministic fractals.
(There are non-deterministic fractals all around you: mountains, clouds, trees, rocks: with almost self-similar patterns repeated at different scales).
All clear? Good
ceptimus
09-03-2005, 12:38 AM
Another way to explain a fractal Gw, it that it looks much the same at any scale.
So if someone shows you a picture of part of the Mandelbrot set, you can't tell whether you are looking at say 1% of the whole set, or 0.000001% of it, or even one-billion-billionth of a percent, and so on. No matter how much you zoom in on an edge, you will see more and more detail, for ever.
It's stunning that something of such awesome complexity is created by such a simple formula. If smart aliens in another galaxy discover the same formula, as surely they would, then they will be looking at exactly the same amazingly complex entity that we do.
In a sense, the Mandelbrot set is out there waiting to be discovered by anyone. It's not an invented thing - it's something that must exist due to the basic geometry of the universe.
It's things like the Mandelbrot set that allow non-religious people to experience a sense of awe and wonder about our universe. Maybe this sense of awe is even better than religion. I wouldn't know.
Godwhacker
09-03-2005, 01:17 AM
Ah, some of this is coming back to me (I used to dabble in this stuff a little back in my college days). I seem to recall that fractals and their ilk tend to be good models for some biological systems. The example I remember is tree branches, and how, although when and where the branch branches off from the tree is somewhat random, there is also some order to it in that the density of the amount of "tree" per foot, meter, yard, whatnot, tends to always be the same. Are thus fractals and the m-set are related to chaos theory (there is order in the randomness and randomness in the order, etc.)?
Or am I literally climbing up the wrong tree here?
I also seem to recall that one can never measure the perimeter of a fracal, because it just keeps going and going into smaller and smaller units of measure.
You're climbing up the right bark. I had a longer post but my browser decided to eat it. That's chaos, after all...
All your recollections are along the right lines. Order in randomness: Feigenbaum's constant (http://en.wikipedia.org/wiki/Feigenbaum_constant). Perimeter of a fractal: Mandelbrot's paper "How Long Is the Coast of Britain?" (http://en.wikipedia.org/wiki/How_Long_Is_the_Coast_of_Britain%3F_Statistical_Self-Similarity_and_Fractional_Dimension)
Godwhacker
09-03-2005, 05:32 PM
Ah! I vaguely remember that last one....I think he said that you could never really measure the coast of Britian because of all the nooks and crannys are basically like fractals...you would keep needing a smaller and smaller unit of measure.
Kind of like Zeno's old paradox...only with curves and crannies instead of a straight line....
Shake
09-06-2005, 08:22 PM
Way cool! I love fractals! I've grabbed a few images off the 'net that appealed to me which I sometimes use as wallpapers.
Hiya Shake. Come up and see my fractals some time...
It's much more satisying making your own than grabbing them off the net, although there are some astonishing artists out there.
Shake
09-08-2005, 08:07 PM
OK, I thought I found something the other day, but I can't find it now. Where can I get something to make my own?
There are more packages than I can keep tabs on.
Fractint (http://spanky.triumf.ca/www/fractint/fractint.html) is the granddaddy and master of them all, but runs mouseless in dos and has, to say the least, a highly idiosyncratic user interface.
Ultrafractal (http://www.ultrafractal.com/) is the reigning champion of fractal art (meaning it's far more than you need to explore the shape of the M-set, but if you want user-written colouring formulae and alpha-blended layers, it's your tool of choice) - but it costs a few $$.
Otherwise try http://www.fractovia.org/fractal_generators/index.shtml or the links at http://en.wikipedia.org/wiki/Fractal and http://en.wikipedia.org/wiki/Mandelbrot_set.
joe
cappuccino
09-15-2005, 09:21 PM
ah...the Mandelbrot set holds a special place in my heart. I took a chaos and fractal course in college and we studied that set extensively. Also I created a nice program that created the set with various gradients of pretty colors. It was quite fun.
I'd like to add this piece of information. The beautiful picture of the Mandelbrot set we all see and know is actually only an approximation. As ceptimus mentioned, to determine whether a chosen point on the complex plane is member of the set, you'd have to plug that point into the rule and iterate the rule over and over again to see if the resulting sequence of generated points "drift" away into infinity in the parameter space where the Mandelbrot set lives in.
Each point that you pick on the complex plane is either member of the set or not. Those that aren't in the set have different rates of sequence divergence in the parameter space, some goes to infinity very quickly, others reaches infinity so slowly it takes hundred of thousands of iterations with the rule to determine whether they're part of the set or not. You can assign a different color for each rate of divergence and this yields the stunning color pictures of the Mandelbrot set where the points that are in the set are usually simply painted black.
The problem is that it may take millions or more of iterations to figure out if a point is actually in the set or not. In fact, it's been shown mathematically that it takes an infinite number of iterations to find the exact Mandelbrot set. Obviously that's impossible for computers to be able to do that, all the programs that create the set have a built in cut off value, usually somewhere in the region of a million iterations to get good pictures which are only approximations. The more iterations you allow the program to run, the more detailed and accurate the picture is but the longer it takes to build up the image. The extremely detailed and extraordinary images require hours of computer time to render.
When you look at a Mandelbrot set, you are looking at infinity literally.
There's also a deep connection between the set and Julia sets. Each point in the Mandelbrot set actually corresponds to a Julia set which lives in the dynamical space. So the Mandelbrot set is also a collection of an infinite number of dynamical spaces.
That's pretty neat! Within mathematics there are infinite spaces living within each other - all hidden from view until we discover their existence using the power of reason and computers.
Obviously that's impossible for computers to be able to do thatBut...
When you look at a Mandelbrot set, you are looking at infinity literally.Not quite literally, then? :wink:
When we look at it we are trying to look at infinity. It's incredibly frustrating waiting for treacle-slow render times when deepzooming (yup, children, that's what it's called). There's something in your image but you just can't reach it.
cappuccino
09-15-2005, 11:01 PM
Obviously that's impossible for computers to be able to do thatBut...
When you look at a Mandelbrot set, you are looking at infinity literally.Not quite literally, then? :wink:
:tongueout:
yes yes, you're right of course but it doesn't sound quite so poetic if I had said it any other way.
When we look at it we are trying to look at infinity. It's incredibly frustrating waiting for treacle-slow render times when deepzooming (yup, children, that's what it's called). There's something in your image but you just can't reach it.
Yes but the rewards are great for those who have the patience to wait for the Mandelbrot set to reveal itself piece by piece :yes!:
Shake
09-16-2005, 09:37 PM
/me finally gets around to checking back into this thread
Thanks for the links, Joe! I'll check 'em out!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.