8 ms·
Here's a fun fact about the Mandelbrot set, which I will communicate in Python in the hope that you can have a little fun witnessing the results: def N(eps):
by ocfnash 7y ago
Here's a fun fact about the Mandelbrot set, which I will communicate in Python in the hope that you can have a little fun witnessing the results:
def N(eps):
c = -0.75 + eps*1j
n = 0
z = 0
while abs(z) < 2:
z = z*z + c
n += 1
return n
[N(eps) for eps in [0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001]]
- Twirrim 7y agoThat was interesting. It continues for a little bit, but it soon falls apart: $ pypy3 man.py [33, 315, 3143, 31417, 314160, 3141593, 31415927, 7853981629]
- ocfnash 7y agoIt continues forever! See here for example: https://mathoverflow.net/questions/215187/is-there-a-reference-for-computing-pi-using-external-rays-of-the-mandelbrot https://mathoverflow.net/questions/215187/is-there-a-referen... I believe you are just running into the limits of double precision arithmetic; indeed log_2((10^8)^2) > 53.
- FreeFull 7y agoInterestingly, 7.853981629 is close to pi*2.5
- throwawaymath 7y agoWhen you begin with z = k i - 0.75, you can obtain an arbitrarily good approximation of pi by multiplying the p for which f_p(z) = z^2 + z diverges by k. The approximation increases in precision as k tends to 0. There's a neat video explaining it here: https://www.youtube.com/watch?v=d0vY0CKYhPY https://www.youtube.com/watch?v=d0vY0CKYhPY
- manifestsilence 7y agovery cool!