Problem 56215. Calculate pi using the Mandelbrot Set.
The Mandelbrot Set is a set of complex numbers built around a simple iterative equation for which the orbit of the critical point
remains bounded. The iterative equation is
.
For any complex c, we can continue this iteration until either
diverges, meaning
, or it converges such that
. To visualize this set, all those values of c in which
converge are plotted in the complex plane. Thus having the following image:
What is amazing about this set is that it has several properties related to famous mathematical concepts such as the bifurcation diagram of the logistic map, the Fibonacci sequence and π. In 1991, Dave Boll was trying to convince himself that the single point
(also called the Mandelbrot Set's Neck), shown in the diagram above, connected the cardioid and the disk to its left, and had zero thickness. In order to do this, he was seeing how many iteration points of the form
went through before scaping the set (meaning
), with ϵ being a small number. This same procedure works when approaching a small real number ϵ to the point
(also called the Mandelbrot Set's Cusp). You will see that as ϵ decreases, the number of times that the Mandelbrot Set's equation has to be iterated in order that
for
or
approaches the digits of π.
To find out more information about this discovery, check out the following article: π IN THE MANDELBROT SET.
In this task we will compute what Dave Boll did using the Mandelbrot Set's Cusp (to work with real numbers). To do so, we will create a function that takes an input x corresponding to the number of times we will decrement ϵ by 100, beginning with
(no decrement). It outputs the number of times n it will take for
to be greater than two when iterating the recursive equation
with
with
. For example:
if x == 1
epsilon = 1e-3;
elseif x == 2
epsilon = 1e-5;
...
end
Then we will iterate the following:
z = 0;
z = z + 1/2 + epsilon;
Until it diverges or becomes greater than 2. Finally, we will output the number of times n it took it.
Problem based upon: Problem 81. Mandelbrot Numbers and Problem 785. Mandelbrot Number Test [Real+Imaginary].
Solution Stats
Problem Comments
-
2 Comments
William
on 12 Oct 2022
There are serious errors in the description of this problem that make it inconsistent with the test solutions. For example, the Cusp is at c=0.25 and not c=0.5. Also, the epsilons used in the test set are 1/100^x and not 0.1/100^x. I suggest looking at https://www.doc.ic.ac.uk/~jb/teaching/jmc/pi-in-mandelbrot.pdf for a correct description.
Christian Schröder
on 2 Nov 2022
Thanks, @William!
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
Increment a number, given its digits
659 Solvers
-
Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
136 Solvers
-
Unique values without using UNIQUE function
371 Solvers
-
7331 Solvers
-
Mysterious digits operation (easy)
293 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!