Skip to main content
0 online

a Million monkey with a million typewr..

deanh77 by deanh77 · Jan 15, 2002 · 104 views · Journal

A million monkeys at a million typewriters blah blah blah.



Ok so I’m currently unemployed, and I busted my leg so I can’t snwoboard for the moment. I am very very bored.



Have you ever heard that saying: A million monkeys at a million typewriters for a million years would come up with the works of Shakespeare?



Well I had nothing to do so I thought I’d test this hypothesis using elementary discreet mathematics.



Ok, lets take Hamlet for starters. I found a copy of it here jollyroger.com/library1/HamletbyShakespeareebook.html

According to Microsoft word it has 31,901 words, 167,173 characters with spaces, and 6,771 lines.



If you consider that a line is a carriage return, then we can calculate the total number of key presses as 173,944. Also note that the average word has 4.4 letters in it (since # of characters without spaces is 140,330)



Let’s imagine a simplified keyboard. It contains the 26 letters of the alphabet along with the characters [space], [carriage return (enter)], [,], [.], [:], [;], [“], [‘], [!], [?], [(], [)] – 38 characters.



In mathematical terms the Shakespearean play Hamlet is merely one permutation of a string of length of 173,944 whose characters are taken from an alphabet of 38 characters.



The total number of permutations that fit this criteria is 38 to the 173944 power. (that’s a really big number, my scientific calc failed at that)



Ok, so how fast can you type? Like 40 words per minute is pretty good right? You think a monkey could type that fast? Maybe, considering its just gibberish to him, but he’s probably hunting and pecking (the keyboard guys, stick with me) so its probably slower, but who cares. You’re probably not even reading this right now. So how much time do we have guys? 525,960,000,000 minutes per monkey giving us 525,960,000,000,000,000 monkey-minutes (that’s a scientific unit, BTW) How many words can be written in that time? 21,038,400,000,000,000,000 more than 21 quintillion words. Wow.



If the average word is around 5 letters long, than our monkeys could type about 100 quintilllion characters. Surely this is enough time?



Well remember that we need 38^173944 sets of piles of paper produced by the monkeys that are each composed of 173944 characters in order to actually have a copy of the play Hamlet in one of them. It would give us a 100% chance of having Hamlet. If we only had half that number than we’d have a 50/50 chance which is pretty good, but not perfect.



How long would it take to slam out 38^173944 texts? They will each cost us about 800 minutes from our speedy monkey typers. (31901 words/40 words per minute)



We need 800*38^173944 monkey-minutes to type up all of them, and we have

526 quadrillion monkey-minutes. Well it turns out that that big number is more than 10^250000 while the time we have is only 5*10^17.



We’d need a heck of a lot more monkeys and whole lot more time.





OK so can anyone think of a concept (not necessarily mathematical) that I didn’t bring up that could somehow shorten the time needed?



(Updated 1/16/2002)

Hey guys just wanted to let you in on something else. that big number is really big. It would probably take those monkeys longer than the lifetime of the universe according to physicists. In fact it would take several thousand universe-lifetimes for them to do this. So our monkeys have to be immortal pan-dimensional travellers. but then, you'd think they'd be better typers or at least have read Hamlet or something and be able to get it done in no-time. So then they wouldn't have to be immortal pan-dimensional travellers. etc. etc.

anyway this all is moot when you take into consideration the new system and everlasting life. I for one desire to have a monkey farm and prove this whole mess for a huge chunk of my life. Now all I need to do is find an understanding wife to help me out....

To contribute to the discussion, please log in.

17 Comments

iwz #1 iwz

hahaha, you're a nut dean.

tpham #2 tphamOG 2001

but what if all those minutes were wasted on nothing but gibberish.. what if no real words were ever formed.

deanh77 #2.1 deanh77Founder

you completely missid the point Ty. after 800*38^173944 monkey-minutes, there WILL BE a copy of Hamlet among a very,very large amount of gibberish.

tpham #2.1.1 tphamOG 2001

yea but did that formula calculate all possibility that nothing comes out of BUT gibberish..

deanh77 #2.1.1.1 deanh77Founder

ok you kind of have a point, first of all I'm not sure what you mean by gibberish, if you mean, no english words, or no strings of english words that are sentences, etc.

However getting hamlet is even harder than I proposed

Here is why:



if we only had to produce one letter, say "a", instead of all of hamlet, it would not take 26 random hits as I purport my little story. This is because its possible to repeat letters and completely miss the letter "a". The probability that we get it on the first try is 1/26. If we were trying to generate the word "and" then the probability we get that with the first 3 keypresses is (1/26)*(1/26)*(1/26) = 1/(26^3). The more attempts we make the higher the probability that we get the word "and" but it is never guaranteed.


this follows standard equations from probability that I can't remember off-hand.



basically all this means is that it would take a lot longer than previously thought (now maybe hundreds of thousands or millions of universe-lifetimes) for the probability of having Hamlet in our hands was above 75%. And we will never definitely have it. but then again, we could get lucky and get it on the first try, or in the first say, hundred thousand years. but that probability is probably much smaller than 1%.

tpham tphamOG 2001

exactly.. see.. the algorithim before as i read it stated... numbers and stated chances as if it WAS a definite.. but then there's probablity... of missing keys.. etc...

deanh77 deanh77Founder

mmm. not quite. given enough amount of time (which may as well be infinity for our minds, but it is actually finite) they most probably would come up with a copy of Hamlet, because the probability would get soooo close to 1 (but never quite reach it).

thefunkyfresh thefunkyfreshFounder

WRONG! WRONG! WRONG! WRONG!

I just wanted to refute somebody.

punkprincess punkprincessOG 2001

and you choose DEAN to refute?! dont you know that will lead to embarassment?!

thefunkyfresh #3 thefunkyfreshFounder

well, i guess if you break it down into "all of the words in shakespeare, and not "all of shakespeare." meaning that just the words that appear in the works of shakespeare would be typed, but you would not end up with a typed version of hamlet, merchant of venice, midsummer nights dream, romeo and juliet, robin hood, superman, and teletubbies. if all of the monkeys were just pushing random keys constantly, and not just slamming away on the keyboard, i suppose that one million monkeys on one million typewriters for a million years would produce all of the words that occur in shakespearian literature.

deanh77 #3.1 deanh77Founder

no, thats not quite the hook I was looking for, for the shortcut.

thefunkyfresh #3.1.1 thefunkyfreshFounder

maybe so, but my theory is correct. you can't refute that. so zip it!! zippishica! zip it. what! what!? ... i thought so.

magnum #4 magnumOG 2001

wow i just read all that and realized you have way to much time on your hands. Take up sewing instead so u can make a quilt for your bum leg.

bennybergs13 #5 bennybergs13OG 2001

I stopped reading when i saw all the weird symbols

rocksupastar #5.1 rocksupastarFounder

yea... you kinda lost me at that too.... i dont get the point or well... yea... i guess the point of WHY you wasted all that time... does it make the world a better place knowing that if a buncha smart monkies pounded on a buncha keyboards for a long time, that it would somehow make a version of hamlet? Thats kinda like saying that somehow some atoms in the universe somehow managed to hit and produce some big bang, and through that explosion earth and life itself was created through some wild and unpredictable and yet stable chain of events. Tell me, if i bang on my car long enough will it look like a ferrari?

deanh77 #5.1.1 deanh77Founder

AAHAHAHAH



The point is it CAN'T happen!!!!! geese!

g.f.s.rocks #5.1.1.1 g.f.s.rocksOG 2001

Why not?? I dont get it....

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Curator Commentary

Look for the blue speech bubbles on threads, profiles, and news — notes and context from iwz.

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.