Friday, January 24, 2025

The Finite Monkey Theorem: Could 'X' Monkeys Randomly Type A Work Of Shakespeare Given Enough Time?

 

                              Could even a million monkeys type out a Shakespear play in 10 b years?

                                       Carlo, the math -accountant monkey in Barbados. 



Monkeys can be quite talented - as well as entertaining. For example, in math talent there is the monkey 'Carlo' in Barbados (on the east coast) who can work an abacus - and will do small sums before your very eyes. Even add up receipts from his mistress's sales.

But could a monkey, or rather billions of them, manage to randomly type out a work of Shakespeare - say  even in the age of the universe?  The question was first treated in a 1913 paper by French mathematician, a Emile Borel - a pioneer of modern probability theory.  However, soon different scientific areas - from cosmology to statistical mechanics adopted one of other form of the analogy to try to demonstrate some concept.

Perhaps the best known example was treated by Sir James Jeans, in his book, The Mysterious Universe, e.g.


Therein (p. 3) the question of whether the universe (and humans within it) "stumbled forth by accident" or resulted from a grander, purposeful design, was treated.   In Jeans' words:   "It was Huxley, I think, who said six monkeys set to strum unintelligently on typewriters for millions and millions of years, would be bound in time to write all the books in the British Museum.

If we examined the last page which a particular monkey had typed -  and found in its blind, random strumming it had typed a Shakespeare Sonnet - we should rightly regard the occurrence as a remarkable accident.  But if we looked at all the millions of pages the monkeys had turned out in millions of years we might be sure of finding a Shakespeare Sonnet  among them the product of the blind play of chance."

But is this premise even reasonable or rational?  Well, in 2003, British scientists actually put a computer into a monkey cage at the Paignton Zoo.  The outcome? Five pages of text primarily filled with the latter 'S'. (According to Guardian news reports).

Meanwhile, a new paper by researchers at the University of Technology-Sydney suggests all such efforts may have been for naught. It concluded there is simply not enough time before the cosmos expires for a defined number of hypothetical primates (even chimps - the closest to humans) to produce a faithful. reproduction of 'Curious George' far less King Lear.

Yeah, according to some eggheads we still have Googol years left - 10 to the 100th power - until the lights go out in the cosmos.  But according to the Aussie team, the typing monkeys will have made no more progress than their counterparts at the Paignton Zoo in 2003.  According to the lead author of the Aussie paper, Stephen Woodcock:  "It's not happening. The odds of a monkey even tying pout the first word of Hamlet's 'To Be Or Not To Be' on a 30-keyboard typewrite is 1 in 900.  But every new letter offers 29 fresh opportunities for error. Thus, the chances of a monkey even spelling out banana is approximately 1 in 22 billion."

Even if the life span of the universe were extended billions of times, the monkeys would still not accomplish the task, the Sydney researchers concluded. Their paper calls the infinite monkey theorem "misleading" in its fundamental assumptions. 

Long before that University of Technology-Sydney paper, the physicist authors of the monograph Thermal Physics (1980) had arrived at the same conclusion ('The Meaning of Never, p. 53).  They write:

"It has been said that 'six monkeys set to strum unintelligently on typewriters for millions and millions of years, would be bound in time to write all the books in the British Museum.  This statement is nonsense for it gives a misleading conclusion about very, very large numbers.

Suppose that 1010  monkeys have been seated at typewriters throughout the age of the universe, 1015 s .  We suppose that a monkey can hit 10 typewriter keys per second. A typewriter may have 44 keys and we accept lowercase letters in place of capital letters.  Assuming that Shakespeare's Hamlet has  105 characters, will the monkeys hit upon Shakespeare's Hamlet?   

It turns out that the probability that any given sequence of   105 characters typed at random, will match the correct sequence of Hamlet is of the order:

(1/44)100,000   =   10 -164345 


Where we have used:   log 10  44  = 1.64345

Thus, the probability a monkey Hamlet will be typed in the age of the universe is approximately  10 -164345  .

Hence, the probability of a monkey Hamlet is zero in any operational sense, so the original statement of the problem (by Huxley) is nonsense.   One book, much less a library, will never occur in the total literary production of the monkeys."

But hold strain. Some math purists may object that the above authors have failed to factor in infinity. The purists could even object to the title of the Aussie team's paper: 'A Numerical Evaluation of the Finite Monkeys Theorem'.  Aren't there supposed to be an infinite number of monkeys working? Isn't it really the "infinite monkey theorem"? 

Actually, no. Neither Huxley nor Sir James Jeans postulated infinite monkeys, but a finite six.  The Aussie team and the thermal physics authors both allowed for 1010  monkeys- mainly to press the point that even very large numbers of monkeys don't matter. You are still going to get gibberish, because monkeys aren't humans or human writers.  As Stephen Woodcock put it in one interview:

"The study we did was wholly a finite calculation on a finite problem. The main point was just how constrained the universe's resources are. Mathematicians can enjoy the luxury of infinity as a concept but if we are to draw meaning from infinite limit results we need to know if they have any relevance to our finite universe."

Evidently not, as the thermal physics text authors even noted the probability of a monkey Hamlet as zero in an operational sense.   Implying clearly the mathematical use of infinity or infinite monkeys or infinite typewriters is regarded as an "inoperational sense".  I.e. divorced from reality.


Be that as it may, I can say, having witnessed it firsthand in Bim, that Carlo the monkey can do a finite sum (e.g. 2 + 2 = 4)  on an abacus!




No comments: