# Performativizing the Polygonic #3

Pre-previously in my passionate portrayal of polygonic performativity, I showed how a single point jumping randomly (or quasi-randomly) towards the vertices of a polygon can create elaborate fractals. For example, if the point jumps 1/φth (= 0.6180339887…) of the way towards the vertices of a pentagon, it creates this fractal:

Point jumping 1/φth of the way to a randomly (or quasi-randomly) chosen vertex of a pentagon

But as you might expect, there are different routes to the same fractal. Suppose you take a pentagon and select a single vertex. Now, measure the distance to each vertex, v(1,i=1..5), of the original pentagon (including the selected vertex) and reduce it by 1/φ to find the position of a new vertex, v(2,i=1..5). If you do this for each vertex of the original pentagon, then to each vertex of the new pentagons, and so on, in the end you create the same fractal as the jumping point does:

Shrink pentagons by 1/φ, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Shrink by 1/φ (animated) (click for larger if blurred)

And here is the route to a centre-filled variant of the fractal:

Central pentagon, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Central pentagon (animated) (click for larger if blurred)

Using this shrink-the-polygon method, you can reach the same fractals by a third route. This time, use vertex v(1,i) of the original polygon as the centre of the new polygon with its vertices v(2,i=1..5). Creation of the fractal looks like this:

Pentagons over vertices, shrink by 1/φ, stage #1 (no pentagons over vertices)

Stage #2

Stage #3

Stage #4

Stage #4

Stage #5

Stage #7

Pentagons over vertices (animated) (click for larger if blurred)

And here is a third way of creating the centre-filled pentagonal fractal:

Pentagons over vertices and central pentagon, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Stage #7

Pentagons over vertices with central pentagon (animated) (click for larger if blurred)

And here is a fractal created when there are three pentagons to a side and the pentagons are shrunk by 1/φ^2 = 0.3819660112…:

Pentagon at vertex + pentagon at mid-point of side, shrink by 1/φ^2

Final stage

Pentagon at vertex + pentagon at mid-point of side (animated) (click for larger if blurred)

Pentagon at vertex + pentagon at mid-point of side + central pentagon, shrink by 1/φ^2 and c. 0.5, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Pentagon at vertex + mid-point + center (animated) (click for larger if blurred)

Previously pre-posted:

# Performativizing the Polygonic #2

Suppose a café offers you free drinks for three days. You can have tea or coffee in any order and any number of times. If you want tea every day of the three, you can have it. So here’s a question: how many ways can you choose from two kinds of drink in three days? One simple way is to number each drink, tea = 1, coffee = 2, then count off the choices like this:

1: 111
2: 112
3: 121
4: 122
5: 211
6: 212
7: 221
8: 222

Choice #1 is 111, which means tea every day. Choice #6 is 212, which means coffee on day 1, tea on day 2 and coffee on day 3. Now look at the counting again and the way the numbers change: 111, 112, 121, 122, 211… It’s really base 2 using 1 and 2 rather than 0 and 1. That’s why there are 8 ways to choose two drinks over three days: 8 = 2^3. Next, note that you use the same number of 1s to count the choices as the number of 2s. There are twelve 1s and twelve 2s, because each number has a mirror: 111 has 222, 112 has 221, 121 has 212, and so on.

Now try the number of ways to choose from three kinds of drink (tea, coffee, orange juice) over two days:

11, 12, 13, 21, 22, 23, 31, 32, 33 (c=9)

There are 9 ways to choose, because 9 = 3^2. And each digit, 1, 2, 3, is used exactly six times when you write the choices. Now try the number of ways to choose from three kinds of drink over three days:

111, 112, 113, 121, 122, 123, 131, 132, 133, 211, 212, 213, 221, 222, 223, 231, 232, 233, 311, 312, 313, 321, 322, 323, 331, 332, 333 (c=27)

There are 27 ways and (by coincidence) each digit is used 27 times to write the choices. Now try three drinks over four days:

