# Sierpinski triangle

The

**Sierpinski triangle**, also called the

**Sierpinski gasket**, is a

fractal, named after

Waclaw Sierpinski.

An algorithm for obtaining arbitrarily close approximations to the Sierpinski triangle is as follows:

- Start with any triangle in a plane. The canonical Sierpinski triangle uses an equilateral triangle with a base parallel to the horizontal axis.
- Shrink the triangle by 1/2, make three copies, and translate them so that each triangle touches the two other triangles at a corner.
- Repeat step 2 with each of the smaller triangles.

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 d_a note 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 d_a U d_b U d_c.

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.

If one takes a point and applies each of the transformations d_a, d_b, and d_c 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:

Start by labelling **p**_{1}, **p**_{2} and **p**_{3} as the corners of the Sierpinski triangle, and a random point **v**_{1}. Set **v**_{n+1} = ½ ( **v**_{n} + **p**_{rn} ), where r_{n} is a random number 1, 2 or 3. Draw the points **v**_{1} to **v**_{∞}. If the original point **v**_{n} was a point on the Sierpinski triangle, then all the points **v**_{n} lie on the Sierpinski triangle. If the first point **v**_{n} to lie within the perimiter of the triangle is not a point on the Sierpinski triangle, none of the points **v**_{n} will lie on the Sierpinski triangle, however they will converge on the triangle. If **v**_{1} is outside the triangle, the only way **v**_{n} will land on the actual triangle, is iff **v**_{n} is on what would be part of the triangle, if the triangle was infinitely large.

The Sierpinski triangle has Hausdorff dimension log(3)/log(2) ≈ 1.585, which follows from the fact that it is a union of three copies of itself, each scaled by a factor of 1/2.

If one starts with Pascal's triangle with 2^*n* rows and colors the even numbers white, and the odd numbers black, the result is an approximation to the Sierpinski's triangle. This calculation is actually a manifestation of elementary cellular automaton rule 90.

Sierpinski triangle of eight iterations

See also:

- Sierpinski carpet, a similar construction of rectangles
- A C program to create such a fractal

## External Links