Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Infinite monkey theorem
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Infinite strings==== This can be stated more generally and compactly in terms of [[string (computer science)|strings]], which are sequences of characters chosen from some finite [[alphabet]]: * Given an infinite string where each character is chosen independently and [[Uniform distribution (discrete)|uniformly at random]], any given finite string almost surely occurs as a [[substring]] at some position. * Given an infinite sequence of infinite strings, where each character of each string is chosen independently and uniformly at random, any given finite string almost surely occurs as a prefix of one of these strings. Both follow easily from the second [[Borel–Cantelli lemma]]. For the second theorem, let ''E''<sub>''k''</sub> be the [[event (probability theory)|event]] that the ''k''th string begins with the given text. Because this has some fixed nonzero probability ''p'' of occurring, the ''E''<sub>''k''</sub> are independent, and the below sum diverges, :<math>\sum_{k=1}^\infty P(E_k) = \sum_{k=1}^\infty p = \infty,</math> the probability that infinitely many of the ''E''<sub>''k''</sub> occur is 1. The first theorem is shown similarly; one can divide the random string into nonoverlapping blocks matching the size of the desired text and make ''E''<sub>''k''</sub> the event where the ''k''th block equals the desired string.{{efn|The first theorem is proven by a similar if more indirect route in Gut (2005).<ref>{{cite book |last=Gut |first=Allan |title=Probability: A Graduate Course |year=2005 |publisher=Springer |isbn=0-387-22833-0 |pages=97–100}}</ref>}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)