Stories about Fractal Plotting
The Divergence Scheme
The Convergence Scheme
Mandelbrot Fractals
Julia Fractals
Newton Fractals
Basic 3D Fractals
Speaking loosely without technical terms such as the HausdorffBesicovitch dimension, a fractal is a geometric shape that is selfsimilar, i.e., a large part of it contains a great many smaller parts that resemble the large part in some way; see Figure 1 below. Nature is filled with fractals as seen in such objects as mountains, shorelines, trees (branches, barks and roots), ferns, fluid flow patterns, cloud formations, blood vessels and mycelium strands. Benoit Mandelbrot coined the term "fractal" in 1975 and published a book entitled "The Fractal Geometry of Nature" in 1982.
The idea of fractal was not particularly new for the computer age as some mathematicians like Cantor already conceived it in the 19th century. About a hundred years ago, a group of mathematicians represented by Pierre Fatou and Gaston Julia studied certain fractals generated by socalled "dynamical systems," and about fifty years later Mandelbrot plotted the "Mandelbrot set" using a computer and a simple dynamical system. The novelty, beauty and complexity of the computergenerated fractal reinvigorated and stimulated mathematicians to develop further theories in fractal geometry.
On the other hand, "chaos," often associated with fractals, was basically born as a brand new subject in 1974 from biologist Robert May's computer simulations of population dynamics through the dynamical system called "logistic equation," although some chaosrelated phenomena such as the sensitivity to a small change in the initial condition that might cause a hugely unexpected outcome or the "butterfly effect" had been observed earlier by some mathematicians and physicists. "Chaos" received great sensations when American Mathematical Monthly published "Period Three Implies Chaos" by T.Y. Li and James Yorke in 1975. Younger mathematicians were especially excited to see the fact that there appeared very little difference between chaotic and random outcomes even though the former resulted from the deterministic process through the logistic equation. It is now known that fractals together with chaos provide not only mathematical insights into natural objects and phenomena but also surprisingly many applications in sciences, mathematics and art.
Through
Google we can find lots of Internet fractal galleries, many of which display stunningly beautiful computergenerated fractal art images. This indicates that a large population not only appreciates the digital art form but also participates in the eyeopening creative activity. Written below is a guide on how to program a computer and plot popular types of fractals that are tied to chaos. Because of chaos involved, a slight change in input values (intentional or accidental) may greatly affect the pattern of the fractal output and this unpredictability provides an added excitement while running the computer program. The subject is kept less formal and mathematical with light topics added here and there so as not to be cutanddried. The audience, who may be merely intrigued by the general idea behind fractal plotting, is encouraged to try it. Although the basic process is not based on higher mathematics, it certainly takes intelligence and patience to get successful outcomes. The experience may at some point start to stir the participants' deep imaginations in the part of mathematics that is in fact quite profound. Best of all, though, it is plain fun.
Each of the fractals we discuss here is generated by a single equation and may be classified into one of the three categories, which I call Mandelbrot, Julia, and Newton fractals. The prerequisite for the subjects is to know (1) fundamental algebra and geometry of complex numbers, (2) beginning calculus, and (3) basic computer programming in such language as Java in a graphics mode. I use a modernized "objectoriented" version of Pascal called Delphi marketed by Borland. (1) includes the practice of writing a complex number z as a point (x,y) in the xyplane as well as the standard algebraic expression z = x + yi. At the outset of each plotting process, we choose a rectangular canvas, part or whole of which will appear in the computer's display screen and which will be filled with a fractal at the end. The canvas comprises finitely many small rectangular picture elements, a.k.a. pixels. One of the basic routines in (3) (usually given in a programming manual) is a simple change of coordinates based on the "pointslope" equations of lines, which allows us to convert the canvas to a rectangular region R in the xyplane consisting of points, er complex numbers (x,y). As in a basic graphics calculator routine, four real numbers called xmin, xmax, ymin, and ymax bound R.
For the sake of simplicity in our argument, we will identify each pixel in the canvas and the corresponding complex number in R, and consequently, regard the canvas and R to be the same. In particular, the number of complex numbers in R is finite so a computer can deal with "all" of them. Also, at the beginning of the process, we choose an equation such as z_{n+1} = z_{n}^{2} + p involving two indexed variables and the third variable p called a parameter. After following the program, the computer will light up each pixel (complex number) in the canvas with a color determined by a simple interaction between the complex number (the pixel) and the equation and eventually display a fractal image on the canvas. Here comes an example:
(A) The Divergence Scheme
We begin our discussion with a small rectangular region R comprising 300 x 300 = 90,000 pixels in the xyplane
bounded by say xmin = 2.1, xmax = 2.1, ymin = 2.1, and ymax = 2.1 and the equation
(*)
z_{n+1} = z_{n}^{2} + p ,
called the Mandelbrot equation, where the parameter p is a complex number identified with a pixel in our canvas R.
The bestknown figure in fractal geometry is given by iterating the Mandelbrot equation using the initial value z_{0} = (0, 0) for n = 0, 1, 2, ... , M, and for "every" parameter p in R. Here, M is a prescribed maximum number of iterations that rescues the computer from getting trapped in an infinite loop, and M = 500 is used in this example. M is almost always a number between 50 and 500,000 but it occasionally gets as large as 2,000,000 in my program especially when I plan to print out a highresolution picture that requires millions of pixels.
Assuming that our object is to plot a picture in black and red with a background or canvas color say white, our painting scheme is basically given by the IF statement:
If
z_{1} > 2 then color the pixel p black,
else if z_{2} > 2 then color the pixel p red,
else if z_{3} > 2 then color the pixel p black,
else if z_{4} > 2 then color the pixel p red,
etc.,
where z_{n} stands for the modulus or absolute value of z_{n}. It can be shown that z_{n} > 2
for some n if and only if the sequence z_{n} tends
to infinity as n increases; this implies that the above scheme assigns a color to each pixel p according to how quickly the complex number z_{n} escapes from the circle of radius 2 before taking a long journey toward infinity. This basic scheme can be streamlined in the actual program by using:
just two variables zold and znew instead of the large array z_{0} , z_{1} , z_{2} , ...;
z_{n}^{2 }> 4 in place of z_{n}
> 2 to avoid the hidden square root operation; and
MOD operation to simplify the awkward and repetitive blackred coloring scheme.
Also, the use of any radius greater than 2 (say 100) in place of 2 in the above scheme works just as well and in some cases even better. Computer programming has two faces, art and science, and requires artful wits as well as rigidly logical thinking. Writing, streamlining and debugging computer programs, therefore, provide us with an ideal way of exercising our brain and maintaining normal connections among the neurons. I would recommend it highly to people with computers to take up computer programming. (It's in a way funny to say it because people used to get near a computer only to run their computer programs.)
Observe that for each pixel value p, we have a sequence of complex numbers z_{n} , n = 0, 1, 2, ..., which moves about the complex plane, and for this reason, a generating equation like (*) is called a dynamic mathematical system or dynamical system. We may view a dynamical system as the collection of the sequences z_{n }, one sequence for each choice of p in the canvas where the initial value z_{0 } is fixed at a single value (like 0 in the current example) for all of the sequences. (Later we will consider a dynamical system consisting of the sequences where the initial value z_{0 } varies in the canvas while the parameter value p is fixed at a single value for all of the sequences.)
As we noted, the color of a pixel is determined according to the "escape speed" of the corresponding sequence z_{n} , n = 0, 1, 2, ..., from a prescribed circle about the origin. Since all of the escaping sequences diverge to infinity, I call the coloring scheme (without limiting a number of colors) the divergence scheme. Figure 2 is given by the above basic redblack divergence scheme, and the area that retains the white canvas color depicts the famous Mandelbrot set or M set, for short. The set consists of the pixels p attached to the sequences z_{n }that stay within the circle forever regardless of the value of n. If we alter the values of xmin, etc. and run the same program to zoom in on a small area of the plot near the boundary of the Mandelbrot set, we will discover the selfsimilarity property of fractals along with a hairy characteristic of the "snowman". Many microscopic shapes resembling the snowman are connected by an extremely intricate network, which we can find by zooming intently and patiently. For example, the Mandelbrot Set in Gallery I is given by a microscopic rectangular neighborhood of the point
(0.25000316374967, 0.00000000895902) ..... whew!
Looking at the picture, it is not surprising that it has been verified that the Mandelbrot set is one of the most complex figures ever plotted on a plane.
Here is the very essence of our fractal plotting:
The closer the zoomed area is to the boundary, the finer the fractal pattern.
The reason, which leads us to the idea of chaos, is that parameters p near the boundary belong to the sequences
z_{n }with diverse properties interlaced in a complex fashion. Thus, a very slight change in the value of p in this area may result in an utterly different "future behavior" of the corresponding sequence z_{n }which dictates its escape speed and the pixel color. Yes, these sequences z_{n } are just like people, most of whom would behave unpredictably when they are placed near an infernal border between life and death and cause chaos for the whole population in the area. What is interesting in mathematics is that chaos near the border between life (staying within the circle) and death (diverging to infinity) stems from an innocentlooking equation such as (*) and instead of ugly consequences it often produces beautiful fractal patterns. You might remember that Steven Spielberg's Jurassic Park premiered in 1993 includes a mathematician who introduced himself as a "chaotician." A chaotician obviously deals with chaotic behaviors of various dynamical systems including the Mandelbrot equation (*).
It was in fact around the 1970s and the early 80s when several significant events coincidentally took place in mathematics: (a) People saw the computergenerated epochmaking Mandelbrot set for the first time, invigorating fractals. (b) The new field called "chaos" was born from a computer experiment and generated a great sensation. (c) Powerful computers found their way to become main tools among theoretical mathematicians who used to pride themselves on using only pencil and paper to discover recondite theories. Like in chemistry and physics, experimental investigations became important part of mathematics. (d) Apple Inc., established in a garage, produced and marketed desktop computers for the first time in the world and soon IBM followed suit with then budding Microsoft. Also a small company called Nintendo grew large as its "Pacman" became a great hit and invaded mathematicians' offices with desktop computers often munching out their office hours.
(B) The Convergence Scheme
The divergence scheme leaves the Mandelbrot set stuck with the canvas color since none of the parameters in the set are attached to escaping sequences. Among those sequences that stay within a finite range, many converge to a point in the set with varying speeds. We can therefore colorcode each of the pixels in the Mandelbrot set according to the speed of convergence of the corresponding sequence. This convergence scheme is based on socalled Cauchy's criterion and given by replacing z_{n} > 2 of the divergence scheme by
z_{n+1}  z_{n} < e
where e is a small number like 10^{10} x (minimum of {xmaxxmin, ymaxymin}). Incorporating the convergence scheme and a greater number of colors into the earlier program may result in a picture like Figure 3. The gold area consists of the pixels attached to the convergent sequences while the green disks are associated with the sequences that eventually become almost periodic of period greater than one. These virtually periodic sequences neither converge to a point nor diverge to infinity, but one can still colorcode the accompanying pixels in a similar fashion and add more colors to the image provided that their period is known.
(C) Mandelbrot Fractals
Since it was published in 1980, the Mandelbrot set became so popular that zillions of digital artists, mathematicians, and computer programmers and hackers have explored around it and shown their fractal images on a variety of objects including web pages, posters, book covers, Tshirts, and coffee mugs. Although the complexity of the M set is boundless and the hidden beauty inexhaustible, it has become quite a challenge to unearth new patterns from the Mandelbrot equation (*) using available computers and software with certain limitations. Consequently, creative work calls for modification of this formula, and there are infinitely many formulas available for this purpose. I call a fractal given by the divergence/convergence schemes applied on a dynamical system of the form
(**)
z_{n+1 }= f_{p}(z_{n})
a Mandelbrot fractal, where f_{p} is a function of complex numbers that contains a parameter or pixel p. For example, we may find Mandelbrot fractals using the logistic equation
z_{n+1 }= f_{p}(z_{n}) = p(1  z_{n}) z_{n }.
An initial value z_{0} is usually chosen from the socalled critical points of the function f_{p} , at which the derivative vanishes, because it provides us with a better chance for a good output, but it is not mandatory from an artistic viewpoint. Just do a lot of experiments because our computers are really good at it. As you can see in the picture Logistic Equation, a noncritical initial point like z_{0} = (0.1,0) gives us certain deforming effect. The picture also shows a substantial difference between the logistic and Mandelbrot equations even though the two equations are known to be very close relatives and conceal similar fractal patterns. From the logistic equation restricted to just real numbers the term chaos was born in 1974. The primary application of the logistic equation lies in population dynamics, which explains why the chaotician got into Jurassic Park always looking worried.
(D) Julia Fractals
A fractal, which I call a Julia fractal, is given by fixing the parameter value p in the dynamical system (**) and
iterating it for every choice of the initial value z_{0} (instead of p in plotting Mandelbrot fractals) in the rectangular region R (which is our canvas). Thus, z_{0} plays the role of a pixel in the canvas. As in the earlier case, a Julia fractal appears more interesting when the parameter value p is chosen from the area of the corresponding Mandelbrot fractal showing the sign of chaos. A Julia fractal with an appropriate p value contains what appears to be the boundary between two sets, one consisting of every z_{0} which keeps the sequence z_{n} within a fixed circle and the second set consisting of every other z_{0}. The boundary is called a Julia set, which is closely related to the idea of chaos and can have a complex topological structure. Gatekeepers in Figure 1 above, for example, is a Julia fractal given by
z_{n+1}= z_{n}^{3} + z_{n} + p,
p = (0.185, 0.00007666),
on the rectangular region with xmin = 1.1, xmax = 1.1, ymin = 0.7, and ymax = 0.7. The gatekeepers are painted by the convergence scheme with various shades of gold and the red background by the divergence scheme; thus, the Julia set in this pattern is the outline (or the boundary) of the gatekeepers. Once you find a value of p yielding a nice Julia fractal, change the value slightly to see if you can improve the picture while retaining the same motif. The corresponding change in the picture sometimes appears gradual and sometimes quite dramatic as you can see in
Julia Dragons in the main gallery.
(E) Newton Fractals
What I call a Newton fractal is a Julia fractal given by a dynamical system of the form
z_{n+1 }= z_{n}  g(z_{n})/g'(z_{n})
where p = 0 is invisible and g is an elementary function with its derivative g'. Although g is a function of a complex variable, the familiar rules of differentiation in high school calculus hold for g. In my program, g is almost always a polynomial which allows me to take advantage of the timesaving scheme called Horner's method to efficiently and repeatedly evaluate both g and g' that appear in the dynamical system. Horner's method is nothing but "synthetic division" taught in high school algebra, and it should be interesting for you to see how (differently) it is applied in computer programming. Furthermore, as you may have recognized, the dynamical system is, in practice, Newton's RootFinding Algorithm, and as such, each sequence converges to a root of the polynomial g quickly more often than it converges slowly or diverges. For this reason, I usually use the convergence scheme alone and a relatively small maximum number of iterations such as M = 500 to process a Newton fractal instead of between 500 and 2,000,000 for Mandelbrot and other Julia fractals. An interesting Newton fractal is a fractal that contains at least a part of the Julia set, which ironically causes a chaotic behavior of the otherwise extremely useful rootfinding algorithm.
Figure 4 above is a Newton fractal over the unit disk of the complex plane given by the polynomial
g(z) = z^{3}  1
and the "advanced" convergence scheme, which utilizes the (known) three roots to make the number of colors increase threefold; see Newton's Basins of Attraction in Gallery I. Arthur Cayley, one of the great mathematicians of the 19^{th} century, understood the complex nature of Newton's algorithm but apparently not to the extent of hidden chaos near the Julia set (which is precisely the borders between essentially different colors) in Figure 4. He was frustrated by a geometric problem he posed, which turned out to be equivalent to sketching the threecolor Newton fractal (without the variations in lightness) by hand on a paper.
The above example shows that in order to appreciate the true beauty of a Newton fractal, we should have the roots of the polynomial available before plotting it. The handy tool belongs to college math, however, and is called "Müller's algorithm," by which we find all the roots of a polynomial without running into problems like we do with occasionally chaotic Newton's method.
(F) Basic 3D Fractals
As we know by now, each pixel color is determined by the number of iterations the corresponding sequence experiences before escaping from a circle of a prescribed radius or before getting sufficiently near a fixed or periodic point in the complex plane or hitting the maximum number of iterations. This number, say w, of iterations adds one more dimension to the complex number (pixel) that already has two dimensions (x, y). Thus, each pixel is in a threedimensional (3D) xywspace and plotting them sometimes provides us with an interesting 3D picture.
When a dynamical system becomes highly chaotic (which is generally good in 2D plotting), however, the variation on the altitudes w may get too noisy (or busy) and produce a messy picture. In that case, we may suppress the noise by using say log w instead of w. Such experiments are important in fractal plotting and should always be fun.
Once we get accustomed to plotting a fractal on a plane, we may attempt to paint it on various surfaces such as a sphere; see the example below.
