The Sierpiński triangle explained
The Sierpiński triangle is the friendliest of fractals: easy to draw with a pencil, yet strange enough to have no area, an infinite perimeter and a dimension that is not a whole number. It turns up in places that have nothing to do with triangles, from coin tossing and Pascal's triangle to the Tower of Hanoi and simple cellular automata, which makes it a perfect first window into the mathematics of self-similarity.
The construction
Start with a filled triangle. Join the midpoints of its sides: this cuts it into four triangles of half the size, and the middle one is removed. Repeat with each of the three triangles that remain, and keep going forever. The Polish mathematician Wacław Sierpiński described this shape in 1915, though the same pattern decorates the floors of Italian churches laid by Cosmati craftsmen in the 13th century.
No area, endless edges
Each round keeps three quarters of what was there, so after n rounds the remaining area is (3/4)ⁿ of the original: 56% after two rounds, 6% after ten, and nothing in the limit. Meanwhile each round triples the number of triangles while halving their size, so the total length of the edges grows by a factor of 3/2 every time and has no limit. The finished triangle is a set of points with zero area and infinite length.
Self-similarity and dimension
The Sierpiński triangle is made of three copies of itself, each scaled by one half. Scaling a line by one half leaves 2 copies, a square 4 and a cube 8, or 2¹, 2² and 2³; the exponent is the dimension. For the triangle 2^d = 3, so d = log 3 / log 2 ≈ 1.585. This similarity dimension agrees with the more general Hausdorff dimension here, and it measures how the shape fills space: more than any curve, less than any surface.
The chaos game
In 1988 Michael Barnsley popularised a strange way to draw it. Mark the three corners, start at any point, and repeat: pick a corner at random, move halfway towards it and mark the new point. After a few thousand marks the Sierpiński triangle appears, sharp and complete, with not a single point in the holes. The reason is that the three halfway moves are exactly the three maps that shrink the triangle onto its three copies; any point is pulled towards the one shape that all three maps leave unchanged. This is the idea of an iterated function system, which also draws Barnsley's fern.
Other corners, jumps and rules
Change the game and other fractals appear. With five corners and a jump of 0.618 towards each, the copies just touch and form a pentagon of pentagons; with six corners and a jump of 2/3, a hexagonal snowflake. With four corners and a jump of 1/2 the copies cover the square and no fractal appears, but forbidding the same corner twice, or a neighbour of the last one, removes whole regions and brings intricate patterns back. The dimension of the plain game with n corners and jump r is log n / log(1/(1 − r)), as long as the copies do not overlap.
Pascal's triangle
Write Pascal's triangle, where each number is the sum of the two above it, and colour the odd numbers. The Sierpiński triangle appears, because only odd plus even gives odd. Édouard Lucas proved in 1878 that the binomial coefficient C(n, k) is odd exactly when the binary digits of k fit inside those of n, which makes the self-similar pattern precise. Remainders by other primes give their own fractal triangles, with p(p + 1)/2 copies at scale 1/p.
Where else it appears
The cellular automaton Rule 90, in which each cell becomes the exclusive or of its two neighbours, grows a Sierpiński triangle from a single cell; this is Pascal's triangle mod 2 again. The graph of all positions of the Tower of Hanoi with n disks, joined by legal moves, is a Sierpiński triangle of level n. Its relatives include the Sierpiński carpet of 1916, a square with the middle ninth removed again and again, and the three-dimensional Menger sponge.
Explore it
Open the Sierpiński triangle builder to remove middles level by level and watch the area fall and the triangles multiply, play the chaos game at any speed with three to eight corners, several jumps and three rules, and colour Pascal's triangle by remainders from 2 to 9 with up to 256 rows. The tiles give the counts and the fractal dimension for each method.
Frequently asked questions
Is the Sierpiński triangle the same as the Sierpiński gasket?
Yes. Both names are used, as is Sierpiński sieve. The Sierpiński carpet is a different fractal, made from a square with its middle ninth removed.
Can a shape really have a dimension of 1.585?
Yes, in the sense of how its size grows as it is measured more finely. Doubling the resolution multiplies the number of small triangles needed to cover it by 3, where a line would need 2 and a surface 4. The exponent that turns 2 into 3, log 3 / log 2, is its dimension. Many natural shapes, such as coastlines and ferns, have dimensions that are not whole numbers.
Does the chaos game depend on the random numbers?
Only the order in which the points appear depends on them. Any sequence that keeps choosing every corner now and then fills in the same triangle. If the random numbers were biased towards one corner, that part would fill in faster, but the shape would stay the same.
How many levels can be drawn?
The builder removes up to 9 levels, which leaves 19,683 triangles, each smaller than a pixel on most screens. Beyond that the picture no longer changes, even though the mathematical shape keeps losing area.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Open the Sierpiński triangle builder