TechnologyShakespearean plays written by "virtual monkeys" turn 10 years old

Shakespearean plays written by “virtual monkeys” turn 10 years old

A monkey with a typewriterImagno (Getty Images)

If a monkey pounded on the keys of a typewriter for an infinite amount of time, it could produce any text, for example, the complete works of Shakespeare. This is, in short, the central premise of what is known as the Infinite Monkey Theorem, which 10 years ago made Jesse Anderson, a programmer from Montana (USA) viral. “In one of my favorite scenes from The Simpsons, Mr. Burns is giving you a tour from his house to Homer and enters a room where there are a lot of monkeys with typewriters. That was the original idea, ”he recalls in a video call interview. “Besides, I was bored and I like to learn new technologies.”

Anderson, who at the time was learning to handle the Hadoop programming environment, specialized in handling large amounts of data, was keen to test the cloud computing services of Amazon Web Services, which had been launched five years earlier. So he set out to write a program capable of generating random text segments to complete the works of the British playwright. And he got it. And it went viral.

His deed was sung by media from all over the world. “A few million virtual monkeys are about to recreate the complete works of Shakespeare by pounding keys on virtual typewriters,” proclaimed the BBC on September 26, 2011. “Shakespeare’s plays, produced by millions of Amazonian monkeys,” announced Engadget three days before. In EL PAÍS we also echoed. “If memory serves me correctly, the first ones were Fox News and Gizmodo. That gave me the impetus to keep the process going until the end, ”Anderson recalls. “It was interesting to discover the project through the eyes of the journalists, to see what they noticed.”

Computer engineer Jesse Anderson
Computer engineer Jesse AndersonCeded

Within a month and a half, the show had completed the British playwright’s corpus based on random nine-character segments. Anderson did not intend for the works to be completed one by one or line by line. If the proposed lyrics were gibberish, they were automatically discarded. If they coincided with any segment of the works, digitized by the Gutenberg project, they were added to what had already been written. In this context, the text of the well-known passage from Macbeth, “to be or not to be” –to be or not to be, in English – would have been just as valid as tobeornot or as eornottob. The million monkeys and their typewriters were purely imaginary; an Anderson device to portray the random nature of the process. But they were, along with the mention of Shakespeare, a fundamental part of the success of the project.

“The key was to find something that appealed to the feelings of the audience. Something that many had heard about or that was curious. Nothing esoteric ”, reasons the programmer. What is not so clear is whether he could reproduce that success on the current internet: “There are many more things competing for your attention than you did ten years ago. Maybe it could happen, but I think we are more jaded now ”.

In 2011, some portals questioned the importance of the milestone from a technological point of view. For Anderson, the goal was not to advance science or invent a new method of literary creation. The challenge of generating Shakespeare’s works by comparing the originals with character segments would lose complexity, for example, if the proposals are, one by one, the letters of the alphabet. In fact, this is the model that you applied initially, to verify that the code was well structured. The process took 20 seconds. “The project would not have gone viral if it had lasted only three or six hours. I needed some margin. Something serious, “he explains. “What I did was try to invite people to follow the project, to see what had changed in the last 30 minutes and how their favorite Shakespearean work was progressing.”

With today’s technology, even nine-character segment generation would be completed in a breeze. But other ways of dealing with the problem have also emerged. “There is a genetic algorithm where you start with a block that adjusts to the point of creating something,” he says. For example, yes Romeo and Juliet they have 50,000,000 characters, one begins with a set of that length and random modifications are introduced until the result is, letter by letter, the tragedy of the Montagues and the Capulets. “Or we could go the artificial intelligence route and train an algorithm with texts from the time to see if it could recreate Macbeth. It would be interesting, although I don’t think it’s possible right now ”, he adds.

Anderson didn’t get rich off the million monkeys. After the first informative flashes, the attention that the project captured was diluted and it was time to return to normal life and the routines of his job at that time, in a financial company. “Then I found out that I was working in the wrong place. They did not value creativity there, ”he recalls. Discouraged by the indifference of his peers, the programmer decided to take advantage of the last blows of popularity of his Amazonian monkeys to look for a new job. He first went through Cloudera, a company specializing in cloud data management, and then founded his own company.

For those who are looking for an opportunity like the one he had, a viral that changes their luck, Anderson recommends looking for something interactive, that matters to people, that has some human element or that stimulates our curiosity by trying to answer questions for which we do not we have an answer. “But the most important thing, and this is something that people with technical profiles tend to forget, is that you are going to have to throw flowers,” he warns. The night he launched his project, Anderson spent hours emailing the media explaining the story of the million monkeys. When he woke up, his inbox was full.

You can follow EL PAÍS TECNOLOGÍA at Facebook and Twitter or sign up here to receive our weekly newsletter.