Saturday, April 19, 2014

The Koch-Sierpinski Ninja Star

Fractals
    A fractal is, in general, a mathematical set that displays self-similar patterns. Most people recognize these geometrically, as a set of points plotted in two or three dimensions. We think of them by the step, or iteration, going on towards infinity. Two of the first-to-be-discussed, simplest, and most recognized fractals are known as Koch’s Snowflake and Sierpinski’s Triangle. A few years ago I had an idea for how to draw a fractal that involves some similar generative functions, but is indeed quite distinct from both and possesses some surprisingly unique properties. I’ve been looking into it on and off ever since.


Koch’s Snowflake

    As Wikipedia explains: 

The Koch snowflake can be constructed by starting with an equilateral triangle, then recursively altering each line segment as follows:

1) divide the line segment into three segments of equal length.

2) draw an equilateral triangle that has the middle segment from step 1 as its base and points outward.

3) remove the line segment that is the base of the triangle from step 2.



Like so:

File:KochFlake.svg
   What I find most interesting about Koch’s Snowflake, is that its perimeter has infinite length. It will be interesting to see if the Ninja Star does as well, because its perimeter grows similarly to but slower than that of Koch's Snowflake.


Sierpinski’s Triangle

File:Sierpinski triangle evolution.svg

The cool thing about this guy’s fractal is that it has connections to other foundational patterns in mathematics, like Pascal’s Triangle and the Towers of Hanoi puzzle. It doesn’t have really cool limits in it like Koch’s Snowflake or the Ninja Star, but there are cool limits having to do with other things (like Pascal’s Triangle) that actually converge to it, which is also cool.

The Koch-Sierpinski Ninja Star

    What I did originally was to literally just start drawing Sierpinski's triangle inside of Koch's snowflake, which you can do. However, though it looks kind of cool there isn't much that is interesting about it that isn't interesting about the first two. I was interested in the area ratio of dark to light triangles, so continuing the Sierpinski pattern in the white triangle didn't appeal to me for long. I then took a liking to the way the corners of the inner triangles touched each other at a point, and decided to limit generation of new triangle to include only those. Notice the difference that emerges between the outer bounds of this first version and Koch's Snowflake ( You can see it in the fourth iteration ).
It wasn't until this year that I realized the whole snowflake can be inscribed into each blank triangle that composes it. That realization was how it came to look like this.

The area question was actually really easy before, though somehow I wasn't convinced at the time - it will stay 1/4 colored the whole time as it iterates on toward infinity. However, that changes entirely when the white area in one iteration starts to be filled with more Ninja Stars.

Notation

    After going through a few different versions of tables trying to count the triangles in each iteration of this thing, I settled on keeping track of the triangles by level using a sub-scripted variable TL sub k of n. This variable tracks how many new full triangles ( 3 blank surrounding one colored ) are created at level k, where a level k is defined as one less than how many triangles the base of the star that is sprouting the triangles is directly and indirectly inscribed into. This way we are are able to count the number of a given size of triangle by the n value at which they are produced, while reusing the original recursive generating function. This is necessary because the way it goes, 3 triangles sprout off of the initial one, but then only 2 sprout off of each of those and so on. Notice in the GIF that we add all of the triangles that there will ever be of a given size to the design in each iteration. Then a recursive formula for the number of triangles produced at each level can be:

**There is a typo here! The second to last line should read,
TL_k (n) = 3 (SUM from i = 1 to k - 2 of: TL_i (k - 1)) TL_1 (n - k

Basically we are just reusing the base sequence, which is a binary tree of valency 3.

Remember however that this only counts the number of new triangles at a particular level. A formula for the number of new triangles produced in a given iteration can be:


Then the total number of triangles is given by
The sequences given by both of these last two formulas look like this:

T(n): 1,3,9,30,96,309,996,3207,...

TT(n): 1,4,13,43,139,448,1444,4651,...

Neither of these two sequences are present in the Online Encyclopedia of Integer Sequences (OEIS), so that's sort of cool.

The Area Question 

    Now that we can track how many triangles are created in each iteration under the original assumption that all triangles of a given size are created in a single iteration, we can start to really pursue the question: What is the ratio of colored to blank space in the whole design as n approached infinity?

First we could define another sequence, this one an ordinary convergent geometric series. We count the area in terms of the original triangle at n=1 having an area of 4, so that each triangle composing it has area 1. Then each new triangle made in iteration n has an area of 4(1/4)^n. We plug this expression in to the sum given by TL sub 1 of n. This will calculate the area of the entire design as n approaches infinity. The limit we are interested is given below, followed by a simplification of the function we are trying to evaluate as n approaches infinity. The way we represent it initially includes recursive actions that we can't deal with in a limit.
    The limit of A(n) is now easy to calculate as n approaches infinity. It is equal to 10. This is interesting, because we can observe that the equilateral triangle that the design could be inscribed into has a area of 16 by our convention, and the hexagon within that triangle that clearly bounds the outward growth of the design has an area of 13 by that same convention. Now I will leave you with a limit that I have yet to solve, as it also includes recursive functions. We can define a function CA(n) to represent the total area of colored triangles in the design as well. We do so by starting at one fourth the area of the whole pattern at n=1, so 1. This is the area of the first colored triangle. We then add (1/4)^n of the number of the total number of triangles created at each iteration to the total colored area in each iteration. It looks like this,
Since T(n) is recursively dependent on the weird TL_k(n), it is tricky to get a closed formula for. TL_1(n) is actually in the OEIS, and a closed formula for it was not so hard to find. This on the other hand stumps me, and the corresponding limit is thus out of my reach as of now. The final relationship of interest is precisely the following; the ratio of colored area to total, 
In the spreadsheet where I came up with these recursive definitions I approximated this R(n) function up to the 17th iteration, and it actually seems that it may be approaching 1/2. I find that very interesting personally, but as of yet we cannot know for sure what the value is. We know visually that the limit must converge to some number between 0 and 1, because there are some white spaces which we know will never be filled, as given by the difference between 10 and 16, the area of the design and the equilateral triangle it is inscribed into.

Check out the spreadsheet. Just make a copy if you want to mess with it.

https://docs.google.com/spreadsheet/ccc?key=0AkvjjjAi1kyWdE9YcW1XWXlCeFJURUxBTFBHS3ZRSnc&usp=sharing

GIF of triangles by level.

Geogebra drawings all courtesy of Professor John Golden. Your beautiful pictures inspire me to my best :)

No comments:

Post a Comment