## Friday, June 7, 2013

### The Mandelbrot Set in Scratch

Colorful images of the complex Mandelbrot set have been seen and liked by millions of people that have no interest at all in the mathematics that defines members of the set.
I recently uploaded to Scratch a Mandelbrot Set in Scratch project that steps back from the colorful images and computes the set in black and white. In the picture below, members of the set are those complex numbers painted white and nonmembers are in the black.
The Mandelbrot set lives in the complex number plane and the computation starts with the complex number in the lower corner of the screen that displays the image. Input the complex number (-2, -1i), real part first, imaginary part second, with a scan size of 2.5, and the full set is computed.
Input the numbers in the Try These list in the lower right corner and view a more detailed portion around the two o’clock position of the large, heart-shaped bulge.
Since the complex numbers are infinitely dense, there is no limit as to how deep one can zoom into the set. Practically, our computers have limited precision when it comes to representing numbers and our screens have a finite resolution so we will never see the complete Mandelbrot set. That’s why the set is sometimes called the most complicated object in mathematics.

I did include documentation in the project notes section but nowhere near enough information to help anyone interested in really understanding the mathematics underlying the set and how to code the mathematics in Scratch. For example, Scratch does not contain prebuilt blocks for computing with complex numbers. I coded subroutines in Scratch to do the necessary complex number arithmetic.
Something as mathematically profound as the Mandelbrot set cannot be explained within the 134 characters of a tweet so I’m writing three documents to break up the task of explaining the set itself and the coding. The first document in the following list is finished and the other two will be ready within a week.

Introduction to the Mandelbrot Set.pdf
The Paper and Pencil Part.pdf
Developing the Scratch Script for the Mandelbrot Set.pdf

Any or all of the above documents can be had—free—by sending a request to my email address.