# Sierpinski triangle

Sierpinski triangle
Generated using a random algorithm
Sierpinski triangle in logic: The first 16 conjunctions of lexicographically ordered arguments. The columns interpreted as binary numbers give 1, 3, 5, 15, 17, 51... (sequence A001317 in the OEIS)

The Sierpinski triangle (also with the original orthography Sierpiński), also called the Sierpinski gasket or the Sierpinski sieve, is a fractal and attractive fixed set with the overall shape of an equilateral triangle, subdivided recursively into smaller equilateral triangles. Originally constructed as a curve, this is one of the basic examples of self-similar sets, i.e., it is a mathematically generated pattern that is reproducible at any magnification or reduction. It is named after the Polish mathematician Wacław Sierpiński, but appeared as a decorative pattern many centuries before the work of Sierpiński.[1][2]

## Constructions

There are many different ways of constructing the Sierpinski triangle.

### Removing triangles

The evolution of the Sierpinski triangle

The Sierpinski triangle may be constructed from an equilateral triangle by repeated removal of triangular subsets:

2. Subdivide it into four smaller congruent equilateral triangles and remove the central triangle.
3. Repeat step 2 with each of the remaining smaller triangles forever.

Each removed triangle (a trema) is topologically an open set.[3] This process of recursively removing triangles is an example of a finite subdivision rule.

### Shrinking and duplication

The same sequence of shapes, converging to the Sierpinski triangle, can alternatively be generated by the following steps:

1. Start with any triangle in a plane (any closed, bounded region in the plane will actually work). The canonical Sierpinski triangle uses an equilateral triangle with a base parallel to the horizontal axis (first image).
2. Shrink the triangle to 1/2 height and 1/2 width, make three copies, and position the three shrunken triangles so that each triangle touches the two other triangles at a corner (image 2). Note the emergence of the central hole—because the three shrunken triangles can between them cover only 3/4 of the area of the original. (Holes are an important feature of Sierpinski's triangle.)
3. Repeat step 2 with each of the smaller triangles (image 3 and so on).

Note that this infinite process is not dependent upon the starting shape being a triangle—it is just clearer that way. The first few steps starting, for example, from a square also tend towards a Sierpinski triangle. Michael Barnsley used an image of a fish to illustrate this in his paper "V-variable fractals and superfractals."[4][5]

Iterating from a square

The actual fractal is what would be obtained after an infinite number of iterations. More formally, one describes it in terms of functions on closed sets of points. If we let dA denote the dilation by a factor of 1/2 about a point A, then the Sierpinski triangle with corners A, B, and C is the fixed set of the transformation dA ∪ dB ∪ dC.

This is an attractive fixed set, so that when the operation is applied to any other set repeatedly, the images converge on the Sierpinski triangle. This is what is happening with the triangle above, but any other set would suffice.

### Chaos game

Animated creation of a Sierpinski triangle using the chaos game

If one takes a point and applies each of the transformations dA, dB, and dC to it randomly, the resulting points will be dense in the Sierpinski triangle, so the following algorithm will again generate arbitrarily close approximations to it:[6]

Start by labeling p1, p2 and p3 as the corners of the Sierpinski triangle, and a random point v1. Set vn+1 = 1/2(vn + prn), where rn is a random number 1, 2 or 3. Draw the points v1 to v. If the first point v1 was a point on the Sierpiński triangle, then all the points vn lie on the Sierpinski triangle. If the first point v1 to lie within the perimeter of the triangle is not a point on the Sierpinski triangle, none of the points vn will lie on the Sierpinski triangle, however they will converge on the triangle. If v1 is outside the triangle, the only way vn will land on the actual triangle, is if vn is on what would be part of the triangle, if the triangle was infinitely large.

Animated construction of a Sierpinski triangle
A Sierpinski Triangle is outlined by a fractal tree with three branches forming an angle of 60° between each other. If the angle is reduced, the triangle can be continuously transformed into a fractal resembling a tree.

Or more simply:

1. Take three points in a plane to form a triangle, you need not draw it.
2. Randomly select any point inside the triangle and consider that your current position.
3. Randomly select any one of the three vertex points.
4. Move half the distance from your current position to the selected vertex.
5. Plot the current position.
6. Repeat from step 3.

This method is also called the chaos game, and is an example of an here.

Sierpinski triangle using an iterated function system

Construction of the Sierpiński arrowhead curve

Another construction for the Sierpinski triangle shows that it can be constructed as a curve in the plane. It is formed by a process of repeated modification of simpler curves, analogous to the construction of the Koch snowflake:

2. Repeatedly replace each line segment of the curve with three shorter segments, forming 120° angles at each junction between two consecutive segments, with the first and last segments of the curve either parallel to the original line segment or forming a 60° angle with it.

The resulting fractal curve is called the Sierpiński arrowhead curve, and its limiting shape is the Sierpinski triangle.[7] Actually the aim of the original article by Sierpinski of 1915, was to show an example of a curve (a Cantorian curve), as the title of the article itself declares.[8][2]

### Cellular automata

The Sierpinski triangle also appears in certain cellular automata (such as Rule 90), including those relating to Conway's Game of Life. For instance, the Life-like cellular automaton B1/S12 when applied to a single cell will generate four approximations of the Sierpinski triangle.[9] A very long one cell thick line in standard life will create two mirrored Sierpinski triangles. The time-space diagram of a replicator pattern in a cellular automaton also often resembles a Sierpinski triangle, such as that of the common replicator in HighLife.[10] The Sierpinski triangle can also be found in the Ulam-Warburton automaton and the Hex-Ulam-Warburton automaton.[11]

### Pascal's triangle

A level-5 approximation to a Sierpinski triangle obtained by shading the first 25 (32) levels of a Pascal's triangle white if the binomial coefficient is even and black otherwise

If one takes Pascal's triangle with 2n rows and colors the even numbers white, and the odd numbers black, the result is an approximation to the Sierpinski triangle. More precisely, the limit as n approaches infinity of this parity-colored 2n-row Pascal triangle is the Sierpinski triangle.[12]

### Towers of Hanoi

The Towers of Hanoi puzzle involves moving disks of different sizes between three pegs, maintaining the property that no disk is ever placed on top of a smaller disk. The states of an n-disk puzzle, and the allowable moves from one state to another, form an undirected graph, the Hanoi graph, that can be represented geometrically as the intersection graph of the set of triangles remaining after the nth step in the construction of the Sierpinski triangle. Thus, in the limit as n goes to infinity, this sequence of graphs can be interpreted as a discrete analogue of the Sierpinski triangle.[13]

Other Languages