Mandelbrot Set

The Mandelbrot set comes from one short rule:

zn+1=zn2+cz_{n+1}=z_n^2+c

You pick a number cc, start with z0=0z_0=0, and keep feeding each answer back into the rule. With c=1c=1 you get

0→1→2→5→26→⋯0\to1\to2\to5\to26\to\cdots

and the numbers fly off toward infinity. With c=−1c=-1 you get

0→−1→0→−1→⋯0\to-1\to0\to-1\to\cdots

and you're trapped between those two numbers forever. The Mandelbrot set is all the values of cc that don't fly off.

To draw it, each pixel needs its own cc, and because a pixel has two coordinates, cc needs two parts, which makes it a complex number. Adding cc moves a point sideways and up or down, and squaring multiplies the point's distance from zero by itself and doubles its angle from the line pointing right.1

In the demo below, the ring is cc, the point starts at zero, and each dot is one more use of the rule, so the dots trace the point's route. Once the point crosses the dashed circle, two units from zero, every later jump takes it farther away,2 which means it has flown off. If you move your pointer around the plane, the ring follows it, and some values of cc draw the point in toward one spot, some trap it in a repeat of a few spots, and some throw it past the circle.

Where the point goes for each c

c = (−0.38, 0.56)Still inside after 100 jumps.

Distance from zero at each jump

That gives us a way to draw the set: test the cc of every pixel, and color the pixel black if its point stays inside the circle. Doing that gives the shape below, and every pixel in it still has a route you can follow. The ring starts on c=−1c=-1, so click it to see the repeat from earlier, then pick a pixel near c=0.5c=0.5 on the horizontal axis to see the amber point fly off.

Follow one pixel

Pick a pixel to test it. The point starts at 0. Each jump squares it, then adds the pixel's coordinates.

JumpPoint
0(0, 0)

Benoit Mandelbrot's first printouts of this shape looked dirty, and he blamed his equipment. Some of the specks changed from one print to the next, so those really were dirt. But others came in matching pairs, one at the top and its mirror image at the bottom, which is hard to explain with bad equipment. When he zoomed in on those pieces, they turned out to be smaller, slightly deformed copies of the whole shape.3

The Mandelbrot set drawn in rows of asterisks, with small detached groups of asterisks mirrored at the top and bottom
A copy of Brooks and Matelski's 1978 printout, with the detached specks in mirrored pairs at the top and bottom.

A printout of asterisks can only show a rough outline, so how much detail does the edge really hold? It never runs out: however far you zoom in, the edge is still there, with new shapes in it. Below are a few of the places you can reach, among them a spiral, a star, a thread that forks again and again, and a whole tiny copy of the set.

The Mandelbrot set, with an arrow from each marked place to a deep zoom of it
A thin dark branch that forks again and again1020× closerA ringed spiral made of tiny curls10100× closerThree branches meeting, lined with small stars1030× closerFronds of tiny spirals on a dark ground1022× closerA star whose arms are lined with smaller stars1013× closerStriped arms winding around one small bulb1028× closerCurled clusters crowding around a spiral1026× closerA jagged thread between pale gold and dark brown1018× closerSmall sprays of branches on a pale ground1034× closerLong spokes leaving a small hub1024× closerA tiny copy of the whole set inside colored rings1035× closerCrossing branches along a straight line1014× closer

The deepest is 1010010^{100} times closer. To get a feel for that, if this view were as wide as an atom, the whole set would be far wider than the observable universe. If you click one of these pictures, it opens in the explorer at the top of this page, and you can keep zooming in from there without ever reaching a point where the detail stops.

You might expect shapes this different to need different rules, but every one of these pictures comes from the rule we started with, zn+1=zn2+cz_{n+1}=z_n^2+c. The only thing that changes from pixel to pixel is cc, and near the edge, values that fly off and values that don't sit right next to each other at every scale, so the smallest change in cc can give a completely different route.

You might wonder how the computer decides which pixels to paint black. A number belongs to the set if its point never crosses the dashed circle, and a computer can't wait forever to find out that something never happens. If the point crosses the circle, we know for sure that it has escaped. But if it's still inside after 300 jumps, it might cross on jump 301, so the computer has to give up at some point and paint the pixel black anyway. That means a black pixel only tells you the point hasn't escaped yet.

The next demo adds more information by coloring each escaped pixel according to how many jumps it took, so any colored pixel is definitely outside the set. The colors repeat every 40 steps, so one color can mean step 30 or step 70.

The slider sets how many steps the computer tries before giving up. In Whole set, more steps turn black pixels into colored ones until the heart and the bulb appear.

