# Can you recreate this fractal I randomly made?

This fractal looks relatively simple, but how would you generate it?

On a smaller scale:

I made it using a 1D cellular automaton with a four cell neighborhood:

 ..|-|..    2 generations back
|-||-||-|   1 generation back
..|-|..    current generation


But since there are $65536$ possible rules for this CA, and I don't remember this particular one, it's unlikely I will find it again.

For the Sierpiski triangle we have many different ways to generate it (see this page for example).

I would really like it if the answer contained a generated fractal. I would also love to know another method of generating it, not related to cellular automata.

• What exactly are you asking? There are three different questions here. – Deusovi Sep 27 '16 at 21:08
• @celtschk, see the new image for clarification – Yuriy S Sep 27 '16 at 21:25
• I found this rule given as an example in Mathematica's documentation! (look under Scope > Higher-Order Rules) They call it "Rule 150R—the second-order reversible mod 2 rule" – 2012rcampion Sep 27 '16 at 22:15
• @TheGreatDuck: Start by coloring in one pixel. Then move down one row, and color in every pixel that has an odd number of pixels in the four closest squares above it. Repeat over and over. – Deusovi Sep 27 '16 at 22:45
• @elias, maybe you could read the first paragrath of mathworld.wolfram.com/ElementaryCellularAutomaton.html, it explains why there are 256 rules for elementary CA with 3 parent cells. The same logic applies here – Yuriy S Sep 28 '16 at 7:22

## 5 Answers

The pattern is self-similar, and can be formed by repeatedly scaling and rotating copies of itself:

An alternate dissection that fits in a diamond:

• What is the minimal starting element? – Yuriy S Sep 27 '16 at 22:40
• @YuriyS Any shape you want; since it is eventually shrunken to a point it doesn't matter. I used a triangle covering the upper half. – 2012rcampion Sep 27 '16 at 22:41
• The second case is more clear to me. Thank you! – Yuriy S Sep 27 '16 at 23:31
• Is there a nice way to derive this self-similarity relation from the rule? – xnor Sep 28 '16 at 5:17
• @xnor Not that I know of, I just figured it out by observation. – 2012rcampion Sep 28 '16 at 20:36

There are only 16 different possible state combinations of the four ancestor cells, and you can find them all in the image, so there is a unique answer.

The rule is as follows:

The new cell lives if there is an odd number of live ancestor cells.

• I must admit, this is a pretty neat way to find the rule, using a random 'snapshot' of a CA pattern – Yuriy S Sep 27 '16 at 21:56

I think the rule is:

A cell is black if and only if an odd number of the four "parent" cells is black.

This is by no means an answer, but using @2012rcampion's interpretation, I wanted to illustrate how this fractal can be generated using top-down approach, starting from a single element:

   /\  /\
/  \/  \
/   /\   \
/   /  \   \
\  /    \  /
\/      \/
/\      /\
/  \/\/\/  \
\  /\/\/\  /
\/      \/


Step one:

Step two:

Step three:

The element is scaled down by a factor of $2$ on each step and added to any place we can. I omitted some of the elements, which didn't fit on the picture.

Simply because I posted some code for a similar puzzle a few minutes ago, I may as well post some Excel VBA code to generate this one too:

Sub RunIt()
Application.ScreenUpdating = False
Dim r As Long
Dim c As Long
Dim cnt As Integer
Cells.Interior.Color = xlAutomatic
Cells(2, 8000).Interior.Color = vbRed
r = 3
Do While r < 500
For c = 8000 - r To 8000 + r
cnt = 0
If Cells(r - 2, c + 0).Interior.Color = vbRed Then cnt = cnt + 1
If Cells(r - 1, c - 1).Interior.Color = vbRed Then cnt = cnt + 1
If Cells(r - 1, c + 0).Interior.Color = vbRed Then cnt = cnt + 1
If Cells(r - 1, c + 1).Interior.Color = vbRed Then cnt = cnt + 1
If cnt = 1 Or cnt = 3 Then
Cells(r, c).Interior.Color = vbRed
End If
Next
r = r + 1
Loop
Cells(1, 8000).Select
Application.ScreenUpdating = True
End Sub