Two roads to the same triangle
The Sierpiński triangle (Wacław Sierpiński, 1915) can be built by two completely different processes that converge on exactly the same shape, and seeing both is the fastest way to understand what a fractal actually is. The recursive way: take a filled triangle, connect the midpoints of its three sides to carve out the central inverted triangle, and repeat the same operation on each of the three remaining corner triangles, forever.
sierpinski(triangle, depth): if depth == 0: draw(triangle); return mid = midpoints of triangle's three sides sierpinski(cornerTriangle(triangle.A, mid.AB, mid.CA), depth-1) sierpinski(cornerTriangle(mid.AB, triangle.B, mid.BC), depth-1) sierpinski(cornerTriangle(mid.CA, mid.BC, triangle.C), depth-1) // the middle triangle is never recursed into - it stays empty
The chaos game: pure randomness, structured result
The second construction looks nothing like the first and has no recursion at all. Fix the triangle's three vertices. Start at any point. Repeatedly pick one of the three vertices at random, jump halfway from the current point to that vertex, and plot the new point. Do this a few thousand times and, remarkably, the exact same Sierpiński triangle emerges from what looks like pure noise.
point = randomPointInsideTriangle()
repeat many thousands of times:
vertex = triangle.vertices[randomInt(0, 2)]
point = midpoint(point, vertex) // jump halfway toward the chosen vertex
plot(point) // after the first few iterations,
// every plotted point lies on the fractal
This is called the chaos game (Barnsley, 1988), and it works because the halfway-jump rule is exactly the same iterated function system that generates the triangle recursively, viewed from the other direction: recursion subdivides space top-down into smaller and smaller copies, while the chaos game is a Markov process whose long-run distribution of visited points is that same self-similar set — two views of the same underlying contraction mapping.
Hausdorff dimension: not a line, not a plane
A Sierpiński triangle is neither a one-dimensional curve nor a two-dimensional filled region — it has zero area (each subdivision step removes exactly 1/4 of the remaining filled area, and repeating that infinitely leaves none) yet it is not a simple curve either. Its Hausdorff dimension captures this precisely: scale the triangle up by a factor of 2 and it decomposes into exactly 3 copies of itself (not 4, because the middle piece is missing), and the dimension D solves 2^D = 3:
D = log(3) / log(2) ~ 1.585 // compare: a solid square scaled by 2 makes 4 copies => log(4)/log(2) = 2 (ordinary 2D) // a line segment scaled by 2 makes 2 copies => log(2)/log(2) = 1 (ordinary 1D)
A dimension of roughly 1.585 — strictly between 1 and 2 — is a precise, non-metaphorical statement that the triangle fills space more thoroughly than a curve but less thoroughly than a solid area, and it is the same self-similarity ratio (log(copies)/log(scale factor)) used to compute the dimension of every other exactly self-similar fractal, coastlines included, just with different copy counts and scale factors.
A surprising appearance: Pascal's triangle mod 2
Take Pascal's triangle of binomial coefficients, and colour a cell black if its value is odd and white if it is even (equivalently, compute each entry modulo 2). The resulting pattern, extended to enough rows, is the Sierpiński triangle — a purely number-theoretic object (which entries of a combinatorial table are odd) reproducing exactly the same self-similar shape as the geometric recursion and the random chaos game, a coincidence that turns out not to be a coincidence: all three are consequences of the same underlying binary self-similarity.
Frequently asked questions
How can a purely random process produce a precise geometric fractal?
Because the halfway-jump rule of the chaos game is mathematically the same iterated function system that generates the triangle by recursive subdivision - it is just applied as a sequence of random individual points converging to the shape's long-run distribution, rather than as a top-down recursive carve. Given enough iterations the plotted points fill in exactly the same self-similar set.
Does the Sierpinski triangle have any area at all?
In the limit, no - each subdivision step removes a quarter of the remaining filled area, and repeating that infinitely many times leaves zero area. It is still not a simple one-dimensional curve either, which is exactly why its Hausdorff dimension of about 1.585 sits strictly between 1 and 2.
Is the connection to Pascal's triangle a coincidence?
No. Colouring Pascal's triangle by whether each binomial coefficient is odd or even produces the Sierpinski pattern because of the same binary, self-similar recursive structure that generates the triangle geometrically - it is a different mathematical route to an identical underlying pattern, not an unrelated coincidence.
Try it live
Everything above runs in your browser — open Sierpinski Triangle and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Sierpinski Triangle simulation