Sierpiński triangle builder
Cut a triangle into four and throw away the middle one. Do the same to the three triangles that are left, and again, and again. What remains is the Sierpiński triangle, a shape made of three half-size copies of itself, with no area and endless edges. Build it level by level, grow it from random jumps in the chaos game, or find it hidden in the odd numbers of Pascal's triangle, and change the corners, jumps and remainders to see the fractals next door.
How it works
- Choose a method: remove middles, the chaos game or Pascal's triangle.
- Press Play or Step to remove the next level or to add points, or set the rows and the remainder for Pascal's triangle.
- Change the corners, the jump and the rule of the chaos game, and read the triangles, the area and the fractal dimension in the tiles.
Three roads to one fractal
Removing middles builds the triangle from the outside in: after n rounds there are \(3^{n}\) triangles left, holding \((3/4)^{n}\) of the area, so after 10 rounds less than 6% remains. The chaos game builds it from the inside out: start anywhere, jump halfway to a corner picked at random, mark the spot and repeat.
However the dice fall, the marks settle on the Sierpiński triangle. And in Pascal's triangle, where each number is the sum of the two above it, colouring the odd numbers draws the same picture, because odd plus even and even plus odd are odd, but odd plus odd is even.
Fractal dimension
Halve the size of a line and you need 2 copies to cover it; halve a square and you need 4, a cube 8. Those are \(2^{1}\), \(2^{2}\) and \(2^{3}\), and the exponent is the dimension. Halve the Sierpiński triangle and you need 3 copies, so its dimension d solves \(2^{d}=3\): \(d=\log 3/\log 2\approx 1.585\). It is more than a curve and less than a surface.
The chaos game with other corners and jumps gives other dimensions: 5 corners with a jump of 0.618 give a pentagon of pentagons, 6 corners with a jump of 2/3 a snowflake of hexagons.
Using the app
Choose one of three ways to build the fractal. Remove middles cuts the middle out of every triangle, one level at a time: press Play or Step. The chaos game jumps from point to point, each time part of the way towards a corner picked at random, and marks every landing spot; change the number of corners, the jump and the rule to grow other fractals.
Pascal's triangle colours every number by its remainder: the odd numbers draw the Sierpiński triangle.
Frequently asked questions
Why does the chaos game always give the same shape?
Each jump halves the distance between the point and the copy of the triangle that belongs to the chosen corner. Whatever the starting point, after a handful of jumps it is so close to the triangle that the difference is smaller than a pixel, and from then on every jump maps the triangle onto one of its three halves.
The random choices only decide in which order the triangle gets filled in.
What happens with four corners?
With 4 corners and a jump of 1/2 the four half-size copies cover the square exactly, so the points simply fill it in, with no holes. Add a rule, such as never picking the same corner twice or never a neighbour of the last corner, and a fractal appears again, because certain regions can no longer be reached.
Why do the odd numbers of Pascal's triangle make the Sierpiński triangle?
Rows 0 to \(2^{k}-1\) of Pascal's triangle mod 2 form a triangle, and the next \(2^{k}\) rows contain two copies of it with an empty triangle of zeros between them, exactly like the removal. Lucas's theorem of 1878 gives the reason: C(n, k) is odd exactly when every binary digit 1 of k is also a 1 in n.
What about other remainders?
For a prime p, Pascal's triangle mod p is also self-similar, made of \(p(p+1)/2\) copies at \(1/p\) scale: dimension \(\log 6/\log 3\approx 1.63\) for \(p=3\) and \(\log 15/\log 5\approx 1.68\) for \(p=5\). Remainders by composite numbers such as 4 or 6 make patterns that combine those of their factors.
What is the area and perimeter of the Sierpiński triangle?
The area is zero and the perimeter is infinite. Each round of removing middles keeps 3/4 of the area and multiplies the total perimeter by 3/2, so after n rounds \((3/4)^{n}\) of the area is left and the perimeter is \((3/2)^{n}\) times the original. Choose Remove middles and watch the Area left tile fall while the perimeter grows.
謝爾賓斯基三角形建構: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device.Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner.The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF.You can add one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
前往編輯器