wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are cowritten by multiple authors. To create this article, 30 people, some anonymous, worked to edit and improve it over time.
There are 7 references cited in this article, which can be found at the bottom of the page.
This article has been viewed 293,557 times.
Learn more...
The Mandelbrot set is made up of points plotted on a complex plane to form a fractal: a striking shape or form in which each part is actually a miniature copy of the whole. The incredibly dazzling imagery hidden in the Mandelbrot Set was possible to view in the 1500s thanks to Rafael Bombelli's understanding of imaginary numbers  but it wasn't until Benoit Mandelbrot and others started exploring fractals with the aid of computers that the secret universe was revealed.
Now that we know it exists, we can approach it in a more primitive manner: by hand. Here is a method of viewing a crude rendering of the set, just for the purpose of understanding how it's done; you will then gain a much deeper appreciation for the renderings that you can make using the many opensource computer programs available, or that you can view on CDROM and DVD.
Steps

1Understand the basic formula, often expressed as z = z^{2} + c. This simply means that, for each point in the Mandelbrot universe we wish to see, we keep calculating z until one of two conditions occur; then we color it to show how many calculations we made. Don't worry! This will become clear in the following steps.

2Get 3 differentcolored pencils, or crayons, or felttipped markers, plus a black pencil or pen to make the outline. The reason we want three colors is because we'll make a first approximation with no more than 3 iterations (passes, or in other words, applying the formula up to 3 times per point):Advertisement

3

4Label (also in black) the middle square (0, 0). This is the constant (c) value of the point in the exact center of the square. Now let's say each square is 2 units wide, so add and/or subtract 2 to/from the x and y values of each square, with x being the first number and y being the second number. When done, it will look like what you see displayed here. Whenever you follow the cells across, the yvalues (the second number) should be the same; whenever you follow the cells down, the xvalues (the first number) should be the same.

5Calculate the first pass, or iteration, of the formula. You, as the computer (actually, the original meaning of the word was "a person who computes") can do this yourself. Let's start with these assumptions:
 The starting z value of each square is (0, 0). When the absolute value of z, for a given point, is greater than or equal to 2, that point (and its corresponding square) is said to have escaped the Mandelbrot set. When that happens, you will color the square according to the number of iterations of the formula you have applied to that point.
 Choose the colors you will use for pass 1, pass 2, and pass 3. Let's assume red, green, and blue, respectively, for purposes of this article.
 Calculate the value of z for the topleft corner of the tictactoe board, assuming a starting z value of 0+0i or (0, 0) (see Tips for a better understanding of these representations). We are using the formula z = z^{2} + c as outlined in the first step. You will quickly see that, in this case, z^{2}+c is simply c, since zero squared is still zero. And what is c for this square? (2, 2).
 Determine the absolute value of this point; the absolute value of a complex number (a, b) is the square root of a^{2} + b^{2}. Now, since we'll be comparing this to a known value: 2, we can avoid taking square roots by comparing a^{2} + b^{2} to 2^{2}, which we know equals 4. In this calculation, a = 2 and b = 2.
 ([2]^{2} + 2^{2}) =
 (4 + 4) =
 8, which is greater than 4.
 It has escaped the Mandelbrot set after the first calculation, since its absolute value is greater than 2. Color it with the pencil you chose for pass 1.
 Do the same for each square on the board, except for the center square, which will not escape the Mandelbrot set by the 3rd pass (nor will it ever escape). So you've only used two colors: the pass 1 color for all the outer squares, and the pass 3 color for the middle square.

6Let's try a square 3 times bigger, 9 by 9, but still keeping a maximum of 3 iterations.

