“Once, in a contest with a rival, he painted a blue curve on a huge sheet of paper. Then he dipped the feet of a chicken in red paint and persuaded the bird to walk all over the paper. The resulting image, he said, represented the Tatsuta river with red maple leaves floating in it. The judge gave him the prize.” — The Japanese artist Katsushika Hokusai (c. 1760-1849) described in Thomas W. Hodgkinson’s and Hubert van den Bergh’s *How to Sound Cultured* (2015).

# Category Archives: Mathematics

# He Say, He Sigh, He Sow #44

H. Rider Haggard describes fractals:

Out of the vast main aisle there opened here and there smaller caves, exactly, Sir Henry said, as chapels open out of great cathedrals. Some were large, but one or two — and this is a wonderful instance of how nature carries out her handiwork by the same unvarying laws, utterly irrespective of size — were tiny. One little nook, for instance, was no larger than an unusually big doll’s house, and yet it might have been a model for the whole place, for the water dropped, tiny icicles hung, and spar columns were forming in just the same way. —

King Solomon’s Mines, 1885, ch. XVI, “The Place of Death”.

# Phrallic Frolics

It’s a classic of low literature:

There was a young man of Devizes

Whose balls were of different sizes:

The one was so small

’Twas no use at all;

But t’other won several prizes.

But what if he had been a young man with balls of different colours? This is a core question I want to interrogate issues around in terms of the narrative trajectory of this blog-post. Siriusly. But it’s not the keyliest core question. More corely keyly still, I want to ask what a fractal phallus might look like. Or a phrallus, for short. The narrative trajectory initializes with this fractal, which is known as a pentaflake (so-named from its resemblance to a snowflake):

Pentaflake — a pentagon-based fractal

It’s created by repeatedly replacing pentagons with six smaller pentagons, like this:

Pentaflake stage 0

Pentaflake stage 1

Pentaflake stage 2

Pentaflake stage 3

Pentaflake stage 3

Pentaflake stage 4

Pentaflake (animated)

Pentaflake (static)

This is another version of the pentaflake, missing the central pentagon of the six used in the standard pentaflake:

No-Center Pentaflake stage 0

No-Center Pentaflake stage 1

Stage 2

Stage 3

Stage 4

No-Center Pentaflake (animated)

