Approximation of the Pi number using the Mandelbrot set
I always told my friend that mathematics, with its elegant abstractions, has that magical power, the potential of which has not yet been fully revealed. Today I want to talk about how to approximate the number of Pi with the help of the Mandelbrot set.
A few words about the multitude
In fact, there are a lot of articles on Habré describing the Mandelbrot set (hereinafter, the set M ), considering its properties, history and amazing beauty, backing it all up with colorful pictures. I would not want to dwell on its definition and other details, but go straight to the point. However, due to the fact that it is the central subject of this article, I will still refresh your memory.
The set M is the set of all complex numbers c for which the function is bounded
during its iteration c
. So simple.
In practice, we apply the following theorem: if the function (above) during the iteration exceeds 2, then it is not 100%limited. Therefore, the set can be defined as follows:


I will not touch on the topic of visualization, we will not dig there today.
Pi?
Really, in this way?

Take the “coordinate of the contact of two parts” of the set c = -0.75 + i x (where x ∈ ℚ). Let us verify that it belongs to the set M: we begin to iterate the function
n- times from zero and check whether it exceeds the obtained value 2. If yes, then the function diverges, and the value of c does not belong to the set for a given n . Otherwise, it belongs.
| x | c | n (number of iterations before the function is consumed) |
|---|---|---|
| 0.1 | -0.75 + 0.1i | 33 |
| 0.01 | -0.75 + 0.01i | 315 |
| 0.001 | -0.75 + 0.001i | 3143 |
| 0.0001 | -0.75 + 0.0001i | 31417 |
| 0.00001 | -0.75 + 0.00001i | 314160 |
Exactly. If you put a comma in the right place, the numbers resemble the number Pi.
Probably a coincidence
We will not bother with the complex part and take the number c = 0.25. It belongs to the set with an infinitely large number of iterations. Therefore, we will "approach" this point to the right: take c = 0.26, check it; c = 0.2501, check it, etc.
| c | n (number of iterations before the function is consumed) |
|---|---|
| 0.26 | thirty |
| 0.2501 | 312 |
| 0.25001 | 991 |
| 0.250001 | 3140 |
| 0.2500001 | 9933 |
| 0.25000001 | 31414 |
The sequence fluctuates between the two values, but the echo of the Pi number (putting the comma in the right place) has not disappeared.
A bit of history
The set M itself, named after the mathematician Benoit Mandelbrot, is a very recent discovery. Benoit even spoke at TEDx , including about him.
In 1991, Dave Ball studied whether the "contact of the two parts of the set" M near c = -0.75 is "infinitely subtle." In the course of his research, he discovered what we are talking about.
And yet, probably a coincidence
Let us try to understand what is happening: do we really get the Pi number or is it some other transcendental number.
We will do all this around the point c = 0.25 (just because of the lack of a complex part, it’s easier).
Consider a recursive function
. When iterating from zero, we note that it very slowly tends to a value of 0.5.

In order to prevent it from “getting stuck” on this value, we will move this function by ε units up ( ε is infinitesimal, not equal to zero). Then she will take a look
.
This function slowly tends to a value of 0.5, and after passing it, quickly runs away to infinity.
We will dig further.
Let x = y + 0.5. Our task is to find zero.
Making a substitution in the original function, we get: 
Taking ε as any small value, we will iterate the function from zero:
| y |
|---|
| 0.001 (= ε) |
| 0.002001 |
| 0.0030050040010000004 |
| 0.004014034050046026 |
| 0.005030146519400955 |
| 0.006055448893407596 |
| 0.007092117354708267 |
| 0.00814241548328122 |
| 0.009208714413183598 |
| 0.010293514834327173 |
We see that it grows quite smoothly and slowly near zero. Based on this, we are entitled to assume that the difference between the (n + 1) th and n-th values close to its derivative function:
.
Given this, our original function will take the form:,
which is the simplest differential equation of the first order. Solving it (for example, by the method of separation of variables), we obtain: We 
recall our goal - the search for zero. This expression is equal to zero only in two cases: either the square root of ε is equal to zero - it is impossible by definition, or the tangent is equal to zero. Neglecting constant the C :
. This confirms what we saw today:
| ε | n√ε |
|---|---|
| 0.01 | 3.0 |
| 0.0001 | 3.12 |
| 0.000001 | 3.140 |
| 0.00000001 | 3.1414 |
It can be seen that the factor √ε puts the same comma in the right place.
Conclusion
Constructing the Pi number by this method is probably the most inefficient way: you need to do 314160 iterations in order to get 3.14160. In addition, the method does not have high accuracy due to large calculation errors.
However, we managed to connect two seemingly unconnected points: a fractal and the ratio of the circumference to the length of its diameter.