7Start with the 3rd row down, because that's where it gets interesting right away.
 The first element, (2, 1) is greater than 2 (because (2)^{2} + 1^{2} turns out to be 5) so let's paint that one red, as it escapes the Mandelbrot set on the first pass.
 The second element, (1.5, 1) turns out not to be greater than 2. Applying the formula for absolute value, x^{2}+y^{2}, with x = 1.5 and y = 1:
 (1.5)^{2} = 2.25
 1^{2} = 1
 2.25 + 1 = 3.25, less than 4, so the square root is less than 2.
 So we move on to our second pass, calculating z^{2}+c using the shortcut (x^{2}y^{2}, 2xy) for z^{2} (see Tips for how this shortcut is derived), still with x = 1.5 and y = 1:
 (1.5)^{2}  1^{2} becomes 2.25  1, which becomes 1.25;
 2xy, since x is 1.5 and y is 1, becomes 2(1.5), which yields 3.0;
 This gives us a z^{2} of (1.25, 3)
 Now add c for this cell (add x to x, y to y) yielding (0.25, 2)
 Let's test if its absolute value is now greater than 2:. Calculate x^{2} + y^{2}:
 (.25)^{2} = .0625
 2^{2} = 4
 .0625 + 4 = 4.0625, the square root of which is greater than 2, thus it has escaped after the second iteration: our first green!
 As you become familiar with the calculations, you'll sometimes be able to tell which ones escape the Mandelbrot set just by glancing at the numbers. In this example, the y component has a magnitude of 2, which when squared and added to the squared value of the other number, will be greater than 4. Any number greater than 4 will have a square root greater than 2. See the Tips below for a more detailed explanation.
 The third element, with a c value of (1, 1) does not escape the first pass: since both 1 and 1 when squared is 1, x^{2}+y^{2} is 2. So we calculate z^{2}+c, using the shortcut (x^{2}y^{2}, 2xy) for z^{2}:
 (1)^{2}1^{2} becomes 11, which is 0;
 2xy is then 2(1) = 2;
 z^{2} = (0, 2)
 adding c we get (0, 2) + (1, 1) = (1, 1)
 That's still the same absolute value as before (the square root of two, about 1.41); continuing with a third iteration:
 ([1]^{2})([1]^{2}) becomes 11, which is 0 (yet again)...
 but now 2xy is 2(1)(1), which is positive 2, yielding a z^{2} value of (0, 2)
 adding c we get (0, 2) + (1, 1) = (1, 3), which has an a^{2} + b^{2} of 10, much greater than 4.
 Thus this one also escapes. Color the cell in with your third color, blue, and move on to the next one, since we have completed three iterations with this point.
 The fact that we're using only three colors becomes apparent as a problem here, since something that escapes after only 3 iterations is colored the same as (0, 0) which never escapes; obviously we still won't see anything close to the Mandelbrot "bug" at this level of detail.