No-Center Pentaflake (static #1)

No-Center Pentaflake (static #2)

The phrallus, or fractal phallus, begins with an incomplete version of the first stage of the pentaflake (note balls of different colours):

Phrallus stage 1

Phrallus stage 1 (monochrome)

Phrallus stage 2

Phrallus stage 3

Stage 4

Stage 5

Stage 6

Stage 7

Stage 8

And there you have it: a fractal phallus, or phrallus. Here is an animated version:

Phrallus (animated)

Phrallus (static)

But the narrative trajectory is not over. The center of the phrallus can be rotated to yield mutant phralloi. Stage #1 of the mutants looks like this:

Phrallus (mutation #1)

Phrallus (mutation #2)

Phrallus (mutation #3)

Phrallus (mutation #4)

Phrallus (mutation #5)

Mutant phralloi (rotating)

Here are some animations of the mutant phralloi:

Phrallus (mutation #3) (animated)

Phrallus (mutation #5) (animated)

This mutation doesn’t position the pentagons in the usual way:

Phrallus (another upright version) (animated)

The static mutant phralloi look like this:

Phrallus (mutation #2)

Phrallus (mutation #3)

Phrallus (upright #2)

And if the mutant phralloi are combined in a single image, they rotate like this:

Mutant phralloi (rotating)

Coloured mutant rotating phralloi #1

Coloured mutant rotating phralloi #2

# Square Routes Revisited

Take a square, divide it into four smaller squares, and discard the smaller square on the top right. Do the same to each of the subsquares, dividing it into four sub-subsquares, then discarding the one on the top right. And repeat with the sub-subsquares. And the sub-sub-squares. And the sub-sub-sub-squares. And so on. The result is a fractal like this:

Stage 1

Stage 2

Stage 3

Stage 4

Animated fractal

Final fractal (static)

It looks as though this procedure isn’t very fertile. But you can enrich it by rotating each of the subsquares in a different way, so that the discarded sub-subsquare is different. Here’s an example:

Stage 1

Stage 2

Stage 3

Stage 4

Stage 5

Stage 6

Stage 7

Animated fractal

Final fractal (static)

Here are more examples of how rotating the subsquares in different ways produces different fractals:

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Previously pre-posted:

• Square Routes — first look at this kind of fractal

# He Say, He Sigh, He Sow #43

Me dijo que su libro se llamaba el Libro de Arena, porque ni el libro ni la arena tienen ni principio ni fin. — Jorge Luis Borges, “El Libro de Arena” (1975).

He told me that his book was called the Book of Sand, because neither book nor sand has beginning or end. — Borges, “The Book of Sand“.

# Corralling Chaos

All the best people brood incessantly on the fact that a point inside a square jumping half-way towards a randomly chosen vertex will not create a fractal. Inside a triangle, yes: a fractal appears. Inside a pentagon too. But not inside a square:

Point jumping half-way towards a randomly chosen vertex

Instead, the interior of the square fills with random points: it crawls with chaos, you might say. However, fractals appear inside a square if the point is restricted in some way: banned from jumping towards a vertex twice in a row; banned from jumping towards the second-nearest vertex; and so on. Those restrictions are what might be called soft, because they take place in software (or in the brain of someone following the rule as a game or piece of performance art). Here’s what might be called a hard restriction that creates a fractal: the point cannot jump towards a randomly vertex if its jump passes over any part of the red upright cross:

Point cannot pass over red lines

I call this a barrier fractal. It’s obvious that the point cannot jump from one corner of the square towards the opposite corner, which creates bare space stretching from each vertex towards the tips of the upright cross. Less obvious is the way in which this bare space “cascades” into other parts of the square, creating a repeatedly branching and shrinking pattern.

When the barrier is a circle, a similar fractal appears:

If the point can also jump towards the center of the circle, this is what happens:

“Down through the aether I saw the accursed earth turning, ever turning, with angry and tempestuous seas gnawing at wild desolate shores and dashing foam against the tottering towers of deserted cities.” — “The Crawling Chaos” (1921), Winifred Jackson and H. P. Lovecraft.

Now here’s an upright cross with a gap in the middle:

Here’s an upright cross when the point can also jump towards the center of the cross:

A slanted cross with a central attractor:

And a single horizontal stroke:

A slanted stroke — note pentagons:

Even if the barrier is small and set on an edge of the square, it affects the rest of the square:

A more attractive example of edge-affects-whole:

Circles away from the edges

Detail of previous image

Here the point can also jump towards the center of the square’s edges:

A more subtle barrier fractal uses the previous jumps of the point to restrict its next jump. For example, if the point cannot jump across the line created by its previous-but-one jump, it moves like this:

Jump can’t cross track of last-but-one jump (animated gif)

The fractal itself looks like this:

Rule: on jump #3, cannot jump across the line created by jump #1; on jump #4, cannot cross the line created by jump #2; and so on.

And this is the fractal if the point cannot jump across the line created by its previous-but-two jump:

Rule: on jump #4, cannot jump across the line created by jump #2; on jump #5, cannot cross the line created by jump #3; and so on

# Jumper to Jumper

Previously I’ve looked at fractals created by a point moving half-way towards the random chosen vertex of a polygon. But you can also choose an initial vertex, then choose a new vertex by adding a random number to that initial vertex. Then repeat. For example, if the polygon is a square and the initial vertex is *v* = 1, then choose *v* + 3 = 4 or *v* – 1 = 3, and so on.

You can then ban or un-ban the choice of vertex-jump as you can ban or un-ban direct choices of vertex. These two methods of random choice are effectively the same, but one can be simpler to program than the other. That’s why I’ve come across some new fractals by using vertex-jumps. Here they are:

vertices = 4, vertex-jump = (1,2,3,4), ban on same choice twice in a row

vertices = 4, vertex-jump = (1,2,3,4), ban on 2 in row (black-and-white version)

*v* = 4, *vj* = (1,2,3,4), ban on choice *c* + 2 from previous choice *c*

*v* = 4, *vj* = (1,2,3,4), ban *c* + 2 (animated gif)

*vj* = (1,2,3,4), ban *c* + 2 (black-and-white)

*vj* = (1,2,3,4), ban *c* + 0 at time *t+1* unless *c* + 0 at time *t*-1

*vj* = (1,2,3,4), ban *c* + 0 at *t+1*, unless *c* + 0 at *t*-1 (black-and-white)

*vj* = (1,2,3,4,5), ban *c* + 0

*vj* = (0,1,2,3,4), ban *c* + 0

*vj* = (0,1,2,3,4), ban *c* + 0 (black-and-white)

*vj* = (1,2,3,4), ban *c* + 2 at *t*+1 unless *c* + 2 at *t*-1 (animated gif)

*vj* = (1,2,3,4), ban *c* + various at *t*+1 unless *c* + various at *t*-1 (animated gif)

*vj* = (1,2,3,4,5), ban *c* + 0 at *t*+1 unless *c* + 0 at *t*-1

*vj* = (-2,-1,0,1,2), ban *c* + 0

*vj* = (-2,-1,0,1,2), ban *c* + 0 (black-and-white)

*vj* = (0,1,2,3,4), ban *c* + va unless *c* + va

*v* = 5, *vj* = (1,2,3,4), ban *c* + 0

*v* = 5, *vj* = (1,2,3,4), ban *c* + 2

*v* = 5, *vj* = (0,1,2,3), ban *c* + 3

*v* = 6, *vj* = (0,1,2,3), ban *c* + 2

*v* = 6, *vj* = va, ban *c* + va (animated gif)

# Appointment with Distality

distal,adj.Anat.Situated away from the centre of the body, or from the point of origin (said of the extremity or distant part of a limb or organ); terminal. Opp. toproximal. [← stem ofdist-(in distantadj.) +-al, afterdorsal,ventral, etc.] —Oxford English Dictionary

When a point jumps inside a triangle, moving halfway towards a randomly chosen vertex each time, a fractal known as the Sierpiński triangle appears:

Point jumping halfway towards random vertex of a triangle

Point jumping inside triangle (black-and-white version)

But when a point moves at random in the same way inside a square, no fractal appears. Instead, the interior of the square gradually fills with a haze of pixels:

Point jumping halfway towards random vertex of a square

Now trying imposing restrictions on the point jumping inside a square. If it can’t jump towards a vertex twice in a row, this fractal appears:

Ban consecutive jumps towards same vertex

Ban consecutive jumps towards same vertex (black-and-white version)

Suppose the vertices are numbered from 1 to 4 and the point can’t jump towards the vertex one lower than the previously chosen vertex. That is, if it jumps towards vertex 3, it can’t jump next towards vertex 2, but it can jump towards vertices 1, 3, or 4 (if the vertex is 1, it’s banned from moving towards vertex 4, i.e. 1-1 = 0 = 4). Now this fractal appears:

Ban jump towards vertex *v*-1

This is the fractal when the point can’t jump towards the vertex two places lower than the one it has just jumped towards:

Ban jump towards vertex *v*-2

But if you can ban, you can also un-ban. Suppose the point jumps towards vertex

*v*at time

*t*and is then banned from jumping towards vertex

*v*-2 at time

*t*+1 unless it had jumped towards vertex

*v*-1 at time

*t*-1. This interesting fractal appears:

Ban jump *v*-2 at *t*+1 unless jump *v*-1 at *t*-1

Here are some more fractals using the ban / un-ban technique:

Ban / un-ban various

Ban jump *v*+0 at *t*+1 unless jump *v*+1 at *t*-1

Ban jump *v*+1 at *t*+1 unless jump *v*+3 at *t*-1

Ban jump *v*+0 at *t*+1 unless jump *v*+2 at *t*-1

Ban jump *v*+2 at *t*+1 unless jump *v*+2 at *t*-1

Ban / un-ban various

You can also impose or lift bans based not on the vertex the point jumps towards, but on the distance the point jumps. For example, take the radius

*r*of the circle circumscribing the square and divide it into four segments, 0 to ¼

*r*, ¼

*r*to ½

*r*, ½

*r*to ¾

*r*, and ¾

*r*to

*r*. When the point is going to jump towards vertex

*v*, test whether its jump will land in the same segment, measured from the center of the circle, as it currently occupies. If it does, ban the jump and choose another vertex. Or unban the vertex if the point occupied segment

*s*+

*x*at time

*t*-1. Here are some of the fractals produced using this technique:

Ban / un-ban based on distance jumped

Ban jump into segment *s*+0 of 4

Ban jump into segment *s*+1 from center

Ban jump into segment *s*+2

Ban jump into *s*+2 at *t*+1 unless jump into *s*+2 at at *t*-1

Ban jump into *s*+0 from present point

Ban jump into *s*+2 from present point

Ban jump into *s*+3 from present point

Ban jump into *s*+0 at *t*+1 unless jump into *s*+1 at at *t*-1

It’s easy to think of variants on all these themes, but I’ll leave them as an exercise for the interested reader.

# The Swing’s the Thing

Order emerges from chaos with a triangle or pentagon, but not with a square. That is, if you take a triangle or a pentagon, chose a point inside it, then move the point repeatedly halfway towards a vertex chosen at random, a fractal will appear:

Sierpiński triangle from point jumping halfway to randomly chosen vertex

Sierpiński pentagon from point jumping halfway to randomly chosen vertex

But it doesn’t work with a square. Instead, the interior of the square slowly fills with random points:

Square filling with point jumping halfway to randomly chosen vertex

As I showed in Polymorphous Perverticity, you can create fractals from squares and randomly moving points if you ban the point from choosing the same vertex twice in a row, and so on. But there are other ways. You can take the point, move it towards a vertex at random, then swing it around the center of the square through some angle before you mark its position, like this:

Point moves at random, then swings by 90° around center

Point moves at random, then swings by 180° around center

You can also adjust the distance of the point from the center of the square using a formula like

*dist*=

*r**

*rm*–

*dist*, where

*dist*is the distance,

*r*is the radius of the circle in which the circle is drawn, and

*rm*takes values like 0.1, 0.25, 0.5, 0.75 and so on:

Point moves at random, *dist* = *r* * 0.05 – *dist*

Point moves at random, *dist* = *r* * 0.1 – *dist*

Point moves at random, *dist* = *r* * 0.2 – *dist*

But you can swing the point while applying a vertex-ban, like banning the previously chosen vertex, or the vertex 90° or 180° away. In fact, swinging the points converts one kind of vertex ban into the others.

Point moves at random towards vertex not chosen previously

Point moves at random, then swings by 45°

Point moves at random, then swings by 360°

Point moves at random, then swings by 697.5°

Point moves at random, then swings by 720°

Point moves at random, then swings by 652.5°

Animated angle swing

You can also reverse the swing at every second move, swing the point around a vertex instead of the center or around a point on the circle that encloses the square. Here are some of the fractals you get applying these techniques.

Point moves at random, then swings alternately by 45°, -45°

Point moves at random, then swings alternately by 90°, -90°

Point moves at random, then swings alternately by 135°, -135°

Point moves at random, then swings alternately by 180°, -180°

Point moves at random, then swings alternately by 225°, -225°

Point moves at random, then swings alternately by 315°, -315°

Point moves at random, then swings alternately by 360°, -360°

Animated alternate swing

Point moves at random, then swings around point on circle by 45°

Point moves at random, then swings around point on circle by 67.5°

Point moves at random, then swings around point on circle by 90°

Point moves at random, then swings around point on circle by 112.5°

Point moves at random, then swings around point on circle by 135°

Point moves at random, then swings around point on circle by 180°

Animated circle swing

# Tri Again (Again)

I didn’t expect to find the hourglass fractal playing with squares. I even less expected it playing with triangles. Isosceles right triangles, to be precise. Then again, I found it first playing with the L-triomino, which is composed of three squares. And an isosceles triangle is half of a square. So it all fits. This is an isosceles right triangle:

Isosceles right triangle

It’s mirror-symmetrical, so it looks the same in a mirror unless you label one of the acute-angled corners in some way, like this:

Right triangle with labelled corner

Right triangle reflected

Reflection is how you find the hourglass fractal. First, divide a right triangle into four smaller right triangles.

Right triangle rep-tiled

Then discard one of the smaller triangles and repeat. If the acute corners of the smaller triangles have different orientations, one of the permutations creates the hourglass fractal, like this:

Hourglass #1

Hourglass #2

Hourglass #3

Hourglass #4

Hourglass #5

Hourglass #6

Hourglass #7

Hourglass #8

Hourglass #9

Hourglass animated

Another permutation of corners creates what I’ve decided to call the crane fractal, like this:

Crane fractal animated

Crane fractal (static)

The crane fractal is something else that I first found playing with the L-triomino:

Crane fractal from L-triomino

Previously pre-posted: