Infinite Monkey Theorem
Main Concept
The Infinite Monkey Theorem is a popular demonstration of mathematical probability, stating that
A monkey hitting keys at random on a typewriter keyboard, given enough time and typewriters, will reproduce the entire works of Shakespeare.
In mathematical terms, the text typed by a monkey for an infinite period of time can be interpreted as an infinite string with uniformly chosen random characters. The probability that a finite substring of length $k$ does not occur in the first $n$ blocks of $k$ characters is
${P}_{n}\={\left(1-\frac{1}{{26}^{k}}\right)}^{n}$
assuming a keyboard with 26 different keys. As $n\to \infty$, the probability that a monkey fails to reproduce any text of finite length $k$ is
$\underset{{n}{\to}{\mathrm{\∞}}}{{lim}}{\left({1}{-}{\left(\frac{{1}}{{26}}\right)}^{{k}}\right)}^{{n}}{}{assuming}{}{k}{gt;}{0}$ = ${0}$
The following demonstration generates random strings of characters and attempts to build sentences containing pre-defined types of words. Experiment with the sentence structure and see how many sensible sentences you can generate. Use the "Word complexity" slider to influence the chance of generating longer strings.
Sentence structure: NounVerbAdverbAdjectivePrepositionConjunctionPronounInterjectionArticleNoneNounVerbAdverbAdjectivePrepositionConjunctionPronounInterjectionArticleNoneNounVerbAdverbAdjectivePrepositionConjunctionPronounInterjectionArticleNoneNounVerbAdverbAdjectivePrepositionConjunctionPronounInterjectionArticleNoneNounVerbAdverbAdjectivePrepositionConjunctionPronounInterjectionArticleNoneNounVerbAdverbAdjectivePrepositionConjunctionPronounInterjectionArticle
Number of attempted sentences
Word complexity
More MathApps
MathApps/ProbabilityAndStatistics
Download Help Document
What kind of issue would you like to report? (Optional)