8Continue calculating each cell until it has escaped, or you have reached the maximum number of iterations (the number of colors you're using: 3 in this example), at which point you color it. Here's how the 9 by 9 matrix looks after 3 iterations on each square...Looks like we're onto something!

9Iterate the same matrix again with more colors (iterations) to reveal the next few layers, or better, draw up a much larger matrix for a longerterm project! You get more accurate pictures by:
 Increasing the number of cells; this has 81 cells per side. Note the similarity to the 9 by 9 matrix above, but the much smoother edges on the circle and oval.
 Increasing the number of colors (iterations); this has 256 shades each of red, green, and blue for a total of 768 colors compared to 3. Note that you can now see the outline of the wellknown Mandelbrot "lake" (or "bug", depending on how you look at it). The downside is the amount of time it takes; if you can calculate each iteration in 10 seconds, that's about 2 hours for each cell in, or close to, the Mandelbrot lake. Though that's a relatively small part of the 81 by 81 matrix, it would still probably take a year to complete it, even if you worked on it for several hours each day. This is where the silicon type of computer comes in handy.
Advertisement
Community Q&A

QuestionWhy use the absolute value to find C?Community AnswerC is acquired from Zn+1=(Zn)^2+C. Zn is the starting point, which is (0,0i) in this case, so C is always the value of Zn+1. The absolute value is used to check if the point escapes from the set. When it escapes the first time, it is considered Pass 1.

QuestionWhy do I obtain the same results while calculating the absolute values of (1,1) and (1,1), while in the example above (1,1) escapes after 3rd pass and (1,1) after second?Community AnswerIn [1, 1] (i1), the absolute value of the third pass is equal to 2, and it escapes on the pass that it's either equal or bigger than 2, and it's equal to 2. So it goes on the third pass. In [1, 1] (1+i) you calculated it incorrectly.

QuestionIf a cell escapes the second pass, is the cell automatically in the third pass?Community AnswerIf the cell escapes (has a value greater than 2) in the second pass, it is colored in. Any cell that does not escape in the second pass automatically gets a third pass.

QuestionHow do I know what formulas to use? And what color to color them?Community AnswerThis particular formula has been used by Benoit Mandelbrot, but there are a plethora of others. Julia sets, 3D Mandelbrot sets use similar but different formulas. All are based on the same convergence principle. As for the colors, they are perfectly arbitrary, the colormap that you use is based on esthetical rather than mathematical reasons. Get some software for generating Mandelbrot sets and you will see all (or at least many) the possibilities.
Tips
 Why does z^{2} = (x^{2}y^{2}, 2xy)?
 To multiply two complex numbers like (a, b) with (c, d), use the following formula, explained in this Mathworld article: (a,b)(c,d) = (ac  bd, bc + ad)
 Keep in mind that a complex number has a "real" and an "imaginary" part, with the latter being a real number multiplied by the square root of negative 1, often referred to as i. The complex number (0, 0), for example, is 0+0i, and (1, 1) is (1) + (1 * i).
 Still with us? Remember that the a and c terms are real, and the b and d terms are imaginary. So when the imaginary terms are multiplied together, the square root of negative 1 multiplied by itself yields negative 1, negating the result and making it real; whereas the numbers ad and bc remain imaginary, since the square root of negative 1 is still a term of those products. Therefore, we have ac  bd as the real part, and bc + ad as the imaginary part.
 Now, since we are squaring the numbers instead of multiplying two different numbers, this can be simplified a bit; since a = c, and b = d, we have the product as (a^{2}b^{2}, 2ab). And since we are mapping the "complex plane" to the "Cartesian plane", with the x axis representing "real" and the y axis representing "imaginary", we will also refer to this as (x^{2}y^{2}, 2xy).
Thanks!  If you're calculating a cell over and over, and notice a result that is exactly the same as one you already got for that cell, you know you're caught in an endless loop; that cell will never escape! So you can take a shortcut, color that cell with your final color, and skip to the next one. (0, 0) is obviously one of those cells.Thanks!
 Want to know more about judging the absolute value of a complex number without laboring through the calculations?
 The absolute value of a complex number (a, b) is the square root of a^{2} + b^{2}, the same as the formula for a right triangle, since a and b are represented at right angles to each other on the Cartesian grid (the x and y coordinates, respectively). Therefore, since we know that the Mandelbrot set is bounded by the value of 2, and the square of 2 is 4, we can bypass having to think about square roots just by seeing if x^{2}+y^{2} >= 4.
 If either leg of a right triangle has length >=2, then the hypotenuse (diagonal side) must also be longer than 2. If you don't see why this is so, plot a few right triangles on a Cartesian grid and it will become obvious; or just think of it this way: 2^{2}=4, and adding another positive number to that (and squaring a negative number always results in a positive) cannot result in something less than 4. Therefore, if either the x or y component of a complex number has a magnitude of 2 or greater, the absolute value of that number is greater than or equal to 2, and has escaped the Mandelbrot set.
Thanks!  To calculate the "virtual width" of each cell, divide the "virtual diameter" into the "number of cells minus one". We're using a virtual diameter of 4 in the above examples, since we want to show everything within the radius of 2 (the Mandelbrot set is bounded by the value of 2). For the 3sided approximation, that's 4 / (3  1), which is 4 / 2, which equals 2. For the 9sided square, it's 4 / (9  1), which is 4 / 8, which equals 0.5. Use the same virtual cell size for both height and width, even if you make one side longer than the other; otherwise the Set will be distorted.Thanks!
 If you calculate all the cells in the square, you're doing twice the work you should do. A cell's answer is the same answer as the cell reflected over the xaxis's answer because in the first pass, it doesn't matter if y is positive or negative, the answer is always the same. In the second pass, (y+2xy)^2 is the same about y being positive or negative because y is a factor of y+2xy. Third pass is the same because it is similar to the second pass.Thanks!
Warnings
 Mathematics can become very addictive, like anything else, but it probably won't harm your liver or cause lung cancer.Thanks!
References
 The javascript source of these tables, click the cells to calculate z and color them. Note: this will only work in a DOMcompliant browser, not Internet Explorer. If it works in your browser, you can make it display the updated z value for each click by changing display=c in the URL to display=z, and you can "cheat" by clicking Autocomplete. For other options see comments in the source.
 This research was made possible, in part, by a land grant from the City of the Sun though the specifics of the research were not coordinated nor endorsed by COSF.
 The Mandelbrot set
 Rafael Bombelli, one of the first to explain imaginary numbers
 Benoit Mandelbrot
 Imaginary numbers
 Fractals