understanding probability theory... Infinite monkey theorem

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

videogames101

Diamond Member
Aug 24, 2005
6,777
19
81
Well, I see a problem, money's hands are WAY to big to hit 1 key, making this whole theory impossible anyways...
 

theMan

Diamond Member
Mar 17, 2005
4,386
0
0
Originally posted by: CSMR
You have an upper bound with your formula, which is what you need. The probability of a monkey typing a particular countably infinite sequence eventually is zero. William Shakespeare's works are of finite length, not infinite.

true, the whole thing is too unspecific.
 

JudgeDracoAmunR

Junior Member
Feb 2, 2013
1
0
0
Generative Rendering Theorem​

Those familiar with computers will know that files stored on disk have a size specified in terms such as kilobytes or megabytes. Well, what is a byte? A byte is a unit of storage analogous to a litre. A jug that can store a litre can store any volume of liquid up to and including a litre, any volume between 1-1000 millilitres, or even nothing at all. It is the same with a byte. A byte can store any number in the range 1-255, or it can store nothing at all (the number “0”).

An author editing a text document sees nothing but text displayed on screen, yet all of the letters and other characters on display are actually stored as numbers in the “txt” file being edited. Each character has its corresponding number. Although there are several “numbering” standards used for storing text, one of the most common is ASCII (American Standard Code for Information Interchange). In ASCII, the letter “C” is stored in the “txt” file as the number 67, while the word “CAT” is stored in the “txt” file as the number sequence 67, 65, 84.

While a “txt” file containing only a “C” can most certainly be brought into existence by an author using a word processor, there is another process by which a “txt” file containing only a “C” can be brought into existence. This process – called Generative Rendering – exploits the fact that given one byte can store only the numbers 0 and 1-255 (or 0-255, as we programmers say) a program can be written that does nothing more than write out to disk all possible 1-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-255. Among these “txt” files will be a file containing the number 67. When that “txt” file is loaded into a word processor, what is displayed on screen is “C”. This program – a Generative Text Renderer – is presented here in a “language” the layperson can understand:

10 for x = 0 to 255
20 write x to a “txt” file
30 next x

Bytes can be combined in such a way that working together two bytes can be used to store numbers in the range 0-65535. This is like having two jugs, each of which can store only 1 litre but which – when working together – can store up to 2 litres. The Generative Text Renderer can be modified to write out all possible 2-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-65535. Among these “txt” files will be a file containing the two numbers 67 and 65. When that “txt” file is loaded into a word processor, what is displayed on screen is “CA”.

Similarly, three bytes working together can be used to store numbers in the range 0-16777215. The Generative Text Renderer can be modified to write out all possible 3-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-16777216. Among these “txt” files will be a file containing the three numbers 67, 65 and 84. When that “txt” file is loaded into a word processor, what is displayed on screen is “CAT”.

Ninety-one bytes working together can be used to store numbers in the range 0-SomeHugeNumber. The Generative Text Renderer can be modified to write out all possible 91-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-SomeHugeNumber. Among these “txt” files will be a file containing the ninety-one numbers

083 105 110 099 101 032 116 104 101 121 032 097 114 101 032 110 111 032 108 111 110 103 101 114 032 116 119 111 032 098 117 116 032 111 110 101 044 032 108 101 116 032 110 111 032 111 110 101 032 115 112 108 105 116 032 097 112 097 114 116 032 119 104 097 116 032 071 111 100 032 104 097 115 032 106 111 105 110 101 100 032 116 111 103 101 116 104 101 114 046

When that “txt” file is loaded into a word processor, what is displayed on screen is: Since they are no longer two but one, let no one split apart what God has joined together. That’s Matthew 19:6 by the way (NLT).

Generative Rendering Theorem outdoes Infinite Monkey Theorem. While Infinite Monkey Theorem cannot guarantee that even a tome as short as the complete Works of William Shakespeare can be recreated by random chance even when time is not a limiting factor, Generative Rendering Theorem absolutely does guarantee that each and every Work stored in the British Library can be recreated in very little time by supercomputers doing nothing more than counting sequentially from zero to infinity and beyond!
 

