page_title: Sierpiński triangle
section_title: Chaos game
hierarchical_section_title: Sierpiński triangle / Constructions / Chaos game
caption_attribution_description: English: Fractal tree with angle between branches starting from 60 degrees, which gives rise to a Sierpinski triangle, and then continuously decreasing until the pattern looks like a tree. Created with the free software arve.
context_page_description: The Sierpiński triangle, also called the Sierpiński gasket or Sierpiński sieve, is a fractal 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—that is, 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.
context_section_description: 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:
  Start by labeling p₁, p₂ and p₃ as the corners of the Sierpinski triangle, and a random point v₁. Set vₙ₊₁ = (vₙ + pᵣₙ), where rₙ is a random number 1, 2 or 3. Draw the points v₁ to v∞. If the first point v₁ was a point on the Sierpiński triangle, then all the points vₙ lie on the Sierpinski triangle. If the first point v₁ to lie within the perimeter of the triangle is not a point on the Sierpinski triangle, none of the points vₙ will lie on the Sierpinski triangle, however they will converge on the triangle. If v₁ is outside the triangle, the only way vₙ will land on the actual triangle, is if vₙ is on what would be part of the triangle, if the triangle was infinitely large.
  Or more simply:
  Take three points in a plane to form a triangle, you need not draw it.
  Randomly select any point inside the triangle and consider that your current position.
  Randomly select any one of the three vertex points.
  Move half the distance from your current position to the selected vertex.
  Plot the current position.
  Repeat from step 3.
  This method is also called the chaos game, and is an example of an iterated function system. You can start from any point outside or inside the triangle, and it would eventually form the Sierpinski Gasket with a few leftover points (if the starting point lies on the outline of the triangle, there are no leftover points). With pencil and paper, a brief outline is formed after placing approximately one hundred points, and detail begins to appear after a few hundred. An interactive version of the chaos game can be found here.
caption: 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.