Mandelbrot set

In mathematics, the Mandelbrot set is a fractal that is defined as the set of points c in the complex plane for which the iteratively defined sequence:
 <math>z_0 = 0\,<math>
 <math>z_{n+1} = {z_n}^2 + c<math>
does not tend to infinity.
The sequence is thus expanded mathematically as follows for each point c in the complex plane:
 <math>c=x+iy \,<math>
 <math>Z_0=0 \,<math>
 <math>\begin{matrix}Z_1&=&Z_0^2+c \\ \ &=& x+iy\end{matrix} \,<math>
 <math>\begin{matrix}Z_2&=&Z_1^2+c \\ \
&=&(x + iy)^2+x+iy \\ \ &=&x^2+2ixyy^2+x+iy \\ \ &=&x^2y^2+x+(2xy+y)i\end{matrix} \,<math>
 <math>Z_3=Z_2^2+c=... \,<math>
and so on.
If we reformulate this in terms of the real and imaginary parts (X and Y coordinates of the complex plane), looking at each iteration, n replacing z_{n} with the point x_{n} + y_{n}i and c with the point a + bi, then we get
 <math>x_{n+1} = {x_n}^2  {y_n}^2 + a \,<math>
and
 <math>y_{n+1} = 2{x_n} {y_n} + b \,<math>
The Mandelbrot set can be divided into an infinite set of black figures: the largest figure in the center is a cardioid. There is a (countable) infinity of nearcircles (the only one to be actually an exact circle being the largest, immediately on the left of the cardioid) which are in direct (tangential) contact with the cardioid, but they vary in size, tending asymptotically to zero diameter. Then each of these circles has in turn its own (countable) infinite set of smaller circles which branch out from it, and this set of surrounding circles also tends asymptotically in size to zero. The branching out process can be repeated indefinitely, producing a fractal. Note that these branching processes do not exhaust the Mandelbrot set: further upwards in the tendrils, some new cardioids appear, not glued to lower level "circles". The largest of these, and the most easily visible from a view of the entire set, is along the "spike" which follows the negative real axis out, roughly from real values of 1.78 to 1.75.
Contents 
History of the Mandelbrot set
The Mandelbrot set was first defined in 1905 by Pierre Fatou, a French mathematician working in the field of complex analytic dynamics. Fatou studied recursive processes like
 <math>z \to z^2 + c\,<math>
Starting with some point <math>z_0<math> on the complex plane, successive points may be generated by repeatedly applying this formula. The sequence of points thus obtained is called the orbit of <math>z_0<math> under the transformation
 <math>z \to z^2 + c\,<math>
