Thought is so powerful that we can use it to reveal aspects of reality that cannot be reached any other way.
New scientist has inspired me to write another post based on a recent article they published about thought experiments. The article is relatively short in length, so I’d like to expand on a few thought experiments that revolutionized the way we think about the world. (I’ll talk about one today, and a few more over the next few weeks.) However, I won’t be talking about Galileo’s Leaning Tower of Pisa (acceleration under gravity is constant) or anything as famous as this because a quick Google search can yield tons of related articles. I will be writing about the more obscure thought experiments that have led to amazing discoveries, but you perhaps might not recognize at first glance.
In particular, hopefully this article will inspire you to conduct some thought experiments yourself as they are incredibly liberating in the sense that irrelevant physical constraints can be abstracted away without adding any additional physical machinery. (We can’t actually do that experiment because we don’t have a rocket that can travel at the speed of light. –Oh wait, who says we can’t…in our minds.)
Suppose you have a roomful of monkeys and typewriters. You let the monkeys type at the typewriters for an infinite amount of time. Conclusion: eventually one monkey will produce the complete works of Shakespeare. (Boring! I’ve heard this before!) Alright, let’s make this a bit more interesting. We don’t have a room full of monkeys. We have only one monkey, Bob. Instead of typing out the complete works of Shakespeare, let’s say Bob only needs to type one phrase, “METHINKS IT IS A WEASEL.” Furthermore, Bob gets a special keyboard that only has all 26 letters in caps and a space bar. How long does it take Bob to type out the phrase?
Before you start asking me to clarify the question with details like how fast can Bob type and if spaces matter, let’s stop and think for a moment and abstract away all these physical details. Since Bob is a monkey, he will choose one of the letters or the spacebar with roughly equal probability. The specific phrase we want him to type contains 23 characters. Bob will produce this phrase out of all possible 23 character phrases with probability . Let’s say Bob can produce one phrase per second (unrealistic, but, hey, we’re not in the real world here). The expected number of seconds it would take Bob to produce the phrase is
. This is not infinity, but it’s still a very large number. In fact even if Bob started typing right at the beginning of the universe, he still wouldn’t have typed the phrase “METHINKS IT IS A WEASEL” by today (nope, still got a couple of trillions of year to go).
So what did we learn from this thought experiment?
As you can see, simply selecting random letters each time Bob types a different phrase is not the most effective way to obtain the desired phrase in the shortest time possible. Richard Dawkins was the first to formulate this thought experiment and subsequently apply it to genetics and evolution.
What this thought experiment says about “random mutations” in evolutionary algorithms is that these mutations are not necessarily randomly picked with each iteration of the algorithm. Mutations that are closer to the desired result are kept and used in the next cycle. In the case of the thought experiment above, the closer a 28 letter phrase gets to “METHINKS IT IS A WEASEL,” the less likely that the phrase would undergo further mutations.
The formal algorithm given by Dawkins is the following:
- Start with a random string of 28 characters.
- Make 100 copies of this string with a small probability that a character in the string is replaced by a random character.
- Compare each new string with “METHINKS IT IS A WEASEL” and assign the string a score based on how closely it matches the given string.
- If the highest scoring string matches “METHINKS IT IS A WEASEL”, halt the program.
- Otherwise, use the highest scoring string as the base and go back to step 2.
Go here to see a illustration of this algorithm in action. This concept is later on used in a highly popular subset of artificial intelligence algorithms known as genetic algorithms. And to think all this came from a monkey named Bob.