The magazine of the Melbourne PC User Group

Introduction to Mandelbrot and Julia Sets
Ian McDowell

Serious computer users usually give first priority to their applications, then to games, then to mathematical recreations. Probably Mandelbrot is the most popular of these last, because it is easy to understand and produces the most spectacular on-screen results. Various programs of differing sophistication exist in the public domain. This article summarises the most important facts in order to help readers to decide what the worth-while features of such a program are. 

The Mandelbrot set (named for researcher Benoit B. Mandelbrot) is the set of all complex numbers c (x+i*y, where x and y are real numbers and i is the square root of minus one), where:

  • the sequence c is formed from the repeated calculation c*c+c
  • the value of c remains finite after an indefinitely large number of such calculations

This sort of thing will be vaguely familiar to those who have used Newton's iterative method of solving polynomial equations. 

The set is of infinite extent, but its core may be displayed on a computer screen where:

  • the field is from -2.0 to 0.5 on the real (x) axis, and from -1.25 to 1.25 on the imaginary (y) axis
  • the co-ordinates of each pixel provide the x and y values of c
  • each pixel is coloured according to whether or not the complex number corresponding to its co-ordinates falls within the Mandelbrot set
T he remainder of the set extends to infinity beyond this field. It consists of filaments and areas similar but not identical to, and smaller than the core. The number of iterations required to establish probable divergence is called the dwell. 

The fascination of the Mandelbrot set arises in the following ways:

  • in most of the complex plane, divergence is established with a small dwell value (say less than ten) and a modulus of c (x*x+y*y) less than four
  • at the boundaries of the set, however, as we might expect, the number of iterations required to establish divergence rises sharply (say up to and beyond one thousand), and these produce the interesting screens
  • over all pixels on such a screen, the dwell values form a frequency spectrum with concentrations around multiples of eight
  • if pixels are coloured so as to discriminate between nearby dwell values where high concentrations occur, then intricate and beautiful patterns emerge on the screen
These patterns display what are called fractals. They appear to be infinite in extent. The order which arose from apparent chaos took the first researchers in this field by surprise, and we may repeat their same sense of awe. 

Mandelbrot programs permit any area of the complex plane to be examined, however small, and however distant from the core set, subject only to the limitations of the computer. Magnifications far greater than those of the electron microscope are possible. Enthusiasts use them when exploring filaments and distant nodes. They discover the same complex, compelling mixture of order and chaos wherever they look. 

The Mandelbrot set is a special case of the Julia set, which was named 75 years earlier for the mathematician Gaston Julia. It is the set of all complex numbers z formed by iterating z where z is formed from z*z+c, as before, and:

  • z and c are numbers in the complex plane
  • on-screen pixels are defined by z, and are coloured according to their dwell values, as before
  • c is the same for the dwell calculation at each new pixel
  • Julia set plots are most interesting when c is selected just outside the boundary of the Mandelbrot set; they are of complexity comparable with that of the Mandelbrot set at such c values
  • it happens that the whole of any Julia set falls within the boundaries defined by plus or minus two in either real or imaginary directions
  • plots are connected for c values within the Mandelbrot set, but fragmented outside it
There are other dimensions to Julia set studies, but this article confines itself to those of special interest to PC users. In general, details of the Mandelbrot set boundary attract the greater interest. The relation between Mandelbrot and Julia sets has practical significance in the study of electrostatic fields. Generation of such complexity from a simple sequence hints tantalisingly at biological applications. 

Probably the best known references to Mandelbrot and fractal geometry are about ten computer recreations articles in the 'Scientific American' between April 1978 and July 1989 (the key one was A.K. Dewdney's in August 1985). Mathematicians will enjoy 'The Beauty of Fractals' of H.O. Peitgen and P.H. Richter (Springer-Verlag, New York, 1985) with its marvellous pictures. A recent work available in Melbourne is entitled more or less appropriately 'Chaos, Making a New Science', J.Gleick (Viking, New York, 1987). 

Two of many available programs are Theron Wierenga's and the Odhner Corporation's shareware. They compute and save the dwell values for all pixels on a given screen, and reproduce them on demand from files of up to say 300 kB. Wierenga's is menu driven and provides for a dwell frequency plot and masks which assign colours to pixels according to dwell values, which is vital. But its maximum dwell is 512, which is insufficient for close study of the Mandelbrot set boundary. Its square screens are defined by the co-ordinates of the bottom left hand corner and the length of side. Odhner allows the next area of study to be defined on-screen for any plot, and does not limit maximum dwell values, but lacks a dwell frequency plot, and therefore fails to resolve large areas of interesting detail. An optimum program might combine the best features of these. 

Obviously Mandelbrot set images display best on a high resolution screen. But be warned. At dwell values averaging about 500, a PC running at 21 Mhz takes about sixteen hours to generate a VGA screen using Wierenga's program.

Reprinted from the Jan/Feb 1990 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]