Fatou realised that the orbit of <math>z_0 = 0<math> under this transformation would provide some insight into the behaviour of such systems. There are an infinite number of such functions  one for each value of c. Fatou did not have access to a computer capable of plotting the orbits of all these functions, but attempted to do so by hand. He proved that once a point moved to a distance greater than 2 from the origin, then the orbit would escape to infinity.
Fatou never saw the image of what we now call the Mandelbrot set as we do because the number of calculations required to generate this is far more than could be calculated by hand. Professor Benoît Mandelbrot was the first person to use a computer to plot the set.
Fractals were popularised by Mandelbrot in 1975 in his book Les Objets Fractals: Forme, Hasard et Dimension. In this book, Mandelbrot used the term fractal to describe a number of mathematical phenomena that seemed to exhibit chaotic or surprising behaviour. All of these phenomena involved the definition of some curve or set through the use of some recursive functions or algorithms. The Mandelbrot set is one such phenomenon that is named after its discoverer.
Relationship with Julia sets
Embeddedjulia.jpg
The Mandelbrot set was created by Benoît Mandelbrot as an index to the Julia sets: each point in the complex plane corresponds to a different Julia set. The points within the Mandelbrot set correspond precisely to the connected Julia sets, and the points outside correspond to disconnected ones.
Intuitively, the "interesting" Julia sets correspond to points near the boundary of the Mandelbrot set; those far inside tend to be simple geometric shapes, while those well outside look like dust surrounded by blobs of color. Some programs, such as Fractint, let the user choose a point, and jump to the corresponding Julia set, making it easy to find Julia sets that the user is likely to enjoy.
The Mandelbrot set also contains structures that strongly resemble Julia sets; indeed, for any value c, the region of the Mandelbrot set near c resembles the center of the Julia set with parameter c.
Plotting the set
Mandelbrotset.png
Buddhabrot.jpg
Fractalzoom103Mandelbrot_Buzzsaw.png
It can be shown that once the absolute value of z_{n} is larger than 2 (in cartesian form, when x_{n}^{2} + y_{n}^{2} > 2^{2}) the sequence will tend to infinity, and c is therefore outside the Mandelbrot set. This value, known as the bailout value, allows the calculation to be terminated for points outside the Mandelbrot set. For points inside the Mandelbrot set, i.e. values of c for which z_{n} doesn't tend to infinity, the calculation never comes to such an end, so it must be terminated after some number of iterations determined by the program. This results in the displayed image being only an approximation to the true set. Mandelbrot hobbyists quickly learn to recognize the "blobby" images caused by a program mistakingly placing points in the set, and will then up the iteration count (at the expense of slowing down the calculation of every point actually in the set).
Adding color
Mathematically speaking, the pictures of the Mandelbrot set and Julia sets are "black and white". Either a point is in the set or it is not. Most computergenerated graphs are drawn in color. Under the most common rendering method, for the points that diverge to infinity, and are therefore not in the set, the color reflects the number of iterations it takes to reach a certain distance from the origin. This creates concentric shapes, each a better approximation to the Mandelbrot set than the last. One possible scheme is that points that diverge quickly are drawn in black; then you have brighter colors for the middle; then you have white for the points in the set, and nearwhite for the points that diverge very slowly.
In order to determine if the point, Z_{0}, is going to be in the Mandelbrot set (traditionally coloured black) or outside the set (coloured according to the escape speed), the distance of the Z_{i} must be calculated at each iteration in the sequence:
If <math>Z_i = X + iY \ <math>, then <math>\Z_i\ = \sqrt{X^2 + Y^2}<math>. Note that one of the many possible optimisations for calculating mandelbrots can be applied here. Rather than testing to see if <math>\sqrt{X^2 + Y^2} > 2<math>, we can simply test to see if <math>X^2 + Y^2 > 4 \ <math> — thus saving the square root operation.
So, if <math>\Z_i\^2 < 4<math> then colour the point black, otherwise colour it according to the value of i. Using the number of iterations required to determine that the point has escaped is the easiest and most common way of recording the "speed" of escape. This number can be directly mapped to a colour via a lookup table or palette, or by use of some suitable algorithm.
So far, we have worked out how to tell if the point is outside the set — it moves more than a distance of 2 away from the origin. How do we tell it is inside the set? There are lots of strategies for this — this is not so simple. If it were, there would not be so many different algorithms out there for calculating mandelbrots. This is the essence of the problem. Clearly most points will not actually get to zero in a reasonable number of iterations. The simplest algorithm is to simply limit the number of iterations and if you have not gone outside the boundary by the time you have done your last iteration, then you assume the point is in the set.
Indeed, points nearer the set take longer to escape. This is why plotting slows down near the dark region — because more terms in the expansion are having to be calculated to determine the escape speed. When not near the set, one can "get away with" a lower maximum iteration count. The images below, of the same location, are created with iteration limits of 32, 64, 128, 256, 512, 1024, 2048 and 1000000, respectively. Note that there are diminishing returns in upping the iteration count past a point; these are also good examples of the "blobby" images one gets with a toolow iteration count. These images are centered at 1.7490110509, 0.0004525. The image is roughly 0.000417 of a unit wide, and located about halfway down the "valley" at the +x end of the largest miniset.
Optimization
One way to improve calculations is to find out beforehand whether the given point lies within the cardioid. The cardioid's polar equation is
 <math> \rho_c = {1 \over 2}  {1 \over 2} \cos \theta <math>
but with the center of polar coordinates located at (1/4,0) — the cardioid's cusp — instead of at the origin. Given point (x,y), calculate the following
 <math> \rho = \sqrt{\left( x  {1 \over 4} \right)^2 + y^2}, <math>
 <math> \theta = \hbox{atn}_2 \left( y, x  {1 \over 4} \right), <math>
 <math> \rho_c = {1 \over 2}  {1 \over 2} \cos \theta. <math>