Slammy1

Platinum Member
Apr 8, 2003
2,112
0
76
All events are low probability when viewed from the perspective of the beginning. The probability that you or I exist let alone be having this particular conversation probably makes the monkey typing thing seem likely, yet here we are.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
14
81
Generative Rendering Theorem outdoes Infinite Monkey Theorem. While Infinite Monkey Theorem cannot guarantee that even a tome as short as the complete Works of William Shakespeare can be recreated by random chance even when time is not a limiting factor, Generative Rendering Theorem absolutely does guarantee that each and every Work stored in the British Library can be recreated, given timescales way beyond the lifespan of the universe, even if every electron had the computing power of the most powerful super computer imaginable, by doing nothing more than counting sequentially from zero to infinity and beyond!

FTFY
 

koshling

Member
Nov 15, 2005
43
0
0
Of course, you don't actually NEED the monkey (or the typewriter) at all.

There is a non-0 probability that the atoms in some finite volume, with total mass sufficient to form the physical rendition of the complete works, will spontaneously re-arrange themselves into that particular arrangement of matter. Now the amplitude of that particular wave-function (which is where the probability of the arrangement derives from quantum mechanically) will be vanishingly small, such that it simply won't happen (almost certainly) within the lifetime of the universe. However, in principal it could.

In fact you don't even need enough atoms!! Depending on how long you want said complete works to last, it could pop out of the vacuum for a short period of time. Next to an event horizon it might even not annihilate immediately (Hawking radiation in the form of a copy of Shakespear), though it's chances of survival in such proximity seem minimal at best ;-)
 

Harvey

Administrator<br>Elite Member
Oct 9, 1999
35,052
30
86
Well, as long as we're dragging up a seven year old necro thread...

If an infinite number of rednecks riding in an infinite number of pickup trucks fire an infinite number of shotgun rounds at an infinite number of highway signs, they will eventually produce all the world's great literary works in Braille. :p
 

m1ldslide1

Platinum Member
Feb 20, 2006
2,321
0
0
EXACTLY. It is also true, that if you flipped a coin an infinite number of times, and assumed that tails = 0, and heads = 1, eventually a string of binary code will be produced that, if fed into my digital LCD screen, would produce video images of every time that I had "mistreated" myself, EVER, IN MY WHOLE LIFE, and the wierdest thing, is that it would be JUST A COINCIDENCE.

That's a fact.

Seriously considering making this my new sig.
 

Mushkins

Golden Member
Feb 11, 2013
1,631
0
0
Generative Rendering Theorem​

Those familiar with computers will know that files stored on disk have a size specified in terms such as kilobytes or megabytes. Well, what is a byte? A byte is a unit of storage analogous to a litre. A jug that can store a litre can store any volume of liquid up to and including a litre, any volume between 1-1000 millilitres, or even nothing at all. It is the same with a byte. A byte can store any number in the range 1-255, or it can store nothing at all (the number “0”).

An author editing a text document sees nothing but text displayed on screen, yet all of the letters and other characters on display are actually stored as numbers in the “txt” file being edited. Each character has its corresponding number. Although there are several “numbering” standards used for storing text, one of the most common is ASCII (American Standard Code for Information Interchange). In ASCII, the letter “C” is stored in the “txt” file as the number 67, while the word “CAT” is stored in the “txt” file as the number sequence 67, 65, 84.

While a “txt” file containing only a “C” can most certainly be brought into existence by an author using a word processor, there is another process by which a “txt” file containing only a “C” can be brought into existence. This process – called Generative Rendering – exploits the fact that given one byte can store only the numbers 0 and 1-255 (or 0-255, as we programmers say) a program can be written that does nothing more than write out to disk all possible 1-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-255. Among these “txt” files will be a file containing the number 67. When that “txt” file is loaded into a word processor, what is displayed on screen is “C”. This program – a Generative Text Renderer – is presented here in a “language” the layperson can understand:

10 for x = 0 to 255
20 write x to a “txt” file
30 next x

