* Mandelbrot Set *

* Mandelbrot Sequence is an infinite sequence of numbers z0, z1, z2, z3, .....zn, zn+1, ..... of the form   Zn+1 = [Zn]2 + Z0  where the first number is z0 (called the seed )& remaining  numbers are defined recursively by the said formula.
* Taking   z0= 1, we get z1 =2  , z2  =5   , z3 =26     and so on. The sequence generated is called an escaping sequence as the terms get bigger and bigger without bound. z0= 1 is called a non-black point.
* Taking   z0= -1, we get z1 =0  , z2  =-1   , z3 =0     and so on. The sequence generated is called an non-escaping sequence . It is a periodic sequence as the terms repeat themselves. z0= 1 is called a black point.
* Taking   z0= -0.5, we get z1 =0.25  , z2  =-0.4375   , z3 =-0.3086   and so on. As n value increases, the numbers get closer to -0.36 though they do not reach that value. The sequence generated is called an attenuated periodic sequence attracted to -0.36 value . It is called an attracted sequence &  z0= -0.5 is called a black point.
* Mandelbrot Set is a set of all complex numbers c or z0  that are black points i.e. they generate either periodic sequence or attracted sequence. Points that escape are the only points not in Mandelbrot Set. In the above examples, real numbers were used as seeds. But one can use complex numbers. For example, Taking   z0= i, we get z1 =-1+i  , z2  =-i   , z3 =-1+i     and so on. The sequence generated is called an non-escaping sequence . It is a periodic sequence as the terms oscillate between -i & -1+i. z0= i is called a black point.
* Orbit is the path followed by the values of Z at each n.
IInd Step
* Let a complex number z --> as a pair of (x,y) real numbers and complex number  c --> as a pair of real numbers (a,b). Formula Z  -->z2+c which transforms to x (real part of Z) --> x2-y2+a    and y (imaginary part of Z) ->2xy+b
* If (x0,y0) =(0,0) and (a,b)=(1/2,-1/2), then (x1,y1) =(1/2,-1/2)   ; (x2,y2) =(1/2,-1) ; (x3,y3) =(-1/4,-3/2) and so on.
* The analog of the Mandelbrot set can be defined for any zn + c, for any integer n > 2.

 By a simple change of variables, the familiar logistic map xn+1 = sxn(1 - xn), can be recoded into to form xn+1 = xn2 + c. Note the similarity with the Mandelbrot set iteration formula. Letting c range from c = 1/4 to c = -2, generate the sequence of numbers x0 = 0, x1 = x02 + c, x2 = x12 + c, ... . Plot c along the horizontal axis, and in the vertical line above each c value, plot x100 through x200. For -3/4 < c < 1/4, the values xi converge to a fixed point, whose value depends on c, decreasing as c decreases. For -5/4 < c < -3/4, the values xi converge to a 2-cycle. And so on. Plotting all these eventual behaviors together for -2 < c < 1/4 gives the bifurcation diagram for the recoded logistic map xn+1 = xn2 + c. This is the top of the figure on the right. Note from the insert that the logistic bifurcation diagram has fracal characteristics: it is filled with small copies of itself. From the branching structure of the logistic bifurcation diagram we can read the cycle number of the corresponding features of the Mandelbrot set. So all the interesting dynamics of the logistic map are contained in the middle section of the Mandelbrot set (the part along the real axis).

In mathematics, the Mandelbrot set, named after Benoît Mandelbrot, is a set of points in the complex plane, the boundary of which forms a fractal. Mathematically, the Mandelbrot set can be defined as the set of complex values of c for which the orbit of zn  under iteration of the complex quadratic polynomial zn+1 = [zn]2 + c remains bounded. That is, a complex number, c, is in the Mandelbrot set if, when starting with z0=0 and applying the iteration repeatedly, the absolute value of zn never exceeds a certain number (that number depends on c) however large n gets.

Why Fibonacci Sequence appears inside Mandelbrot set is not properly understood, letting c = 1 gives the sequence 0, 1, 2, 5, 26… and so on. This sequence goes towards infinity. As this sequence is unbounded, 1 is not an element of the Mandelbrot set.

When computed and graphed on the complex plane, the Mandelbrot Set is seen to have an elaborate boundary, which does not simplify at any given magnification. This qualifies the boundary as a fractal.

A fractal generated by iterating: zn+1 = [zn]2 + c where z0=0  and plotting how fast it diverges to infinity for different values of the complex number  (speed represented as colours). The black set represents the "prisoner" points that do not diverge: it is the Mandelbrot set .
A fractal generated by iterating: zn+1 = [zn]2 + c and plotting how fast it diverges to infinity for different values of the complex number  (speed represented as colours) for a set value of c. The black set represents the "prisoner" points that do not diverge: the border of this set is the Julia set .
Values of c that lie within the Mandelbrot set result in connected Julia sets; values of c from outside result in disconnected Julia sets. We can draw an array of Julia sets for various values of c, and map out the Mandelbrot set. In stead of z, one can try sin z, ez or zz

How The Mandelbrot Set Works
The Mandelbrot Set is found by iterating the equation zn+1 = [zn]2 +zc where z0 = 0. The number z is a complex number. We define the Mandelbrot Set to be the set of all complex numbers zc such that zn is finite as n goes to infinity. There is a theorem which states that it will not be finite if the magnitude of zn ever exceeds 2.
In order to generate an image, we must iterate this equation repeatedly for every value of zc in the complex plane. For example, let's say we want to color a pixel at (-1,0.5). We start out with zc = -1+0.5i and z0 = 0 and proceed from there:
z1 = [z0]2+zc = -1+0.5i
z2 = [z1]2+zc = -0.25-0.5i
z3 = [z2]2+zc = -1.1875+0.75i
z4 = [z3]2+zc = -0.1529344-1.28125i
z5 = [z4]2+zc = -2.61839+0.890381i
We stop here because the magnitude |z5| = 2.76564 > 2. We conclude that this point is unbounded and color code our pixel based on the required number of iterations n = 5. Then we repeat the whole process again for each pixel.