If <math> \rho \le \rho_c <math> then point (x,y) is in the Mandelbrot set (color it black), and the usual calculations can be skipped. To prevent having to do huge numbers of iterations for other points in the set, one can do "periodicity checking"  which means check if a point reached in iterating a pixel has been reached before. If so, the pixel cannot diverge, and must be in the set.
Art and the Mandelbrot set
Some people have a hobby of searching the Mandelbrot set for interesting pictures. They have a collection of pictures, along with the coordinates for generating that picture. For example, the image to the right is a closeup centred at coordinates (0.282, 0.01). Below are more examples of cool and hotlooking Mandelbrot set regions:
Missing image
Rflmandel002outp02.ps.rgb.bmpfvls.2gq90op.jpg
Cool Mandelbrot
There are many free fractalgenerating programs available, such as those by Stephen Ferguson (Sterling Fractal and the Tierazon series) and many people write such programs themselves for the highest level of control over their pictures. Below is a mincardioid, connected by filaments (too thin to be seen) to the main set (and other cardioids, some of which are actually in this image but too small to be seen).
Missing image
Fract027.gif
Miniset with filaments leading elsewhere
Other Mandelbrot sets
When people speak of the Mandelbrot set, they usually are referring to the set described above. Any function that maps to and from the complex number plane has a Mandelbrot set, which characterizes whether or not the Julia set corresponding to that function is connected.
Example:
Let <math>f_c(z) = z^3 + c<math>.
For each value of c, we draw the Julia set <math>J_c<math> of <math>f_c(z)<math>, and determine if it is connected or not. If <math>J_c<math> is connected, then c is in the Mandelbrot set of {<math>f_c<math>}, otherwise c is not in the Mandelbrot set.
This can also be generalized to Julia sets parameterized by more than two real numbers. For example, a collection of Julia sets parametrized by three real numbers will have a three dimensional Mandelbrot set. Of course, only the 2dimensional case will have an easily viewed picture.
Mandelbrot set in song
The Australian band GangGajang (http://www.ganggajang.com/) has a song Time (and the Mandelbrot set) (http://www.ganggajang.com/lyrics_time.htm) where the term Mandelbrot set is used liberally in the lyrics.
The American singer Jonathan Coulton (http://www.jonathancoulton.com/) has a song titled Mandelbrot Set (http://www.jonathancoulton.com/lyrics.php?song=mandelbrot) about the history of the Mandelbrot set, and of Benoit Mandelbrot himself.
The Blue Man Group's first album Audio features tracks titled "Mandelgroove", "Opening Mandelbrot", and "Klein Mandelbrot". The album was nominated for a Grammy in 2000.
External links
Template:Wikisource Template:Commons
 The Chaos Hypertextbook (http://hypertextbook.com/chaos/). An introductory primer on chaos and fractals.
 Mandelbrot Set Gallery (http://hbar.servebeer.com/~val/mandelbrot/index1.html)
 Downloadable Mandelbrot Set Explorer Application (http://www.cs.ucsb.edu/~ebarlas)
 MuEncy  Encyclopedia of the Mandelbrot Set (http://www.mrob.com/pub/muency.html)
 Fractal Explorer (http://www.geocities.com/fabioc)
 Explore and Discover (http://www.oemfoe.org/mandelbrot/)
 Mandelbrot Set (http://sciencesoft.at/index.jsp?link=fractal&lang=en) as WebClient/Server solution
 Julia and Mandelbrot Set Explorer (http://aleph0.clarku.edu/~djoyce/julia/explorer.html), a CGIbased interface created by David Joyce, a Clark University professor.
 The Fractal Microscope (http://www.shodor.org/master/fractal/software/mandy/index.html) provides a nice Java interface (figure to right). Unlike some other Javabased Mandelbrot set interfaces on the internet, this one works for Macintosh browsers (tested on these Mac OS X browsers: Safari, Mozilla, Camino, Internet Explorer).
 Detailed mandelbrot set, see bottom of page (http://sources.wikipedia.org/wiki/Wikisource:Mathematics)
 3D Mandelbrot Set Explorer Applet (http://www.dltonline.com/pages/M3DApplet.jsp)
 A gallery of Fractal images and copies of Fractalexploring programs. (http://faemalia.net/Fractals/)
 Realtime Mandelbrot Set Generator  Web based Mandelbrot Set Explorer. (http://mandelbrot.collettivamente.com)
 Color Cycling on the Mandelbrot Set (http://www.cuttheknot.org/Curriculum/Magic/MandelCycle.shtml)
 Iterations and the Mandelbrot Set (http://www.cuttheknot.org/blue/Mandel.shtml)
 Mandelbrot and Julia sets (http://www.cuttheknot.org/blue/julia.shtml)
 Xaos, an open source fractal explorer with Mandelbrot/Julia exploration, other fractals, and autopilot mode for easy exploration (http://xaos.sourceforge.net/english.php)
 Fract: a free software web zoomer for the Mandelbrot Set (http://fract.ygingras.net/)
 The Mandelbrot and Julia sets Anatomy (http://ibiblio.org/enotes/MSet/Contents.htm)de:MandelbrotMenge
es:Conjunto de Mandelbrot fr:Ensemble de Mandelbrot is:Mandelbrot mengið it:Insieme di Mandelbrot ja:マンデルブロ集合 ko:만델브로트 집합 pl:Zbiór Mandelbrota pt:Conjunto de Mandelbrot ru:Множество Мандельброта sv:Mandelbrotmängden