Bytes can be combined in such a way that working together two bytes can be used to store numbers in the range 0-65535. This is like having two jugs, each of which can store only 1 litre but which – when working together – can store up to 2 litres. The Generative Text Renderer can be modified to write out all possible 2-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-65535. Among these “txt” files will be a file containing the two numbers 67 and 65. When that “txt” file is loaded into a word processor, what is displayed on screen is “CA”.

Similarly, three bytes working together can be used to store numbers in the range 0-16777215. The Generative Text Renderer can be modified to write out all possible 3-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-16777216. Among these “txt” files will be a file containing the three numbers 67, 65 and 84. When that “txt” file is loaded into a word processor, what is displayed on screen is “CAT”.

Ninety-one bytes working together can be used to store numbers in the range 0-SomeHugeNumber. The Generative Text Renderer can be modified to write out all possible 91-byte “txt” files. Each of these “txt” files will contain a different number in the range 0-SomeHugeNumber. Among these “txt” files will be a file containing the ninety-one numbers

083 105 110 099 101 032 116 104 101 121 032 097 114 101 032 110 111 032 108 111 110 103 101 114 032 116 119 111 032 098 117 116 032 111 110 101 044 032 108 101 116 032 110 111 032 111 110 101 032 115 112 108 105 116 032 097 112 097 114 116 032 119 104 097 116 032 071 111 100 032 104 097 115 032 106 111 105 110 101 100 032 116 111 103 101 116 104 101 114 046

When that “txt” file is loaded into a word processor, what is displayed on screen is: Since they are no longer two but one, let no one split apart what God has joined together. That’s Matthew 19:6 by the way (NLT).

Generative Rendering Theorem outdoes Infinite Monkey Theorem. While Infinite Monkey Theorem cannot guarantee that even a tome as short as the complete Works of William Shakespeare can be recreated by random chance even when time is not a limiting factor, Generative Rendering Theorem absolutely does guarantee that each and every Work stored in the British Library can be recreated in very little time by supercomputers doing nothing more than counting sequentially from zero to infinity and beyond!

That has nothing to do with probability, that's just simple iteration.
 

DSF

Diamond Member
Oct 6, 2007
4,902
0
71
Considering that he just joined the forums and this is his only post, something tells me he bounces around the interwebs searching for discussions on the Infinite Monkey Theorem and pastes his stock post in.
 

JTsyo

Lifer
Nov 18, 2007
11,723
879
126
Can't we test this, just for fun?
IIRC, Java has a random number generator. If a programmer could develop a random letter generator I'm sure someone would be willing to run it on their computer.

Perhaps a contest in Distributed Computing on who gets Macbeth first?

hmm if you wrote an algorithm that would produce all possible text up to 1 million characters long. Would you then be able to capture all future books that were likely to be written? That would also mean that there were only a finite amount of ideas to be written about.
 
Last edited:

koshling

Member
Nov 15, 2005
43
0
0
hmm if you wrote an algorithm that would produce all possible text up to 1 million characters long. Would you then be able to capture all future books that were likely to be written? That would also mean that there were only a finite amount of ideas to be written about.

...and how would you filter out the 'useful' outputs from the dross?
 

Ben90

Platinum Member
Jun 14, 2009
2,866
3
0
The bound for the length of a story approaches infinity. Example:

JTsyo pooped his pants. But he woke up and realized it was just a dream. Then he woke up again and realized he was dreaming about a dream. Then he woke up again and realized he was dreaming about dreaming about a dream. Then he woke up again and realized he was dreaming about dreaming about dreaming about a dream...
 

TuxDave

Lifer
Oct 8, 2002
10,572
3
71
...Generative Rendering Theorem absolutely does guarantee that each and every Work stored in the British Library can be recreated in very little time by supercomputers doing nothing more than counting sequentially from zero to infinity and beyond!

Oh is that all? Just pick up a supercomputer that can count off to infinity in very little time? So simple...


... :p
 

ksheets

Senior member
Aug 11, 2000
738
71
91
hmm if you wrote an algorithm that would produce all possible text up to 1 million characters long. Would you then be able to capture all future books that were likely to be written? That would also mean that there were only a finite amount of ideas to be written about.


