Thursday, January 20, 2022

Infinite Monkey Machine 1-20-22

The Infinite Monkey Theorem states that "A monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type any given text, such as the complete works of William Shakespeare. In fact, the monkey would almost surely type every possible finite text an infinite number of times." (Wikipedia)

This was tested in 2002 and it was discovered that this theory is in fact false. "Monkeys are not random generators. They're more complex than that. They were quite interested in the screen, and they saw that when they typed a letter, something happened. There was a level of intention there." (Wired)

Even mathematically speaking, if there were as many monkeys as there are atoms in the universe, there is still miniscule chance of actually typing a coherent document. I'm not going to reiterate what is said on the Wikipedia page because they've already explained it so well. I'll just leave you with this quote:

"For a one in a trillion chance of success, there would need to be 10,360,641 observable universes made of protonic monkeys."

That being said, with the advent of the computer we don't have to worry about the animal rights violations associated with forcing countless trillions of monkeys to do our bidding. I've written a small python program that will randomly generate words based on the frequencies of a character occurring in the complete works of Shakespeare, (see chart below).


I'm working on a small website that displays the results, I will link the website in the future.

You can view the code yourself here 

No comments:

Post a Comment

About Me

Hi! my name is Shane Howell. I'm a mechanical engineering / music double-major student studying at Western Michigan University in the US...