(April 10, 2010 at 7:30 am)Pippy Wrote: This school of Atheism (the I'm right, you're wrong school) is best captured in the Million monkeys paradox. You guys seem to beleive that a million monkeys on a million typewriters in a million years would eventually punch out a Sonnet. That randomness can create something of absurd complexity. I choose to disagree. But it gets tiring with the youngins rabbling around the room banging pot lids together pretending that I have a mental deficiency because I choose to disbelieve in the million monkey paradox. We hear you Tav, you think you're smarter/better than some of us, I get it. Move on.The million monkeys "paradox" is provable through mathematics. Given that in the paradox, the chance of a letter being pressed is equal to the chance of any other letter being pressed, the chances of *any* equal length string of characters being produced is also equal. In other words, the chances of getting the 5 letter word "Hello" is just as likely as getting the nonsense word "Fyxqt". Extending this, the chances of getting any 14 line sonnet is the same as getting any variation of 14 lines of nonsense.
If you have enough time, you'll eventually get a string that matches a sonnet. It's basic probability.
Coincidently, the infinite monkeys paradox gets the entire works of human literature an infinite amount of times in infinite variations with only one keystroke per monkey. In other words, if you set up the infinite amount of monkeys, and get them to all make one keystroke on the keyboard, the infinitely long string you get by concatenating all the characters will contain every possible combination of string.
What you forget though is that the million monkeys paradox is not an accurate representation of evolutionary theory. Randomness produces complexity eventually, but evolutionary theory has natural laws acting as a selector, choosing the more advantageous random mutations. In doing so, you get complexity quicker than you would with pure randomness.
To give another example, if we wanted to get the word "Hello" from randomness only, the chances are 1/11881376 (assuming we only use an alphabet of 26 characters). Every time the process produces a 5 character word that doesn't match "Hello", we try again from scratch.
However, if we implemented a selector that detected the appearance of individual character matches to the character in "Hello" (for instance, if we get "Hteyw" then we have matched the first character), we could "hold" that character and simply randomize the others, rather than all 5 again.
I coded a program in Java that compares the two methods:
Code:
import java.util.Random;
public class Monkeys
{
String target;
Random rand;
public static void main(String[] args)
{
Monkeys m = new Monkeys("HELLO");
m.runRandom();
m.runRandomWithSelection();
}
public Monkeys(String target)
{
this.target = target;
rand = new Random();
}
public void runRandom()
{
System.out.println("Running random string generation for target \"" + target + "\".");
String randomString = "";
int counter = 0;
while (!randomString.equals(target))
{
char[] newRandomString = new char[target.length()];
for (int i = 0; i < target.length(); i++)
{
newRandomString[i] = (char) (rand.nextDouble() * 26 + 'A');
}
randomString = String.valueOf(newRandomString);
counter++;
}
System.out.println("Target \"" + target + "\" found after " + counter + " attempts.");
}
public void runRandomWithSelection()
{
System.out.println("Running random string generation with selection for target \"" + target + "\".");
char[] targetArray = target.toCharArray();
char[] newRandomString = new char[targetArray.length];
String randomString = "";
int counter = 0;
while (!randomString.equals(target))
{
for (int i = 0; i < targetArray.length; i++)
{
if (targetArray[i] != newRandomString[i])
{
newRandomString[i] = (char) (rand.nextDouble() * 26 + 'A');
}
}
randomString = String.valueOf(newRandomString);
counter++;
}
System.out.println("Target \"" + target + "\" found after " + counter + " attempts.");
}
}The results speak for themselves:
Running random string generation for target "HELLO".
Target "HELLO" found after 9620798 attempts.
Running random string generation with selection for target "HELLO".
Target "HELLO" found after 43 attempts.
You can run the program with a different target as long as it is made of only the 26 uppercase letters. I ran it with the alphabet as a string ("ABCDEFGHIJKLMNOPQRSTUVWXYZ") and it found it in only 77 attempts. It's still running the pure random method





