# Math 21a Fall 2019

## Multivariable Calculus

# Monte Carlo integration

What is the area of the Mandelbrot set? We do not have an analytic expression for it. But we can try to approximate it numerically. One way to do that is Monte Carlo Integration.The Mandelbrot set is the set of complex numbers M = { c = a+i b | T

_{c}(0)

^{n}stays ; bounded where T

_{c}(z) =z

^{2}+c. In real coordinates the map is T

_{c}(x,y) = (x

^{2}-y

^{2}+a,2xy + b). The notation T

^{n}means applying the map T a number of times. For example T

^{3}(x,y) = T(T(T(x,y))). One can draw numerically the level curves T

^{n}(x,y) = 2 as if we outside the region, then we are outside the Mandelbrot set. here is some code to compute the area of the Mandelbrot set using

**Monte Carlo computation**.

M=Compile[{x,y},Module[{z=x+I y,k=0}, While[Abs[z]<2.&&k<999,z=N[z^2+x+I y];++k];Floor[k/999]]]; n=10^6; 9*Sum[M[-2+3*Random[],-1.5+3*Random[]],{n}]/nThere is a lot of discussion about the area in Example. This paper gives a value of 1.506793 with pixel counting. Google gives 1.506484, with a 95% confidence interval from 1.506480 to 1.506488.