1111, 1112, 1113, 1121, 1122, 1123, 1131, 1132, 1133, 1211, 1212, 1213, 1221, 1222, 1223, 1231, 1232, 1233, 1311, 1312, 1313, 1321, 1322, 1323, 1331, 1332, 1333, 2111, 2112, 2113, 2121, 2122, 2123, 2131, 2132, 2133, 2211, 2212, 2213, 2221, 2222, 2223, 2231, 2232, 2233, 2311, 2312, 2313, 2321, 2322, 2323, 2331, 2332, 2333, 3111, 3112, 3113, 3121, 3122, 3123, 3131, 3132, 3133, 3211, 3212, 3213, 3221, 3222, 3223, 3231, 3232, 3233, 3311, 3312, 3313, 3321, 3322, 3323, 3331, 3332, 3333 (c=81)

There are 81 ways to choose and each digit is used 108 times. But the numbers don’t have represent choices of drink in a café. How many ways can a point inside an equilateral triangle jump four times half-way towards the vertices of the triangle? It’s the same as the way to choose from three drinks over four days. And because the point jumps toward each vertex in a symmetrical way the same number of times, you get a nice even pattern, like this:

vertices = 3, jump = 1/2

Every time the point jumps half-way towards a particular vertex, its position is marked in a unique colour. The fractal, also known as a Sierpiński triangle, actually represents all possible choices for an indefinite number of jumps. Here’s the same rule applied to a square. There are four vertices, so the point is tracing all possible ways to choose four vertices for an indefinite number of jumps:

v = 4, jump = 1/2

As you can see, it’s not an obvious fractal. But what if the point jumps two-thirds of the way to its target vertex and an extra target is added at the centre of the square? This attractive fractal appears:

v = 4 + central target, jump = 2/3

If the central target is removed and an extra target is added on each side, this fractal appears:

v = 4 + 4 midpoints, jump = 2/3

That fractal is known as a Sierpiński carpet. Now up to the pentagon. This fractal of endlessly nested contingent pentagons is created by a point jumping 1/φ = 0·6180339887… of the distance towards the five vertices:

v = 5, jump = 1/φ

With a central target in the pentagon, this fractal appears:

v = 5 + central, jump = 1/φ

The central red pattern fits exactly inside the five that surround it:

v = 5 + central, jump = 1/φ (closeup)

v = 5 + c, jump = 1/φ (animated)

For a fractal of endlessly nested contingent hexagons, the jump is 2/3:

v = 6, jump = 2/3

With a central target, you get a filled variation of the hexagonal fractal:

v = 6 + c, jump = 2/3

And for a fractal of endlessly nested contingent octagons, the jump is 1/√2 = 0·7071067811… = √½:

v = 8, jump = 1/√2

Previously pre-posted:

# Binary Babushkas

What’s the connection between grandmothers and this set of numbers?

1, 2, 6, 12, 44, 92, 184, 1208, 1256, 4792, 9912, 19832, 39664, 563952, 576464, 4496112, 4499184, 17996528, 17997488, 143972080, 145057520, 145070832, 294967024, 589944560...

To take the first step towards the answer, you need to put the numbers into binary:

1, 10, 110, 1100, 101100, 1011100, 10111000, 10010111000, 10011101000, 1001010111000, 10011010111000, 100110101111000, 1001101011110000, 10001001101011110000, 10001100101111010000, 10001001001101011110000, 10001001010011011110000, 1000100101001101011110000, 1000100101001111010110000, 1000100101001101011011110000, 1000101001010110011011110000, 1000101001011001101011110000, 10001100101001101011011110000, 100011001010011101011011110000...

The second step is compare those binary numbers with these binary numbers, which represent 1 to 30:

1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110...

To see what’s going on, take the first five numbers from each set:

• 1, 10, 110, 1100, 101100...
• 1, 10, 11, 100, 101...

What’s going on? If you look, you can see the n-th binary number of set 1 contains the digits of all binary numbers <= n in set 2. For example, 101100 is the 5th binary number in set 1, so it contains the digits of the binary numbers 1 to 5:

101100 ← 1
101100 ← 10
101100 ← 11
101100 ← 100
101100 ← 101

Now try 1256 = 10,011,101,000, the ninth number in set 1. It contains all the binary numbers from 1 to 1001:

10011101000 ← 1 (n=1)
10011101000 ← 10 (n=2)
10011101000 ← 11 (n=3)
10011101000 ← 100 (n=4)
10011101000 ← 101 (n=5)
10011101000 ← 110 (n=6)
10011101000 ← 111 (n=7)
10011101000 ← 1000 (n=8)
10011101000 ← 1001 (n=9)

But where do grandmothers come in? They come in via this famous toy:

Nested doll or Russian doll