To see how wrong black can be, look at Spiral, a tiny part of the edge near the narrow neck where the bulb meets the heart. If the computer tries 200 steps, you get round black dots that look like small bulbs of the set. If it tries 1000 steps, almost all of those dots turn to color, so those points were outside the set all along and 200 steps wasn't enough to catch them. The dark band across the middle looks black at every step limit, but those pixels escaped at about step 40, and the color for step 40 happens to be nearly black.

If you switch to Black and white, white pixels have escaped and black pixels haven't, and at high step counts the black is left as specks that look like separate islands. But it has been proved that the set is all one connected piece,4 so something must join those specks. You can't see it because each pixel tests only one point, and the parts doing the joining are so thin that those test points almost always miss them.

Give the computer more steps
Not escaped yet. It might be in the set.
Escaped, so outside the set. Color shows the step:
040 steps, then the colors repeat

You might wonder how high a step limit would have to be to catch everything, and the neck shows that no limit is high enough. Start at −0.75-0.75, where the bulb meets the body, and move straight up. A point 0.10.1 above it crosses the dashed circle after 33 steps. A point 0.010.01 above it takes 315 steps, 0.0010.001 above takes 3143, and 0.00010.0001 above takes 31417. The closer you get, the longer it takes.

There's something odd about those counts. If you multiply each one by its distance, you get 3.33.3, 3.153.15, 3.1433.143, 3.14173.1417, which seem to be heading for π.5 Nothing in this calculation looks like it should involve π.

The parts of the black shape also differ in what the point does there. Inside the heart-shaped body, it settles toward one value,6 and inside the round bulb on the left, it gets trapped in a two-number repeat, like the 0,−10,-1 at that bulb's center. The big bulbs above and below the heart give a three-number repeat, and smaller bulbs give other lengths.7 If you follow these lengths along the horizontal axis, you get the branching picture of the logistic map.

So far, every calculation has started at zero, and the only thing that changed was the number we add. You could just as well do the opposite: keep cc fixed and try every point of the plane as the starting point. Some starting points fly off and others don't, and the edge between those two groups is called the Julia set of that cc. Changing cc changes the rule, so it moves the edge too, which means every point of the plane, inside the Mandelbrot set or not, has its own Julia set.

In the demo below, the ring on the left picks cc, and the right side shows every starting point for that cc: the colored ones escape, with the color giving the number of jumps, and the dark ones don't. The ring on the right picks one starting point and draws its route. The demo begins at c=−1c=-1, the repeat from earlier, where the Julia set is the edge of the dark shape. A point starting at 0.50.5 gets drawn into that same repeat of 00 and −1-1, so it lies in the dark shape, and if you drag the ring to the right along the axis, past about 1.621.62, the point flies off instead, because you've crossed the Julia set.

Each value of c has its own Julia set

Drag the ring in either picture.

Mandelbrot · choose c

c = (-1, 0)

Julia · follow a starting point

(0.5, 0)

We've been loose about one thing, and it's worth getting right, because the picture on the right isn't really a picture of the Julia set. Mathematicians split the starting points of a rule into two groups. A point belongs to the Fatou set if it and all the points close enough to it behave alike, such as a patch of points that all fly off, or the points in the dark shape at c=−1c=-1, which all get drawn into the repeat of 00 and −1-1. The Julia set is everything else: the points where, however closely you look, the neighbors around them do different things.8 That's why it's the edge, because right next to any point of it there are points that fly off and points that don't.

Now think about what the computer does to draw this. It tests one point for each pixel and colors the pixel by what that point does. If the point escapes, it's in the Fatou set, and at c=−1c=-1 the dark pixels are in the Fatou set too, because their points get drawn into the repeat. This Julia set has no area, like most you'll come across,9 so a test point almost never lands on it. So what we paint is the Fatou set, and the Julia set is the one thing we never paint. We only see where it is because the pixels on either side of it disagree.

So when you hear these colored images called Julia sets, or the dark shape called the Julia set, the words are being used loosely: the dark shape with its edge is the filled Julia set, and the Julia set is only the edge. The bands of color aren't part of it either, since they only record how many jumps it took to cross the dashed circle, and a bigger circle would move every band while the edge stayed exactly where it is.

The difference matters most at Fork, c=(0,1)c=(0,1), where zero's route lands on a repeat that pushes nearby points away. There the picture has no dark shape at all: every starting point that doesn't escape lies on the Julia set, which is a tree of thin threads, so any dark pixels you see there only mean the point hasn't escaped yet.

