Live data from Hacker News

Vintage-Style Map of the Mandelbrot Set

kottke.org

11–20 of 27 posts

Re: Vintage-Style Map of the Mandelbrot Set

#11

Very cool! I just finished a for-fun mandelbrot drawing program; I was familiar with the image, but I had never delved into the math. It's an extremely simple algorithm, which makes it that much more surprising it creates so much complexity.

I never understood how the algorithm could be so simple, using just IEEE floats (https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Ma...)

These programs do thousands of iterations. How does one prove that the images show the Mandelbrot set and not some artifact of issues with numerical stability?

Re: Vintage-Style Map of the Mandelbrot Set

#12
post #11

Very cool! I just finished a for-fun mandelbrot drawing program; I was familiar with the image, but I had never delved into the math. It's an extremely simple algorithm, which makes it that much more surprising it creates so much complexity.

I never understood how the algorithm could be so simple, using just IEEE floats ( https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Ma... ) These programs do thousands of iterations. How does one prove that the images show the Mandelbrot set and not some artifact of issues with numerical stability?

You can run it with BigDecimals or whatever unlimited number type your language has just fine, and it will give a very similar looking image.

Re: Vintage-Style Map of the Mandelbrot Set

#13
post #12
post #11

Earlier quoted context omitted.

I never understood how the algorithm could be so simple, using just IEEE floats ( https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Ma... ) These programs do thousands of iterations. How does one prove that the images show the Mandelbrot set and not some artifact of issues with numerical stability?

You can run it with BigDecimals or whatever unlimited number type your language has just fine, and it will give a very similar looking image.

That doesn’t help in understanding why this thing is numerically quite stable. It only gives some confidence that it is.

Re: Vintage-Style Map of the Mandelbrot Set

#14
post #13
post #12

Earlier quoted context omitted.

You can run it with BigDecimals or whatever unlimited number type your language has just fine, and it will give a very similar looking image.

That doesn’t help in understanding why this thing is numerically quite stable. It only gives some confidence that it is.

All the visualizations of the mandelbrot set I've seen use a threshold of iterations that define the edge. I think that threshold is more significant than any instability due to floating point numbers. A more formal analysis of numerical stability comes down to whether the iterated function is considered well-conditioned. I don't have the math to state it formally, but my intuition is that the mandelbrot function is, in that a small change to the function input will have a small effect on the number of iterations except at the very edge where the threshold will define the boundary anyway.

Re: Vintage-Style Map of the Mandelbrot Set

#16
post #6

Fun fact, all real islands are islands of infinite coastline due to the fractal nature of natural coastlines. https://en.wikipedia.org/wiki/Coastline_paradox

If there's a minimum length (the Planck length?) then space is discrete and the measurement bottoms out at some point, it would be infinite if space was continuous and infinitely divisible.

Bingo. There are a finite number of atoms in a coastline therefore there is a finite length. I suspect the calculus to derive it isn't even all that hard.

Re: Vintage-Style Map of the Mandelbrot Set

#18
post #11

Very cool! I just finished a for-fun mandelbrot drawing program; I was familiar with the image, but I had never delved into the math. It's an extremely simple algorithm, which makes it that much more surprising it creates so much complexity.

I never understood how the algorithm could be so simple, using just IEEE floats ( https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Ma... ) These programs do thousands of iterations. How does one prove that the images show the Mandelbrot set and not some artifact of issues with numerical stability?

One can check this fairly easily.

The iterative step is z -> z^2 + u, or in components a + bi -> (a^2 - b^2 + c) + (2ab + d)i

Multiplying and adding real numbers between -1 and 1 are fundamentally stable operations when done with floats. The only possible source of instability is if a and b are very close, that a^2 - b^2 will magnify some errors from the limits of numerical accuracy. However, this is mitigated by two things: the region of such numbers is very small, and also if z is in that region, z^2 + u will tend not to be. (The exceptional region, where both are small is now a small dot rather than a thin line) So while doing thousands of iterations, the possibility that for some numbers there are repeated iterations which tend to introduce error is either excluded or just very very unlikely (we don't need to rigorously determine which).

Now remember what we are doing - we're just checking whether the iterated value goes to infinity or to the region where it will stay bounded. We don't need very precise accuracy except if we are on the boundary, as another commenter pointed out. Any region of badly behaved numbers will only tend to break the algorithm if it overlaps the boundary region. So that's one more condition we've placed on our very small region of possibly bad starting values. Furthermore, even if there were lots of bad values located on or very near the boundary, they would only tend to move the boundary by a very small amount. It's easy to check that most values near the boundary quickly either run away to infinity or quickly converge towards the central region (technically towards orbits in the central region rather than limit points). We can quickly check the rough shape of the boundary using a very small number of iterations, fewer than could possibly go wrong using 64-bit floats. If you use say 100 iterations, but keep track of potential large errors, you will plot something that is indistinguishable from the actual Mandelbrot set, with only a very very small set of points where you are 'not sure' of the actual behavior. It's also quite easy to see that points on either side of the boundary will quickly iterate away from the boundary - that is basically the definition of the set.

So although it might be hard to either be extremely sure of the exact boundary details, nor to plot highly zoomed-in details with very good accuracy, it's quite easy to draw the set to a reasonable standard.

A lot of this math was developed by experts in computational and numerical mathematics who looked very hard at questions of stability. In fact lots of fractal and chaotic behavior was dismissed as due to numerical stability before it could be rigorously demonstrated that it was real. (Not the Mandelbrot set to my understanding.)

Re: Vintage-Style Map of the Mandelbrot Set

#19
post #16

Earlier quoted context omitted.

If there's a minimum length (the Planck length?) then space is discrete and the measurement bottoms out at some point, it would be infinite if space was continuous and infinitely divisible.

Bingo. There are a finite number of atoms in a coastline therefore there is a finite length. I suspect the calculus to derive it isn't even all that hard.

"There are a finite number of atoms in a coastline"

And atoms do not consist of smaller parts?

Re: Vintage-Style Map of the Mandelbrot Set

#20
post #6

Fun fact, all real islands are islands of infinite coastline due to the fractal nature of natural coastlines. https://en.wikipedia.org/wiki/Coastline_paradox

If there's a minimum length (the Planck length?) then space is discrete and the measurement bottoms out at some point, it would be infinite if space was continuous and infinitely divisible.

"If there's a minimum length (the Planck length?) then space is discrete "

"The Planck length is the scale at which classical ideas about gravity and space-time cease to be valid, and quantum effects dominate. "

(https://www.physlink.com/education/askexperts/ae281.cfm)

This does not say, that space is discrete, it says that our concept of space does not make sense anymore at sizes that small.

Post reply on HN