It’s called a Russian doll and the way all the smaller dolls pack inside the largest doll reminds me of the way all the smaller numbers 1 to 1010 pack into 1001010111000. But in the Russian language, as you might expect, Russian dolls aren’t called Russian dolls. Instead, they’re called matryoshki (матрёшки, singular матрёшка), meaning “little matrons”. However, there’s a mistaken idea in English that in Russian they’re called babushka dolls, from Russian бабушка, babuška, meaning “grandmother”. And that’s what I thought, until I did a little research.

But the mistake is there, so I’ll call these babushka numbers or grandmother numbers:

1, 2, 6, 12, 44, 92, 184, 1208, 1256, 4792, 9912, 19832, 39664, 563952, 576464, 4496112, 4499184, 17996528, 17997488, 143972080, 145057520, 145070832, 294967024, 589944560...

They’re sequence A261467 at the Online Encyclopedia of Integer Sequences. They go on for ever, but the biggest known so far is 589,944,560 = 100,011,001,010,011,101,011,011,110,000 in binary. And here is that binary babushka with its binary babies:

100011001010011101011011110000 ← 1 (n=1)
100011001010011101011011110000 ← 10 (n=2)
100011001010011101011011110000 ← 11 (n=3)
100011001010011101011011110000 ← 100 (n=4)
100011001010011101011011110000 ← 101 (n=5)
100011001010011101011011110000 ← 110 (n=6)
100011001010011101011011110000 ← 111 (n=7)
100011001010011101011011110000 ← 1000 (n=8)
100011001010011101011011110000 ← 1001 (n=9)
100011001010011101011011110000 ← 1010 (n=10)
100011001010011101011011110000 ← 1011 (n=11)
100011001010011101011011110000 ← 1100 (n=12)
100011001010011101011011110000 ← 1101 (n=13)
100011001010011101011011110000 ← 1110 (n=14)
100011001010011101011011110000 ← 1111 (n=15)
100011001010011101011011110000 ← 10000 (n=16)
100011001010011101011011110000 ← 10001 (n=17)
100011001010011101011011110000 ← 10010 (n=18)
100011001010011101011011110000 ← 10011 (n=19)
100011001010011101011011110000 ← 10100 (n=20)
100011001010011101011011110000 ← 10101 (n=21)
100011001010011101011011110000 ← 10110 (n=22)
100011001010011101011011110000 ← 10111 (n=23)
100011001010011101011011110000 ← 11000 (n=24)
100011001010011101011011110000 ← 11001 (n=25)
100011001010011101011011110000 ← 11010 (n=26)
100011001010011101011011110000 ← 11011 (n=27)
100011001010011101011011110000 ← 11100 (n=28)
100011001010011101011011110000 ← 11101 (n=29)
100011001010011101011011110000 ← 11110 (n=30)

Babushka numbers exist in higher bases, of course. Here are the first thirteen in base 3 or ternary:

1 contains 1 (c=1) (n=1)
12 contains 1, 2 (c=2) (n=5)
102 contains 1, 2, 10 (c=3) (n=11)
1102 contains 1, 2, 10, 11 (c=4) (n=38)
10112 contains 1, 2, 10, 11, 12 (c=5) (n=95)
101120 contains 1, 2, 10, 11, 12, 20 (c=6) (n=285)
1021120 contains 1, 2, 10, 11, 12, 20, 21 (c=7) (n=933)
10211220 contains 1, 2, 10, 11, 12, 20, 21, 22 (c=8) (n=2805)
100211220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100 (c=9) (n=7179)
10021011220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101 (c=10) (n=64284)
1001010211220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102 (c=11) (n=553929)
1001011021220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110 (c=12) (n=554253)
10010111021220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111 (c=13) (n=1663062)

Look at 1,001,010,211,220 (n=553929) and 1,001,011,021,220 (n=554253). They have the same number of digits, but the babushka 1,001,011,021,220 manages to pack in one more baby:

1001010211220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102 (c=11) (n=553929)
1001011021220 contains 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110 (c=12) (n=554253)

That happens in binary too:

10010111000 contains 1, 10, 11, 100, 101, 110, 111, 1000, 1001 (c=9) (n=1208)
10011101000 contains 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010 (c=10) (n=1256)

What happens in higher bases? Watch this space.

# Back to Drac’