Been to a Movie Theatre lately?
 

nOOky

Platinum Member
Aug 17, 2004
2,842
1,862
136
Reading this made me dizzy, so I did the following. Since Chuck Norris has reportedly counted to infinity, twice, I decided to calculate in my head exactly where PI starts repeating. I can tell you that it starts with a 1, and ends with a 7. I'd type the characters down, but I'm no monkey at the keyboard with infinity on his side.

PM me if you really want the result.
 

drinkmorejava

Diamond Member
Jun 24, 2004
3,567
7
81
This reminds me of a problem I had at work today. The life of a part was predicted to be something like 10^31 hours...which is only a few orders of magnitude greater than the age of the universe.
 

Fayd

Diamond Member
Jun 28, 2001
7,971
2
76
www.manwhoring.com
Well, if you have a monkey on a keyboard for an infinite amount of time, eventually it will hit the keys in a sequence that recreates (insert famous work here). In the timeframe of infinity, any event that even has the slightest probability of happening will - if it never happened, then there would be no way to attach a probability to it.

more to the point, because it's infinity, it's "insert EVERY work ever produced", recreated infinite times with certainty.
 

TuxDave

Lifer
Oct 8, 2002
10,572
3
71
Well, if you have a monkey on a keyboard for an infinite amount of time, eventually it will hit the keys in a sequence that recreates (insert famous work here). In the timeframe of infinity, any event that even has the slightest probability of happening will - if it never happened, then there would be no way to attach a probability to it.

Here's a fun fact that I just remembered. If a drunk person leaves his home and, with equal probability, will go a step in either North/South/East/West. Barring death or other causes of death, given infinite time.... he will get back home.

However, if he was in space and could also go up and down, he's not guaranteed to get back home after infinite time.
 

Fayd

Diamond Member
Jun 28, 2001
7,971
2
76
www.manwhoring.com
Here's a fun fact that I just remembered. If a drunk person leaves his home and, with equal probability, will go a step in either North/South/East/West. Barring death or other causes of death, given infinite time.... he will get back home.

However, if he was in space and could also go up and down, he's not guaranteed to get back home after infinite time.

why not? now it's just a 3-dimensional random walk. that still visits all the probability space infinite times, when taken to infinity.
 

IDNeon

Junior Member
Feb 16, 2013
2
0
0
The probability that theonkey will hit the right combination of keys is a permutation of the required character posible and the number of times the choice of character is made.

Since the probability approaches infinity and 1/infinity approaches 0 one can say the entire point is academic and the actual probability is zero.

This is also true for genetic drift and is one of my several throttle to disprove evolution :)
 

jimhsu

Senior member
Mar 22, 2009
705
0
76
Probability as summarized by Nassim Taleb (paraphrased):

You ask a question to a statistician and an everyday guy on the street: "If I flip a fair coin 20 times and it lands heads, what is the probability of getting a head on the next flip?"

Statistician: 0.5 obviously, since it's a fair coin.
Guy: You call that "fair"? It's almost definitely going to be a head.

----

In academics, the only acceptable answer obviously is the statistician's. In the real world ... well you're not so sure.

On topic, the probability that your keyboard is ruined by monkey urine is almost certainly higher than the probability that your monkey composes the first word in a Shakespeare play. (independent demonstrated experiment, n=6). The distribution of letters produced was also highly non-random.
 
Last edited:

sao123

Lifer
May 27, 2002
12,648
201
106
7 years later, all my monkeys are on strike due to insufficient banana's and poo flinging breaks
 

TuxDave

Lifer
Oct 8, 2002
10,572
3
71
why not? now it's just a 3-dimensional random walk. that still visits all the probability space infinite times, when taken to infinity.

Yeah that's what I would've initially guessed but its not true. You do not have a 100% probability of randomly walking back to the origin over infinite time give that you are traveling in 3 or more dimensions. So you will not hit the origin an infinite number of times. You may in fact never get back!

http://mathworld.wolfram.com/PolyasRandomWalkConstants.html

To convince yourself you could write a program that terminates when you return to the origin and two out of three runs your program will run forever.
 
Last edited: