Before the in-depth study of fractal geometry, artists in 16th-century such as lace-makers and stone-carvers created repeating self-similar patterns and created artwork with it. A notable example is the Sierpinski’s Triangle:
source

Interestingly, the Sierpinski’s triangle also appears naturally:

In 1915, the Polish mathematician Sierpiński gave this shape its official math name, building on ideas from Georg Cantor’s work on “strange” sets that are everywhere yet take up zero space.
Nowadays folks discovered a playful way to “draw” it by randomly hopping halfway to triangle corners.
You can also play the “Chaos Game”:
- Pick the three corners of a triangle on paper.
- Randomly choose a starting point anywhere inside.
- Repeat: randomly pick one of the three corners, then move halfway from your current point toward that corner, and put a dot.
- Keep doing this thousands of times.
Play it in my google colab page.
-n=100

-n=1000

-n=10000

Another way to create the Sierpinski’s triangle is to start with a non-filled equilateral triangle. Then, draw a filled equilateral triangle where each vertex is located at the midpoint of the non-filled triangle. Create filled triangles in this fashion by using the midpoints of the non-filled equilateral triangles. This process will create Sierpinski’s triangle.
The self-similarity of the triangle is also intruiging:
Leave your comments below!
Python Code
# Demo of piraling Through the Collatz Conjecture
# Description: Plot each term of a Collatz sequence in polar coordinates, and show the result
# of a swirling spiral
# Author: Daniel Ge
# Date: 2025-04-26
import random
import matplotlib.pyplot as plt
def sierpinski_triangle(n):
A = (0,0); B = (1,0); C = (0.5, 0.866)
x, y = 0.3, 0.4 # starting point
points = []
for _ in range(n):
vertex = random.choice([A, B, C])
x = (x + vertex[0]) / 2
y = (y + vertex[1]) / 2
points.append((x,y))
xs, ys = zip(*points)
plt.scatter(xs, ys, s=0.1)
plt.axis('off')
plt.show()
n = 100
#n = 1000
#n = 10000
sierpinski_triangle(n)