Chaos game is an algorithm of creating a fractal by a random process. The steps of the algorithm is as follows:

  1. Pick a point at random inside or outside a regular $n$-gon.
  2. Pick a vertex of $n$-gon at random.
  3. Then draw the next point a fraction $r$ of the distance between it and a vertex of $n$-gon picked at random.
  4. Repeat this iterative process a large number of times. The result of this is generally a fractal.

This applet demonstrates chaos game for $n=3$. The result of the game is a fractal which is known as Sierpinski triangles.

Number of points: