qr code

BIT-101

Bill Gates touched my MacBook Pro

Questioning Sierpinski


[ fractal ]

I had a stray thought about the Sierpinski triangle this morning. A different way of looking at it. I’m under no illusions that I’m the first one to try this idea out, but in the 35+ years I’ve been obsessed with fractals, chaos and strange attractors, I’ve never run across any examples like this, which is surprising, because it’s a very simple idea.

I tried the idea out and found it created some very nice patterns, some very Sierpinski-like, and some quite unexpected. So I figured I’d share.

Background

A quick refresher on the Sierpinski triangle. I assume you all know how it works, so I’ll be brief.

You take an equilateral triangle, split it into four equal triangles and remove the center one.

level one sierpinski triangle

Then you do the same for the three remaining triangles.

level two sierpinski triangle

And so on, down to the level where the scale is so small you’re not seeing the results anymore.

full sierpinski triangle

You know all this.

Question Authority

My stray thought this morning was, “why do we always remove the center triangle?”

What happens if we start removing other triangles instead?

Let’s try it. We’ll remove the top triangle.

level one sierpinski triangle with top triangle removed

Note: there’s some artifacting here - you can see a faint line between each rendered triangle. Though not initially intended, it kind of works to my advantage, letting you see the different triangles to some degree.

OK, fine. Now when we go to the next level, we have that center triangle still. But when we split that up, it’s not going to have a “top triangle”. Well, we can just say that triangle was rotated 180 degrees, so we rotate the algorithm by 180 degrees, and remove the bottom triangle. Now level two looks like this.

level two sierpinski triangle with top triangle removed

The next level…

level three sierpinski triangle with top triangle removed

And all the way down (visibly anyway)

full sierpinski triangle with top triangle removed

Now what happens if instead or removing the top triangle, we always remove the bottom right?

full sierpinski triangle with bottom right triangle removed

Or the bottom left?

full sierpinski triangle with bottom left triangle removed

It’s just the same thing, rotated. Makes sense. 

So far, it’s still vaguely Sierpinski-ish, but… there’s a lot of other stuff going on there.

Keep Questioning

We made an easy assumption there when we decided how to deal with the upside-down center triangle. We said it was just rotated 180 degrees. But it could have been rotated 60 degrees to the left or 60 degrees to the right and also appear as an “upside down” triangle. Now our “top”, “bottom left”, bottom right” terminology starts to get confusing. So let’s label the different triangles A, B, C and D. 

level sierpinski triangle with triangles labeled A, B, C clockwise, with D in the center

In the conventional Sierpinski, we always remove D. So how we rotate the center triangle doesn’t matter. When we’re removing A, B or C, it starts to make a big difference. We have three possibilities, with three different outcomes. We can rotate the center triangle so that A is at the bottom, or B is at the bottom or C is at the bottom. 

level sierpinski triangle with inner triangles labeled A, B, C clockwise, A being at the bottom

In the example we did above, we had A at the bottom. But let’s rotate the triangle 60 degrees clockwise so B is at the bottom like this:

level sierpinski triangle with inner triangles labeled A, B, C clockwise, B being at the bottom

Removing the top triangle, one iteration looks no different.

level one sierpinski triangle with top triangle removed

But two iterations…

level two sierpinski triangle with top triangle removed

Three…

level three sierpinski triangle with top triangle removed

Four…

level four sierpinski triangle with top triangle removed

And finally…

full sierpinski triangle with top triangle removed

Now we’ve got something very different!

Now let’s do the same thing, but rotating the center triangle so C is at the bottom.

level sierpinski triangle with inner triangles labeled A, B, C clockwise, C being at the bottom

And removing the top triangle and rendering that all out…

full sierpinski triangle with top triangle removed

We have the same image, flipped.

Just to be clear, we can still remove the bottom right triangle (B) or bottom left (C) and we get the same image rotated:

full sierpinski triangle with bottom right triangle removed full sierpinski triangle with bottom left triangle removed

Question Me

Earlier, I said when we had three choices on how to orient the center triangle, I lied.

There are three choices if we only rotate. But we can also mirror that triangle as we rotate it. Which gives us 3 more possibilities:

level sierpinski triangle with inner triangles labeled A, B, C counterclockwise, A being at the bottom level sierpinski triangle with inner triangles labeled A, B, C counterclockwise, B being at the bottom level sierpinski triangle with inner triangles labeled A, B, C counterclockwise, C being at the bottom

Let’s take the first one first, removing the top triangle.

full sierpinski triangle with top triangle removed

No difference from what we originally had. Actually, it is flipped on the x-axis, but since it’s symmetrical, you can’t tell.

But when we remove the right or left triangles, we get something brand new.

full sierpinski triangle with bottom right triangle removed full sierpinski triangle with bottom left triangle removed

Now we have a bunch of squashed Sierpinskis lined up. Neat!

What happens when we put B on the bottom?

Removing the top triangle…

full sierpinski triangle with top triangle removed

Again we have infinite Sierpinskis lined up, but oriented differently and skewed a bit.

Bottom right…

full sierpinski triangle with bottom right triangle removed

Bottom left…

full sierpinski triangle with bottom left triangle removed

This one goes back to the original again.

Finally, for the sake of completeness, we’ll do the same with C on the bottom, removing top, bottom right, bottom left:

full sierpinski triangle with top triangle removed full sierpinski triangle with bottom right triangle removed full sierpinski triangle with bottom left triangle removed

All the same, but differently oriented.

OK, we got all six orientations of the center triangle covered. So we’re all done, right?

Not even close!

Question Harder!

What about each of those three outer triangles? So far we’ve been orienting them all the same as the original: A on top, B on the bottom right, C on the bottom left.

But each one of those could be oriented in six different ways. That’s four triangles, each of which could be oriented six ways. 6x6x6x6, or 1296 possible variations!

Not to mention the fact that you can choose which triangle to remove - A, B or C, which triples the possibilities. Of course, many of the iterations will be the same as others, some just mirrored or rotated a bit differently, but there are still quite a few interesting ones.

I’m not going to go through all of them, but here’s a few neat ones I found:

Some of these are looking curiously like Julia fractals!

Question the Question

Everything is too stable. We’re always removing the same triangle throughout all the iterations of an image. I took just ONE of the examples from the above list and altered it so that on each iteration, it randomly decides which triangle to remove.

And that’s only the start. You could randomly choose which order each triangle is in - in each iteration. Or not randomly - do it according to some scheme. I feel like I’ll be exploring this one for a while.

Question the End

After posting, I kept finding more nice looking ones. Here’s a few more.

« Previous Post
Next Post »

Comments? Best way to shout at me is on Mastodon

Or share this post directly on Mastodon