The Magic Sierpinski Triangle
Order dependent on randomness
This design is called Sierpinski's Triangle (or gasket), after the Polish mathematician Waclaw Sierpinski who described some of its interesting properties in 1916. Among these is its fractal or selfsimilar character. The large blue triangle consists of three smaller blue triangles, each of which itself consists of three smaller blue triangles, each of which ..., a process of subdivision which could, with adequate screen resolution, be seen to continue indefinitely. Fractals and selfsimilarity are of considerable interest in their own right, but our interest here is in how to construct Sierpinski's triangle. One way to do so is to inscribe a second triangle inside the original one, by joining the midpoints of the three sides, and then repeat the process for the resulting three outer triangles, for the three outer triangles that result from that, and so forth. But there is a more intriguing way to construct Sierpinski's triangle, sometimes called the Chaos Game.
Below is a starting triangle with three vertices, labelled X, Y, and Z. Select one of the three vertices by clicking on the appropriate one of the three buttons at the bottom of the display. The computer will then ask you to select a starting point for the construction by clicking somewhere (anywhere you want) within the triangle. When you have done so, the computer will draw a line from your selected started point to your previously selected vertex and place a dot at the midpoint of this line. The dot will remain, and also serves as the new starting point for the next round of the construction. Make a second vertex choice (the same or different) and the computer will draw a line from that vertex to the new starting point and place a dot at the midpoint of that line. Repeat the process over and over again and you may (or may not) get Sierpinski's triangle, depending on how you choose the vertices. Of course the dots are pretty small, and you're going to have to repeat the process a lot of times before you will be able to see what you've got. Want a shortcut?
Click on the Go button, and Serendip will do the job for you, much more quickly and with the right way of choosing the vertices. Try it. Voila, Sierpinski's triangle (click the Stop button when you're convinced or Serendip will just keep going). Pretty neat, huh?

Lots of interesting questions have probably occurred to you. Does the pattern depend on the particular triangle you start with? Find out by clicking on the Custom button and creating your own triangle. Does the choice of the initial point matter? Try that out too by clicking the Clear button and selecting a new point inside the triangle. How come this construction gives the same (itself rather remarkable) pattern as inscribing triangles? We'll leave that and some other questions to others, or as the proverbial exercises for the reader.
Let's focus on one particularly interesting question: what is the right way of choosing the vertices? Here too, you can experiment yourself, trying out different patterns of picking the vertices one at a time, but that would take a long time and so we have again provided a shortcut. Click on the vertex pattern Select button, and you'll get a new display which allows you to tell Serendip how to make the vertex choices. After you choose from the list, click OK and then GO and Serendip will quickly construct the pattern following that rule (remember to click Stop when you've seen enough to tell what's going on). 
Try picking the same vertex every time (the first choice), and alternating between two vertices (the second choice). (You can do these patterns yourself if you want so the construction goes more slowly and you can see what is happening). Clearly Sierpinski's triangle depends on a selection pattern involving all three vertices. So now try a pattern of successive choices of each of the three vertices (the third choice). Hmmmmm. THAT's not good enouh, even though each vertex is used and used the same number of times. Got a better idea? Enter your own choice of a selection pattern (any order of X,Y, and Z up to a length of 100 characters) in the text area (the third choice). Serendip will try and construct Sierpinski's triangle repeating that pattern over and over again (until you hit Stop). Still not good enough? So what WAS Serendip doing back at the beginning? How SHOULD one select the vertices to get Sierpinski's triangle? That's the fourth choice on the display panel, and in that case Serendip is using all three vertices an equal number of times but is picking them randomly, so that there is no pattern whatsoever in its choices. And the choices really have to be RANDOM (in the sense of any one choice being made completely independently of prior choices . Disorderly (in the sense of its being very hard to guess the next choice from the history of prior choices), as in many chaotic systems, isn't good enough. You can verify this by trying the fifth choice,. Here Serendip uses an interation of the logistical equation, a highly disordered sequence of choices which would look to you like a random pattern but isn't (in the sense used above).
Interesting, no? The elegant order of Sierpinski's Triangle is, in this
construction, fundamentally dependent on randomness. Surprised by
that? Most people are, but probably shouldn't be. Randomness plays a key
role in lots of forms of order (our
own existence, for example, as an outcome of an evolutionary process), a
central (and desireable) role in lots of our own behavior and behavioral strategies , and, almost
certainly, an essential role in our trying to make sense of both the universe and ourselves.
Constructed by Paul Grobstein, Jeff Oristaglio, Milan Radojic, and Bogdan Butoi. Applet by Bodgan Butoi and Milan Radojic. Based in part on Peitgen, H.O., Jurgens, H., and Saupe, D. Fractals for the Classroom , SpringerVerlag, 1992.