draconic, adj. /drəˈkɒnɪk/ pertaining to, or of the nature of, a dragon. [Latin draco, -ōnem, < Greek δράκων dragon] — The Oxford English Dictionary

In Curvous Energy, I looked at the strange, beautiful and complex fractal known as the dragon curve and showed how it can be created from a staid and sedentary square:

A dragon curve

Here are the stages whereby the dragon curve is created from a square. Note how each square at one stage generates a pair of further squares at the next stage:

Dragon curve from squares #1

Dragon curve from squares #2

Dragon curve from squares #3

Dragon curve from squares #4

Dragon curve from squares #5

Dragon curve from squares #6

Dragon curve from squares #7

Dragon curve from squares #8

Dragon curve from squares #9

Dragon curve from squares #10

Dragon curve from squares #11

Dragon curve from squares #12

Dragon curve from squares #13

Dragon curve from squares #14

Dragon curve from squares (animated)

The construction is very easy and there’s no tricky trigonometry, because you can use the vertices and sides of each old square to generate the vertices of the two new squares. But what happens if you use lines rather than squares to generate the dragon curve? You’ll discover that less is more:

Dragon curve from lines #1

Dragon curve from lines #2

Dragon curve from lines #3

Dragon curve from lines #4

Dragon curve from lines #5

Each line at one stage generates a pair of further lines at the next stage, but there’s no simple way to use the original line to generate the new ones. You have to use trigonometry and set the new lines at 45° to the old one. You also have to shrink the new lines by a fixed amount, 1/√2 = 0·70710678118654752… Here are further stages:

Dragon curve from lines #6

Dragon curve from lines #7

Dragon curve from lines #8

Dragon curve from lines #9

Dragon curve from lines #10

Dragon curve from lines #11

Dragon curve from lines #12

Dragon curve from lines #13

Dragon curve from lines #14

Dragon curve from lines (animated)

But once you have a program that can adjust the new lines, you can experiment with new angles. Here’s a dragon curve in which one new line is at an angle of 10°, while the other remains at 45° (after which the full shape is rotated by 180° because it looks better that way):

Dragon curve 10° and 45°

Dragon curve 10° and 45° (animated)

Dragon curve 10° and 45° (coloured)

Here are more examples of dragon curves generated with one line at 45° and the other line at a different angle:

Dragon curve 65°

Dragon curve 65° (anim)

Dragon curve 65° (col)

Dragon curve 80°

Dragon curve 80° (anim)

Dragon curve 80° (col)

Dragon curve 135°

Dragon curve 135° (anim)

Dragon curve 250°

Dragon curve 250° (anim)

Dragon curve 250° (col)

Dragon curve 260°

Dragon curve 260° (anim)

Dragon curve 260° (col)

Dragon curve 340°

Dragon curve 340° (anim)

Dragon curve 340° (col)

Dragon curve 240° and 20°

Dragon curve 240° and 20° (anim)

Dragon curve 240° and 20° (col)

Dragon curve various angles (anim)

Previously pre-posted:

Curvous Energy — a first look at dragon curves

# Rigging in the Trigging

Here’s a simple pattern of three triangles:

Three-Triangle Pattern

Now replace each triangle in the pattern with the same pattern at a smaller scale:

Replacing triangles

If you keep on doing this, you create what I’ll call a trigonal fractal (trigon is Greek for “triangle”):

Trigonal Fractal stage #3 (click for larger)

Trigonal Fractal stage #4

Trigonal Fractal stage #5

Trigonal Fractal #6

Trigonal Fractal #7

Trigonal Fractal #8

Trigonal Fractal (animated) (click for larger)

You can use the same pattern to create different fractals by rotating the replacement patterns in different ways. I call this “rigging the trigging” and here are some of the results:

You can also use a different seed-pattern to create the fractals:

Trigonal fractal (animated)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Trigonal fractal (anim)

Note: The title of this incendiary intervention is of course a paronomasia on the song “Frigging in the Rigging”, also known as “Good Ship Venus” and performed by the Sex Pistols on The Great Rock ’n’ Roll Swindle (1979).

# Curvous Energy

Here is a strange and beautiful fractal known as a dragon curve:

A dragon curve (note: this is a twin-dragon curve or Davis-Knuth dragon)

And here is the shape generally regarded as the dullest and most everyday of all:

A square

But squares are square, so let’s go back to dragon-curves. This particular kind of dragon-curve looks a lot like a Chinese dragon. You can see the same writhing energy and scaliness:

Chinese dragon

Dragon-curve for comparison

Dragon-curves also look like some species of soft coral:

In short, dragon-curves are organic and lively, quite unlike the rigid, lifeless solidity of a square. But there’s more to a dragon-curve than immediately meets the eye. Dragon-curves are rep-tiles, that is, you can tile one with smaller copies of itself:

Dragon-curve rep-tiled with two copies of itself

Dragon-curve rep-4

Dragon-curve rep-8

Dragon-curve rep-16

Dragon-curve rep-32

Dragon-curve self-tiling (animated)

From the rep-32 dragon-curve, you can see that a dragon-curve can be surrounded by six copies of itself. Here’s an animation of the process:

Dragon-curve surrounded (anim)

And because dragon-curves are rep-tiles, they will tile the plane:

Dragon-curve tiling #1

Dragon-curve tiling #2

But how do you make these strange and beautiful shapes, with their myriad curves and curlicules, their energy and liveliness? It’s actually very simple. You start with the shape generally regarded as the dullest and most everyday of all:

A square

Then you see how the shape can be replaced by five smaller copies of itself:

Square overlaid by five smaller squares

Square replaced by five smaller squares

Then you set about replacing it with two of those smaller copies:

Replacing squares Stage #0

Replacing squares Stage #1

Then you do it again to each of the copies:

Replacing squares Stage #2

And again:

Replacing squares #3

And again:

Replacing squares #4

And keep on doing it:

Replacing squares #5

Replacing squares #6

Replacing squares #7

Replacing squares #8

Replacing squares #9

Replacing squares #10

Replacing squares #11

Replacing squares #12

Replacing squares #13

Replacing squares #14

Replacing squares #15

And in the end you’ve got a dragon-curve:

Dragon-curve built from squares

Dragon-curve built from squares (animated)

# Pi and By

Here’s √2 in base 2:

√2 = 1.01101010000010011110... (base=2)

And in base 3:

√2 = 1.10201122122200121221... (base=3)

And in bases 4, 5, 6, 7, 8, 9 and 10:

√2 = 1.12220021321212133303... (b=4)
√2 = 1.20134202041300003420... (b=5)
√2 = 1.22524531420552332143... (b=6)
√2 = 1.26203454521123261061... (b=7)
√2 = 1.32404746317716746220... (b=8)
√2 = 1.36485805578615303608... (b=9)
√2 = 1.41421356237309504880... (b=10)

And here’s π in the same bases:

π = 11.00100100001111110110... (b=2)
π = 10.01021101222201021100... (b=3)
π = 03.02100333122220202011... (b=4)
π = 03.03232214303343241124... (b=5)
π = 03.05033005141512410523... (b=6)
π = 03.06636514320361341102... (b=7)
π = 03.11037552421026430215... (b=8)
π = 03.12418812407442788645... (b=9)
π = 03.14159265358979323846... (b=10)

Mathematicians know that in all standard bases, the digits of √2 and π go on for ever, without falling into any regular pattern. These numbers aren’t merely irrational but transcedental. But are they also normal? That is, in each base b, do the digits 0 to [b-1] occur with the same frequency 1/b? (In general, a sequence of length l will occur in a normal number with frequency 1/(b^l).) In base 2, are there as many 1s as 0s in the digits of √2 and π? In base 3, are there as many 2s as 1s and 0s? And so on.

It’s a simple question, but so far it’s proved impossible to answer. Another question starts very simple but quickly gets very difficult. Here are the answers so far at the Online Encyclopedia of Integer Sequences (OEIS):

2, 572, 8410815, 59609420837337474 – A049364

The sequence is defined as the “Smallest number that is digitally balanced in all bases 2, 3, … n”. In base 2, the number 2 is 10, which has one 1 and one 0. In bases 2 and 3, 572 = 1000111100 and 210012, respectively. 1000111100 has five 1s and five 0s; 210012 has two 2s, two 1s and two 0s. Here are the numbers of A049364 in the necessary bases:

10 (n=2)
1000111100, 210012 (n=572)
100000000101011010111111, 120211022110200, 200011122333 (n=8410815)
11010011110001100111001111010010010001101011100110000010, 101201112000102222102011202221201100, 3103301213033102101223212002, 1000001111222333324244344 (n=59609420837337474)

But what number, a(6), satisfies the definition for bases 2, 3, 4, 5 and 6? According to the notes at the OEIS, a(6) > 5^434. That means finding a(6) is way beyond the power of present-day computers. But I assume a quantum computer could crack it. And maybe someone will come up with a short-cut or even an algorithm that supplies a(b) for any base b. Either way, I think we’ll get there, π and by.

# Phrock and Roll

What does a fractal phallus look like?

Millions of people have axed this corely key question.

The Overlord of the Über-Feral can answer it — keyly, corely and comprehensively dot dot dot

And here is the answer: Phrallic Frolics

# Tright Treeing

Here is a very simple tree with two branches:

Two-branch tree

These are the steps that a simple computer program follows to draw the tree, with a red arrow indicating where the computer’s focus is at each stage:

Two-branch tree stage 1

2-Tree stage 2

2-Tree stage 3

2-Tree stage 4

2-Tree (animated)

If you had to give the computer an explicit instruction at each stage, the instructions might look something like this:

1. Start at node 1, draw a left branch to node 2 and colour the node green.
3. Draw a right branch to node 3 and colour the node green.
4. Finish.

Now try a slightly less simple tree with branches that fork twice:

Four-branch tree (static)

These are the steps that a simple computer program follows to draw the tree, with a red arrow indicating where the computer’s focus is at each stage:

4-Tree #1

4-Tree #2

4-Tree #3

4-Tree #4

4-Tree #5

4-Tree #6

4-Tree #7

4-Tree #8

4-Tree #9

4-Tree #10

4-Tree #11

4-Tree (animated)

If you had to give the computer an explicit instruction at each stage, the instructions might look something like this:

1. Start at node 1 and draw a left branch to node 2.
2. Draw a left branch to node 3 and colour it green.
4. Draw a right branch to node 4 and colour it green.
7. Draw a right branch to node 5.
8. Draw a left branch to node 6.
9. Draw a left branch to node 7 and colour it green.
11. Draw a left branch to node 8 and colour it green.
12. Finish.

It’s easy to see that the list of instructions would be much bigger for a tree with branches that fork three times, let alone four times or you. But you don’t need to give a full set of explicit instructions: you can use a program, or a list of instructions using variables. Suppose the tree has branches that fork f times. If f = 4, you will need an array variable level() with four values, level(1), level(2), level(3) and level(4). Now follow these instructions:

1. li = 1, level(1) = 0, level(2) = 0, ... level(f+1) = 0
2. level(li) = level(li) + 1
3. If level(li) = 1, draw a branch to the left and jump to step 7
4. If level(li) = 2, draw a branch to the right and jump to step 7
5. li = li - 1 (note that this line is reached if the tests fail in lines 3 and 4)
7. If li = f, draw a green node and jump to step 5
9. li = li + 1
11. Finish.

By changing the value of f, a computer can use those eleven basic instructions to draw any size of tree (I’ve left out details like changes in the length of branches and so on). When f = 4, the tree will look like this:

16-Tree (static)

16-Tree (animated)

With simple adjustments, the program can be used for other shapes whose underlying structure can be represented symbolically as a tree. The program is in fact a fractalizer, that is, it draws a fractal. So if you use a version of the program to draw fractals based on right-triangles, you can say you are “tright treeing” (tright = triangle-that-is-right).

Here is some tright treeing. Start with a simple isoceles right-triangle. It can be divided into smaller isoceles right-triangles by finding the midpoint of the hypotenuse, then repeating:

Right-triangle rep-2 stage 1

Right-triangle #2

Tright #3

Tright #4

Tright #5

Tright #6

Tright #7

Tright #7 (no internal lines)

You can distort the isoceles right-triangle in interesting ways by finding the midpoint of a side other than the hypotenuse, like this:

Right-triangle (distorted) #1

Distorted tright #2

Distorted tright #3

Distorted tright #4

Distorted tright #5

Distorted tright #6

Distorted tright #7

Distorted tright #8

Distorted tright #9

Distorted tright #10

Distorted tright #11

Distorted tright #12

Distorted tright #13

Distorted tright (animated)

Here’s a different right-triangle. When you divide it regularly, it looks like this:

Right-triangle rep-3 stage 1

Rep-3 Tright #2

3-Tright #3

3-Tright #4

3-Tright #5

3-Tright #6

3-Tright #7

