查看“︁無限猴子定理”︁的源代码
←
無限猴子定理
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{NoteTA |G1=Math |G2=IT }} [[File:Monkey-typing.jpg|thumb|230px|right|一只[[黑猩猩]]隨機地打字,只要时间足够,幾乎必然可以打出[[法國國家圖書館]]中的每本書。]] '''無限猴子定理'''({{lang-en|Infinite monkey theorem}})的表述如下:让一只猴子在[[打字机]]上[[随机]]地按键,当按键时间达到[[无穷]]时,[[几乎必然]]能够打出任何给定的文字,比如[[莎士比亚]]的全套著作。 在这里,[[几乎必然]]是一个有特定含义的数学术语,“猴子”也不是一只真正意义上的猴子,它被用来比喻成一个可以产生无限随机字母序列的抽象设备。这个理论说明把一个很大但有限的数看成无限的推论是错误的。猴子精确地通过键盘敲打出一部完整的作品比如说莎士比亚的哈姆雷特,在宇宙的生命周期中发生的概率也是极其低的,但並不是零。 这个理论的变化形式包括多个甚至无限多个打字员,以及目标文本从一个完整的图书馆到一个简单的句子。这些表述可以追述到[[亚里士多德]]的《[[论产生和毁灭]]》和[[西塞罗]]的《论神之本性》,经过[[布莱兹·帕斯卡]]和[[乔纳森·斯威夫特]],最后到现在的形象的打字员的表述形式。在20世纪早期,[[埃米尔·博雷尔]]和[[亚瑟·爱丁顿]]运用这个理论在统计力学基础中阐述隐式时间标尺。 == 起源 == '''無限猴子定理'''是來自[[埃米尔·博雷尔]]一本1913年出版談[[概率]]的書籍<ref name=":0">{{cite journal | author=Émile Borel | title=Mécanique Statistique et Irréversibilité | journal=J. Phys. (Paris) |series=Series 5 | volume=3 | year=1913 | pages=189–196}}</ref>,當中介紹了「打字的猴子」的概念。這個定理是[[概率論]]中的[[柯爾莫哥洛夫]]的[[零一律]]的其中一個命題的例子。不過,當波萊爾在書中提出零一律的這個特例時,柯爾莫哥洛夫的一般敘述並未給出(柯爾莫哥洛夫那本概率論的著作直到1933年才出版)。 == 定义 == === 普遍认同的观点 === 關於此定理的敘述為:有無限隻猴子用無限的時間會產生特定的文章。其實不必要出現了兩件無限的事物,一隻猴子打字無限次已經足夠打出任何文章,而無限隻猴子則能即時產生所有可能的文章。 === 其他定义 === 其他取代的敘述,可能是用[[大英博物館]]或[[美國國會圖書館]]取代法國國家圖書館;另一個常見的版本是英語使用者常用的,就是猴子會打出[[莎士比亞]]的著作。 == 出处 == 这一典故的出处,[[乔纳森·斯威夫特]]1782年出版的的《[[格列佛游记]]》,第三部分第五章,教授要其學生通過經常轉動機械把手產生一些隨機的字句,以建立所有科學知識的列表。 == 证明 == === 直接证明 === 两个[[统计独立性|独立]]事件同时发生的概率等于其中每个事件单独发生的概率的乘积。比如,在某一天[[台北]]下雨的可能性为0.3,[[旧金山]]地震的可能性是0.008(这两个事件可以视为'''相互独立'''的),那么它们同时发生的概率是0.3×0.008 = 0.0024。 假设一个[[打字机]]有50个键,想要打出的字是“[[wikt:banana|banana]]”。随机的打字时,打出第一个字母“b”的概率是1/50,打出第二个字母“a”的概率也是1/50,因为事件是独立的,所以一开始就打出单词“banana”的概率是: : (1/50)×(1/50)×(1/50)×(1/50)×(1/50)×(1/50) =(1/50)<sup>6</sup>, 这个概率小于150亿分之1。同理,接下来继续打出“banana”的概率也是1/50<sup>6</sup>。 所以,在给定的六个字母'''没有'''打出“banana”的概率是1−(1/50)<sup>6</sup>。因为每一段(6个字母)文字都是独立的,连续n段都没有打出“banana”的概率''X''<sub>''n''</sub>是: : <math>X_n=\left(1-\frac{1}{50^6}\right)^n\,</math> 随着''n''变大,''X''<sub>''n''</sub>在变小。当''n''等于100万时,''X''<sub>''n''</sub>大约是0.9999(没有打出“banana”的概率是99.99%);但是当''n''等于100亿时''X''<sub>''n''</sub>大约是0.53(没有打出“banana”的概率是53%);当''n''等于1000亿时''X''<sub>''n''</sub>大约是0.0017(没有打出“banana”概率是0.17%);当''n''趋于无穷时''X''<sub>''n''</sub>[[极限 (数学)|趋于]]零。这就是说,只要使''n''足够大,''X''<sub>''n''</sub>可以变得足够小。{{NoteTag|这表明在给定的六个字母中键入“香蕉”的可能性趋于1。}}<ref>{{cite book |last=Isaac |first=Richard E. |title=The Pleasures of Probability |url=https://archive.org/details/pleasuresofproba0000isaa |year=1995 |publisher=Springer | isbn = 038794415X |pages=[https://archive.org/details/pleasuresofproba0000isaa/page/48 48]–50 }} Isaac generalizes this argument immediately to variable text and alphabet size; the common main conclusion is on p. 50.</ref> 同样的论证也可以说明在无限多的猴子中有至少一个会打出一段特定的文章。这里''X''<sub>''n''</sub> =(1−(1/50)<sup>6</sup>)<sup>''n''</sup>,其中''X''<sub>''n''</sub>表示在前n个猴子中没有一个一次打出''banana''的概率。当我们有1000亿只猴子时,这个概率降低到0.17%,并且随着猴子数量n趋于无穷大,没有打出“banana”的概率''X''<sub>''n''</sub>趋于0。 但是,在只有有限的时间和有限隻猴子时,结论就大不一样了。如果我们的猴子数量和[[可观测宇宙]]中的基本粒子数量一样多,大约10<sup>80</sup>隻,每秒钟打1000个字,持续打100倍于宇宙的生命长度的时间(大约10<sup>20</sup>秒)有猴子能够打出一本小书的概率也[[#概率|趨近于0]]。 === 无限长的字符串 === 以上两种情况可以扩展到所有的[[字符串]]: * 给定一个无限长的字符串,其中的每一个[[字符]]都是随机产生的,那么任意有限的字符串都会作为一个[[子字符串]]出现在其中(事实上要出现无限多次)。 * 给定一个序列,其中有无限多个无限长的字符串,其中每一个字符串中的每一个字符都是随机产生的,那么任意有限的字符串都会出现在其中某些字符串的开头(事实上是无限多个字符串的开头)。 对于第二个定理,设''E''<sub>''k''</sub>某给定字符串出现在第k个字符串开头的[[事件 (概率论)|事件]]。有固定的且不为零的概率''p''是这个事件发生,而且''E''<sub>''k''</sub>是独立的,所以: :<math>\sum_{i=1}^\infty P(E_k) = \sum_{i=1}^\infty p = \infty,</math> 事件''E''<sub>''k''</sub>发生无穷多次的概率是1([[波莱尔-坎泰利引理]])。第一个定理可以类似地处理,先将无限长的字符串分割,使得每一段的长度和给定字符串相同,然后设''E''<sub>''k''</sub>是第''k''段等于给定字符串的事件。{{NoteTag|The first theorem is proven by a similar if more indirect route in {{cite book |last=Gut |first=Allan |title = Probability: A Graduate Course |url=https://archive.org/details/probabilitygradu00guta_110 |year=2005 |publisher=Springer |ISBN = 0387228330 |pages = [https://archive.org/details/probabilitygradu00guta_110/page/n117 97]–100 }} }} === 概率 === 不算[[标点符号]]、空格、大小写,一个猴子随机打字打出的第一个字母和《[[哈姆雷特]]》中相同的概率是<math>\frac{1}{26}</math>,前两个字母相同的概率是<math>\frac{1}{676}</math>(即<math>\frac{1}{26\times26}</math>)。因为概率发生了[[指数爆炸]],前20个字母相同的概率是<math>26^{-20}=\frac{1}{19,928,148,895,209,409,152,340,197,376}\approx5.02\cdot10^{-29}</math>。而打出的字和《哈姆雷特》的全部文本相同的概率降低到難以想象。整部《哈姆雷特》大约有130,000个字母{{NoteTag|1= Using the Hamlet text [http://www.gutenberg.org/dirs/etext99/1ws2611.txt from gutenberg], there are 132680 alphabetical letters and 199749 characters overall.}}。虽然有3.4{{e|183,946}}分之一的概率一遍就正确地打出所有文本,在打出正确的文字之前平均需要输入的字母数量也要3.4{{e|183,946}}{{NoteTag|1= For any required string of 130,000 letters from the set a-z, the average number of letters that needs to be typed until the string appears is (rounded) 3.4 × 10<sup>183,946</sup>, except in the case that all letters of the required string are equal, in which case the value is about 4% more, 3.6 × 10<sup>183,946</sup>. In that case failure to have the correct string starting from a particular position reduces with about 4% the probability of a correct string starting from the next position(i.e., for overlapping positions the events of having the correct string are not independent; in this case there is a positive correlation between the two successes, so the chance of success after a failure is smaller than the chance of success in general). The figure 3.4 × 10<sup>183,946</sup> is derived from ''n'' = 26<sup>130000</sup> by taking the logarithm of both sides: log<sub>10</sub>(''n'') = 1300000×log<sub>10</sub>(26) = 183946.5352, therefore ''n'' = 10<sup>0.5352</sup> × 10<sup>183946</sup> = 3.429 × 10<sup>183946</sup>.}},或者包括标点符号,4.4{{e|360,783}}{{NoteTag|1= 26 letters ×2 for capitalisation, 12 for punctuation characters = 64, 199749×log<sub>10</sub>(64) = 4.4 × 10<sup>360,783</sup>.}} 即使可观测宇宙中充满了猴子一直不停地打字,能够打出一部《哈姆雷特》的概率仍然少于10<sup>183,800</sup>分之一<ref name="KK">{{cite book |first1 = Charles |last1 = Kittel |first2 = Herbert |last2 = Kroemer |title = Thermal Physics |url = https://archive.org/details/thermalphysics00kitt_429 |edition = 2nd |publisher = W. H. Freeman Company |year = 1980 |ISBN =0-7167-1088-9 |pages = [https://archive.org/details/thermalphysics00kitt_429/page/n35 53] }}</ref>。 ==现实== 实际在现实中,猴子打出一篇像样的文章的概率比理论上来的更加低。2003年,[[普利茅斯大学]]艺术媒体实验室课程的教师和学生使用2,000英镑津贴做了这个实验,结果打出了5张几乎全是‘S’的纸。最终打出的文字<ref>{{Cite web|url=http://www.vivaria.net/experiments/notes/publication/NOTES_EN.pdf|title=Notes Towards the Complete Works of Shakespeare|access-date=2019-04-02|archive-date=2013-01-20|archive-url=https://web.archive.org/web/20130120215600/http://www.vivaria.net/experiments/notes/publication/NOTES_EN.pdf|dead-url=unfit}}</ref>没能成为一个完整的句子。<ref>{{Cite web |url=http://news.bbc.co.uk/1/hi/3013959.stm |title=No words to describe monkeys' play |access-date=2017-08-01 |archive-date=2019-01-21 |archive-url=https://web.archive.org/web/20190121034002/http://news.bbc.co.uk/1/hi/3013959.stm |dead-url=no }}</ref> 程序员Jesse使用Hadoop、亚马逊EC2和Ubuntu,并以 ASCII 形式存在的随机数成功重现《莎士比亚全集》。<ref>{{Cite web|title=A Few More Million Amazonian Monkeys {{!}} Jesse Anderson|url=https://www.jesse-anderson.com/2011/08/a-few-more-million-amazonian-monkeys/|accessdate=2020-02-16|language=en-US|archive-date=2021-04-02|archive-url=https://web.archive.org/web/20210402024113/https://www.jesse-anderson.com/2011/08/a-few-more-million-amazonian-monkeys/|dead-url=no}}</ref> == 相關條目 == * [[摩菲定理]] * [[Twitch Plays Pokémon]] == 注釋 == {{NoteFoot}} == 参考文献 == {{Reflist}} ==外部連結== *[https://web.archive.org/web/20090116222144/http://www.baltimoreexaminer.com/opinion/The_million_monkey_room.html The Million Monkey Room], October 2008, a satirical essay by D.R. Belz from The Baltimore Examiner{{Dead link|date=November 2009}} * [http://mathforum.org/library/drmath/view/55871.html Ask Dr. Math article] {{Wayback|url=http://mathforum.org/library/drmath/view/55871.html |date=20070315203940 }}, August 1998, Adam Bridge * [http://www.angelfire.com/in/hypnosonic/Parable_of_the_Monkeys.html The Parable of the Monkeys] {{Wayback|url=http://www.angelfire.com/in/hypnosonic/Parable_of_the_Monkeys.html |date=20100406021543 }}, a bibliography with quotations * [https://web.archive.org/web/20080719075206/http://vlab.infotech.monash.edu.au/simulations/evolution/richard-dawkin-weasel/ Infinite Monkey / Dawkin's Weasel demo applet] (in Monash University's Virtual Lab) * [http://www.ietf.org/rfc/rfc2795.txt RFC 2795] {{Wayback|url=http://www.ietf.org/rfc/rfc2795.txt |date=20090923015701 }} - The Infinite Monkey Protocol Suite (IMPS) [[Category:数学定理|W]] [[Category:概率论]] [[Category:隨機性]] [[Category:动物隐喻]]
该页面使用的模板:
Template:Cite book
(
查看源代码
)
Template:Cite journal
(
查看源代码
)
Template:Cite web
(
查看源代码
)
Template:Dead link
(
查看源代码
)
Template:E
(
查看源代码
)
Template:Lang-en
(
查看源代码
)
Template:NoteFoot
(
查看源代码
)
Template:NoteTA
(
查看源代码
)
Template:NoteTag
(
查看源代码
)
Template:Reflist
(
查看源代码
)
Template:Wayback
(
查看源代码
)
返回
無限猴子定理
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息