The Mandelbrot picture isn't a picture of either set, because Fatou and Julia sets are about the starting points of one rule, and every point of the Mandelbrot picture is a different rule. A picture like that, where each point stands for a whole rule, is called a parameter space.

The two kinds of picture ask different questions, so you wouldn't expect them to have much to do with each other, and zoomed out they don't look alike. But zoom in at the right value of cc and they turn into the same picture. Fork is one of those values: zero's route goes to (0,1)(0,1), (−1,1)(-1,1), (0,−1)(0,-1), (−1,1)(-1,1), (0,−1)(0,-1), and repeats those last two forever.

Both pictures below are centered on cc and use the same colors,10 and the right one is also turned and scaled by the amounts shown under it. As you raise the zoom, the two Fork pictures look the same by about ×200.

Zoom in on c in both pictures

Mandelbrot set

Julia set for c

c = (0, 1). Right picture turned 27° counterclockwise and scaled ×1.12.

To see why they match, take a point close to cc in each picture. On the left, that point means adding a number slightly different from cc, and on the right, it means starting slightly away from cc. Either way the first stop is a tiny distance from cc, so both routes follow zero's route for a while, and that tiny distance grows with every jump until the point breaks away and escapes. The color counts those jumps, so nearby points get matching colors. The left one does add its slightly wrong number at every jump instead of only once, but the first difference has the most jumps to grow, so the later ones barely change the total and together they act like one difference of a slightly different size and direction. Undoing that is what the turn and the scale under the pictures are for.11

Tan Lei proved in 1990 that the two pictures get ever closer as you zoom in, at every cc where zero lands exactly on a repeat it did not start on,12 and any stretch of the Mandelbrot set's edge, however short, contains values like that.13 So all along the edge, there are places where zooming in shows you a Julia set. The Mandelbrot picture does also hold tiny black copies of the whole set, which these Julia sets don't have, but the copies shrink faster than their distance to cc, so they get too small to see as you zoom.12

All of this came from one rule, z2+cz^2+c, so you might think the shape belongs to that rule. To see that it doesn't, take Newton's method, which finds where a polynomial pp reaches zero by repeating z→z−p(z)/p′(z)z\to z-p(z)/p'(z) on a first guess. It nearly always arrives at a root, but it doesn't have to: for z3−2z+2z^3-2z+2, the guess 00 goes to 11 and the guess 11 goes back to 00, and guesses close to them are drawn into that repeat and never reach a root. So how common are polynomials like that?

To answer that we need two pictures, and they're the same two we had for z2+cz^2+c. The first is about one polynomial: if you try every first guess and color it by the root it reaches, leaving it black if it reaches none, you can see whether that polynomial traps any guesses. This is its version of the picture of a Julia set: the colored regions are the Fatou set, and the Julia set is the boundary between them.

The second is about all polynomials at once, and it's the version of the Mandelbrot picture. If we fix two roots at −1-1 and 11 and let the third root tt be anywhere, we get the polynomials p(z)=(z2−1)(z−t)p(z)=(z^2-1)(z-t), one for each point of the plane, and we want one color for that point that says whether its polynomial traps guesses.

You'd expect to have to try every guess to find that out, but one is enough. Fatou and Julia proved that a repeat that draws points in always catches the route from a place where the rule's slope is zero.8 That is why the Mandelbrot test starts at zero, because the slope of z2+cz^2+c is 2z2z, which is zero only at zero. Newton's rule has a zero slope at the three roots and at one other place, the average of the roots.14 The route from a root stays at that root, so if any guess gets trapped, the guess at the average does too, which means that guess alone can choose the color.

In the demo below, each point on the left is one polynomial and the ring picks one. The right side shows what that polynomial does to every first guess, with its roots circled and the average as a white dot. The color under the ring is always the color under the white dot, and that's all the left picture is. Each root has its own color, and the shade shows how many jumps a guess needed. The small pictures underneath are places worth visiting, and clicking one flies there.

The whole family, and one member of it

z → z − p(z)/p′(z), where p(z) = (z² − 1)(z − t)

All polynomials · pick the third root t

That polynomial · every first guess

t = (0.81, 0.84), zoom ×1. From the white dot, the route gets trapped in a repeat of 2 places.

Click to move the ring, drag to pan, pinch or click and scroll to zoom.

Zoomed out, the left picture has hardly any black, which is good news if you want to find roots, because it means guesses rarely get trapped. But if you zoom toward one of those black specks, you get the heart, the round bulb and the threads, in a question about the roots of cubic polynomials. The right side changes with it, because small black patches appear among the first guesses, and those are the guesses that never reach a root. It behaves like the Mandelbrot set too: in the heart of the first small picture, the guess gets trapped in a repeat of 2, and if you move the ring into the bulb, the repeat doubles to 4, just as the Mandelbrot set goes from one place in its heart to two in its round bulb. The other small pictures are copies elsewhere in the plane, at different sizes, turned different ways, with repeats of their own lengths.

So which other fractals could we build this way? The recipe never used anything special about Newton's method: take a rule with one number you're free to change, start the route at a place where the rule's slope is zero, and color each value of that number by what the route does. The buttons above the demo are a few rules you can try this on, each written out underneath them. All of them are holomorphic, which means that if you zoom in far enough around a point, the rule just scales and turns everything around it, and that's the property the shortcut above depends on. The Mandelbar set mirrors the point at every jump, so it isn't holomorphic, and none of this applies to it directly.

Each of these rules looks different when you zoom out, and yet the same shape turns up inside all of them. Curtis McMullen proved that this isn't a coincidence: in any family of rules made by dividing one polynomial by another, tiny copies of this shape are packed so closely along the boundaries where the behavior changes that any stretch of a boundary, however short, contains one.15 The rules csin⁡zc\sin z and ccos⁡zc\cos z aren't of that kind, but they have copies too.

How exact are these copies? None of them is perfect, and that includes the copies inside the Mandelbrot set itself, which is what "slightly deformed" meant earlier. To put a number on it, you can scale a copy to the same area as the Mandelbrot set, center it, turn it until the two line up as well as they can, and divide the area they share by the area they cover together. That's the match under each small picture.16 The Mandelbrot set's own copies here reach about 90%, and the closest we found reach 96%, in csin⁡zc\sin z, ccos⁡zc\cos z and the magnet rule.

Further exploring

Videos

Reading

Sources and notes

  1. Introduction to Complex Dynamics.
  2. Calculation: if ∣z∣>2|z|>2 and ∣z∣≥∣c∣|z|\ge|c|, then ∣z2+c∣≥∣z∣2−∣c∣≥∣z∣(∣z∣−1)>∣z∣|z^2+c|\ge|z|^2-|c|\ge|z|(|z|-1)>|z|. A crossing gives ∣z∣≥∣c∣|z|\ge|c|: either ∣c∣≤2|c|\le2, or the first jump lands on cc.
  3. Development of the Mandelbrot set; 'dirt' in the picture.
  4. Exploring the Mandelbrot Set: The Orsay Notes.
  5. Pi in the Mandelbrot set everywhere. Its proof follows curved paths into the neck. Along this straight line, the pattern has only been observed.
  6. Local Connectivity of Julia Sets and Bifurcation Loci: Three Theorems of J.-C. Yoccoz.
  7. Rotation Numbers and Internal Angles of the Mandelbrot Bulbs.
  8. Dynamics in One Complex Variable: Introductory Lectures. Section 3 defines the two sets, and Lemma 10.2 says a repeat that draws points in catches a place of zero slope.
  9. Quadratic Julia Sets with Positive Area. Values of cc with positive area do exist, but c=−1c=-1 is not one of them.
  10. Diagram construction: the Mandelbrot count includes the first jump, from zero to the number being tested. A starting point in the right picture is already there, so that picture adds one to its count.
  11. Calculation: a point dd away from cc in the left picture matches a point wdwd away from cc in the right picture, where w=lim⁡n→∞∂zn/∂c∂zn/∂z1w=\lim_{n\to\infty}\frac{\partial z_n/\partial c}{\partial z_n/\partial z_1} along zero's route. This equals the sum of 1/(∂zk/∂z1)1/(\partial z_k/\partial z_1) over k≥1k\ge1, whose terms are the errors. At c=(0,1)c=(0,1) their sizes are 11, 0.50.5, 0.180.18, 0.0880.088, and so on, each turned differently, and w=0.8−0.4iw=0.8-0.4i.
  12. Similarity Between the Mandelbrot Set and Julia Sets. Theorem 5.1 states the match, and section 6 gives the sizes of the small copies.
  13. Misiurewicz point.
  14. Calculation: the derivative of z−p/p′z-p/p' is pp′′/p′2pp''/p'^2. It is zero where p=0p=0 and where p′′=0p''=0. For a cubic, p′′=0p''=0 only at the average of the three roots.
  15. The Mandelbrot set is universal. In some families the copies come from zd+cz^d+c with a higher power dd.
  16. Calculation: measured on pixel grids of the black shapes in this demo, largest connected piece only, so the thinnest threads don't count. An overlap is also called intersection over union.