3-Tright #8

3-Tright #9

3-Tright (one colour)

When you distort the divisions, you can create interesting fractals (click on images for larger versions):

Distorted 3-Tright

Distorted 3-Tright

Distorted 3-Tright

Distorted 3-Tright

Distorted 3-Tright

Distorted 3-Tright

Distorted 3-Tright (animated)

And when four of the distorted right-triangles (rep-2 or rep-3) are joined in a diamond, you can create shapes like these:

Creating a diamond #1

Creating a diamond #2

Creating a diamond #3

Creating a diamond #4

Creating a diamond (animated)

Rep-3 right-triangle diamond (divided)

Rep-3 right-triangle diamond (single colour)

Distorted rep-3 right-triangle diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond

Distorted 3-tright diamond (animated)

Distorted rep-2 right-triangle

Distorted 2-tright diamond

Distorted 2-tright diamond

Distorted 2-tright diamond

Distorted 2-tright diamond

Distorted 2-tright diamond (animated)

# Square Routes Re-Re-Re-Revisited

Discovering something that’s new to you in recreational maths is good. But so is re-discovering it by a different route. I’ve long been passionate about what happens when a point is allowed to jump repeatedly halfway towards the randomly chosen vertices of a square. If the point can choose any vertex any number of times, the interior of the square fills slowly and completely with points, like this:

Point jumping at random halfway towards vertices of a square

However, if the point is banned from jumping towards the same vertex twice or more in a row, an interesting fractal appears:

Fractal #1 — ban on jumping towards vertex vi twice or more

If the point can’t jump towards the vertex one place clockwise of the vertex it’s just jumped towards, this fractal appears:

Fractal #2 — ban on jumping towards vertex vi+1

If the point can’t jump towards the vertex two places clockwise of the vertex it’s just jumped towards, this fractal appears (two places clockwise is also two places anticlockwise, i.e. the banned vertex is diagonally opposite):

Fractal #3 — ban on jumping towards vertex vi+2

Now I’ve discovered a new way to create these fractals. You take a filled square, divide it into smaller squares, then remove some of them in a systematic way. Then you do the same to the smaller squares that remain. For fractal #1, you do this:

Fractal #1, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Stage #7

Stage #8

Fractal #1 (animated)

For fractal #2, you do this:

Fractal #2, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Stage #7

Stage #8

Fractal #2 (animated)

For fractal #3, you do this:

Fractal #3, stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Stage #7

Stage #8

Fractal #3 (animated)

If the sub-squares are coloured, it’s easier to understand how, say, fractal #1 is created:

Fractal #1 (coloured), stage #1

Stage #2

Stage #3

Stage #4

Stage #5

Stage #6

Stage #7

Stage #8

Fractal #1 (coloured and animated)

The fractal is actually being created in quarters, with one quarter rotated to form the second, third and fourth quarters:

Fractal #1, quarter

Here’s an animation of the same process for fractal #3:

Fractal #3 (coloured and animated)

So you can create these fractals either with a jumping point or by subdividing a square. But in fact I discovered the subdivided-square route by looking at a variant of the jumping-point route. I wondered what would happen if you took a point inside a square, allowed it to trace all possible routes towards the vertices without marking its position, then imposed the restriction for Fractal #1 on its final jump, namely, that it couldn’t jump towards the vertex it jumped towards on its previous jump. If the point is marked after its final jump, this is what appears (if the routes chosen had been truly random, the image would be similar but messier):

Fractal #1, restriction on final jump

Then I imposed the same restriction on the point’s final two jumps:

Fractal #1, restriction on final 2 jumps

And final three jumps:

Fractal #1, restriction on final 3 jumps

And so on:

Fractal #1, restriction on final 4 jumps

Fractal #1, restriction on final 5 jumps

Fractal #1, restriction on final 6 jumps

Fractal #1, restriction on final 7 jumps

Here are animations of the same process applied to fractals #2 and #3:

Fractal #2, restrictions on final 1, 2, 3… jumps

Fractal #3, restrictions on final 1, 2, 3… jumps

The longer the points are allowed to jump before the final restriction is imposed on their n final jumps, the more densely packed the marked points will be:

Fractal #1, packed points #1

Packed points #2

Packed points #3

Eventually, the individual points will form a solid mass, like this:

Fractal #1, solid mass of points

Fractal #1, packed points (animated)