# Accuracy of Generated Fractals

Note: I refer to the Mandelbrot set in general as the M-set for short.

When I was writing the post on Rough Mandelbrot Sets I tried out some variations on the rough set. One variation was to measure the generated M-set against a previously calculated master M-set of high precision (100000 iterations of $z = z^2 + C$). In the image below the master M-set is in white and the generated M-sets are in green (increasing in accuracy): Here instead of approximating with tiles I measured the accuracy of the generated sets against the master set by pixel count. Where $P = \{ \text{set of all pixels} \}$ the ratio of $P_{master} / P_{generated}$ produced something that threw me, the generated sets made sudden but periodic jumps in accuracy: Looking at the data I saw the jumps were, very roughly, at multiples of 256. The size of the image being generated was 256 by 256 pixels so I changed it to N by N for N = {120, 360, 680} and the increment was still every ~256. So I’m not really sure why, it might be obvious, if you know tell me in the comments!

I am reminded of the images generated from Fractal Binary and other Complex Bases where large geometric entities can be represented on a plane by iteration through a number system. I’d really like to know what the Mandelbrot Number System is…

Below is a table of the jumps and their iteration index:

 Iterations Accuracy measure 255 256 0.241929 0.397073 510 511 0.395135 0.510806 765 766 0.510157 0.579283 1020 1021 0.578861 0.644919 1275 1276 0.644919 0.679819 1530 1531 0.679696 0.718911

# Fractal Binary

I have previously talked about Complex Bases but I wanted to look again at Base (-1+i). It’s a really hefty number system so the length of the bit-strings increase very quickly, I’d quite like to know if there is a way to assess Radix Economy for complex and negative bases, so if there are any mathematicians out there who know – Please tell me! Visualising Numbers
Today I wrote a little C++ program to act on Base 2 arithmetic but convert to decimal as if it was Base (-1+i), this meant I could increment through the bits in an ‘ordered’ fashion. The image to the left is the text output of the program, it doesn’t have a very obvious pattern to it – infact the pattern-order we derive from it is somewhat an imposed one. This is because complex numbers do not have a linear order (or Total Order) and I’m trying to list them in a linear manner. They can, on the other hand, be Well-Ordered in correspondence with the natural numbers like we’re doing here.
If we take the real and imaginary values of each number and use them as the x and y co-ordinates (like I did for generating the Mandlebrot Set fractal) then the fractal “Twindragon” appears: The program I wrote runs through binary numbers starting at 0 colouring the pixel (x=r, y=i) discretely depending on number length. The result shows all Gaussian integers representable by all possible 16,12 and 8 bit complex binary strings in base (-1+i). The colour mapping relates to the position of the Most Significant Bit (essentially the bitstring length). 0 and 1 are both of length one and are the dark blue in the center of the fractal. The 12-bit and 8-bit fractal maps have been zoomed in on to emphases  the self-similarity of the shape.

Colouring the fractals like this is a nice way of showing the distribution of numbers in the complex system but, going back to the math, a number system isn’t useful without arithmetic. Luckily the (-1+i) system is closed under addition, subtraction and multiplication. For addition and multiplication it is the same as normal binary with the difference being in the carry. Below is a table of all possible carry situations:

 1+1 = 1100 1+1+1 = 1101 1+1+1+1 = 111010000 1+1+1+1+1 = 111010001 1+1+1+1+1+1 = 111011100 1+1+1+1+1+1+1 = 111011101 1+1+1+1+1+1+1+1 = 111000000

Division in the systems is rather complex, an explination of that and examples of addition/subtraction/multiplication can be found in a short paper called “Arithmetic in Complex Basis” by William Gilbert. The paper also talks about an equivalent to decimal which is base (-3+i) using the digits [0,1,2,3,4,5,6,7,8,9].