Friday, March 14, 2014

Pi in the Mandelbrot set

With Pi Day upon us, I am obligated by the Nerd Code to post something relevant to the festivities. Since all the low-hanging fruit has been picked (yes, yes, March 14th is also Einstein's birthday, hoopty-doo) I thought I would tell you about the connection of pi to the Mandelbrot set. This was apparently discovered in 1991 by David Boll at Colorado State University. A description of it appears in Peitgen's big honkin' fractal book, but otherwise the story remains not-so-well known. (Then again, what do I know what is and isn't well known in math circles.)



Brief recap: to generate the Mandelbrot set, you grid up the complex plane, and at a given grid point (call it "c") you iterate the equation z-out = z-in^2 + c, starting with z-in = c. If z remains finite no matter how many times you perform the iteration, then c is in the set and you fill in that grid box. If the iteration blows up, then c is not in the set, and you don't fill in the grid box.

The result looks like this (I made these in MATLAB):


From left to right, the plots use a 10x10, 20x20, 50x50 and 100x100 grid. I left the grid off the last picture because it would have been a mess.

If you want a color plot, then for the points that blow up (i.e., the values of c that aren't in the set) you ask how many iterations it took for them to blow up. Clearly no finite number of iterations gets to infinity, but there's some fancy theorem that states if the iteration ever exceeds max(c,2) in modulus, you can stop: it's not in the set. We call the number of iterations it took before the jig was up the "escape number" of the point.

To get a color Mandelbrot plot, we simply assign a color to each escape number. If you add this twist to your plotting algorithm, you get something that looks like this:


Enter David Boll.

Boll is examining escape values for points located along a vertical line close to the origin (somewhere around the arrow indicated in the above). He discovers the following relationship between the y-coordinate and the escape number of the point:

1 3
0.1 33
0.01 315
0.001 3143
0.0001 31417
0.00001 314160
0.000001 3141593
0.0000001 31415928

The first number on each line is y. The second number is the escape value of the point. If you multiply the escape number of the point by its y coordinate, you get better and better approximations of pi (!)

That there is pretty darn cool. And surprising. And, well, just plain bizarre.

Where does it come from?

If here you think I am going to segue into an explanation of where this comes from, you, Sir or Madam, have a chamber up in the moon. The explanation gets into hardcore complex number theory, which is not something that's "in my wheelhouse" as they say. Remember the mugwump from Naked Lunch? Yeah, that's how I picture people who understand hardcore complex number theory.

But here's an article by Aaron Klebanoff explaining how the whole thing works. Be warned, its a rather technical read. (Disclaimer: I'm sure Aaron Klebanoff is a very nice person and not at all like the mugwump from Naked Lunch.)

And there it is: the connection of pi to the Mandelbrot set.

Happy Pi Day.

image credit: Adam Majewski by way of Wikipedia. Arrow by LabKitty.

1 comment:

  1. I gather stuff about Julia Sets in my blog and have linked to your exciting article about PI.
    Here is my blog.
    http://egilbr.blogspot.no/2017_08_11_archive.html

    Egil Brevik

    ReplyDelete