Yesterday a link to a guy who had created a pretty good replica of the Mona Lisa out of semi-transparent, colored polygons using an evolutionary algorithm made the rounds on the interweb.
An evolutionary algorithm mimics the Darwinian mechanisms of random mutation and natural selection. You start with some sort of hereditary material, in this case a virtual DNA specifying the vertices, colors and transparency of the polygons, and then start mutating this hereditary material by randomly changing around the values of any of these three attributes. After the mutation has occurred, the algorithm decides whether the mutation has been beneficial by checking if the new image looks more or less like the Mona Lisa. Technically, this is done by evaluating a ‘fitness function’ which is the sum of the differences in RGB values for all pixels between the original image and the replica. If the mutation decreases the value of the fitness function (a closer match with the original), the mutation is kept, if the value increases the mutation is selected against and discarded.
In the beginning, the results do not look at all very interesting or useful. But after a while, you’ll be amazed at how close you can get to the original image with this incredibly simple and, really, quite stupid algorithm. In fact, five the algorithm enough time and enough polygons to toy with and it will eventually produce an exact replica of the original image. This is exactly what Richard Dawkins means when he says that the theory of evolution answers the questions about the origins of the complexity in all living things with nothing but stunningly elegant simplicity. Intelligent Design my ass.