Archive

Archive for April, 2008

On Evolution: Biological and Computational

April 4th, 2008

The genetic algorithm is one method of solving problems in computer science. Although it comes in many flavors, for the purposes of this article I’ll focus on a simple example.

Imagine you have a multiple choice test with 20 questions. Each question can be answered by choosing one of four choices. A compete answer to the test consists of a string of 20 characters, each of which is chosen from the set {A, B, C, D}. The solution to the test is an answer string where every answer is correct.

A valid, but not necessarily correct, answer string would look like this:

ABDCBDABDBCABDCCBABD

How many possible answer strings are there? Well, each position in the string can take on 4 different values, and there are 20 of them, so there are 4^20 = 1,099,511,627,776 possible ways to answer the test. That’s “just” over 1 trillion (over by 99 billion, that is). To give you a sense of perspective, that’s about as many seconds as there are in 35,000 years. Yeah, that’s a lot.

Read more…

Computer Science, Evolution