Skip to main content
Home
plus.maths.org

Secondary menu

  • My list
  • About Plus
  • Sponsors
  • Subscribe
  • Contact Us
  • Log in
  • Main navigation

  • Home
  • Articles
  • Collections
  • Podcasts
  • Maths in a minute
  • Puzzles
  • Videos
  • Topics and tags
  • For

    • cat icon
      Curiosity
    • newspaper icon
      Media
    • graduation icon
      Education
    • briefcase icon
      Policy

    Popular topics and tags

    Shapes

    • Geometry
    • Vectors and matrices
    • Topology
    • Networks and graph theory
    • Fractals

    Numbers

    • Number theory
    • Arithmetic
    • Prime numbers
    • Fermat's last theorem
    • Cryptography

    Computing and information

    • Quantum computing
    • Complexity
    • Information theory
    • Artificial intelligence and machine learning
    • Algorithm

    Data and probability

    • Statistics
    • Probability and uncertainty
    • Randomness

    Abstract structures

    • Symmetry
    • Algebra and group theory
    • Vectors and matrices

    Physics

    • Fluid dynamics
    • Quantum physics
    • General relativity, gravity and black holes
    • Entropy and thermodynamics
    • String theory and quantum gravity

    Arts, humanities and sport

    • History and philosophy of mathematics
    • Art and Music
    • Language
    • Sport

    Logic, proof and strategy

    • Logic
    • Proof
    • Game theory

    Calculus and analysis

    • Differential equations
    • Calculus

    Towards applications

    • Mathematical modelling
    • Dynamical systems and Chaos

    Applications

    • Medicine and health
    • Epidemiology
    • Biology
    • Economics and finance
    • Engineering and architecture
    • Weather forecasting
    • Climate change

    Understanding of mathematics

    • Public understanding of mathematics
    • Education

    Get your maths quickly

    • Maths in a minute

    Main menu

  • Home
  • Articles
  • Collections
  • Podcasts
  • Maths in a minute
  • Puzzles
  • Videos
  • Topics and tags
  • Audiences

    • cat icon
      Curiosity
    • newspaper icon
      Media
    • graduation icon
      Education
    • briefcase icon
      Policy

    Secondary menu

  • My list
  • About Plus
  • Sponsors
  • Subscribe
  • Contact Us
  • Log in
  • Outer space: Monkey business

    by
    John D. Barrow
    1 March, 2005
    March 2005

    monkey

    Now where's that typewriter?

    The legendary image of an army of monkeys typing letters at random and eventually producing the works of Shakespeare seems to have gradually emerged over a long period of time. In Gulliver's Travels (1782) Jonathan Swift tells of a Professor of the Grand Academy of Lagado who aims to generate a catalogue of all scientific knowledge by having his students continuously generate random strings of letters by means of a mechanical printing device.

    The first mechanical typewriter had been patented in 1714. After several 18th and 19th century French mathematicians used the example of a great book being composed by a random deluge of letters from a printing works as an example of extreme improbability, the monkeys appear first in 1909. The French mathematician Émile Borel suggests that the randomly typing monkeys would eventually produce every book in France9s Bibliothèque Nationale. Arthur Eddington took up the analogy in his famous book The Nature of the Physical World in 1928, where he changed the library in question in a not entirely unpredictable way: "If I let my fingers wander idly over the keys of a typewriter it might happen that my screed made an intelligible sentence. If an army of monkeys were strumming on typewriters they might write all the books in the British Museum."

    Complete Works of Shakespeare

    Eventually this oft-repeated example homed in on the Complete Works of Shakespeare as the candidate for random recreation. And, intriguingly, there is now a website which simulates an ongoing random striking of typewriter keys and then does pattern searches against the Complete Works of Shakespeare to identify matching character strings. This simulation of the monkeys' actions began on 1st July 2003 with 100 monkeys and the population of monkeys has effectively doubled every few days ever since. They have produced more than 1035 pages, each requiring 2000 keystrokes.

    • There are 80 possible keystrokes on most standard keyboards, so what is the chance of getting a pre-specified string of 10 characters correct?
    • What is the probability of typing the two-letter word "as"?
    antique typewriter

    No time to waste

    To check how the monkeys are doing, see The Monkey Shakespeare Simulator. A running record is kept of daily and all-time record strings. The daily records are fairly stable, around the 18 or 19 character-string range, and the all-time record inches steadily upwards. For example, recently I saw that one of the 18-character strings that the monkeys have generated contains the snippet:

    ...Theseus. Now faire UWfIlaNWSK2d6L;wb...
    The first 18 characters match part of an extract from A Midsummer Night's Dream that reads
    ...us. Now faire Hippolita, our nuptiall houre....
    For a while the record string was 21 characters long, with
    ...KING. Let fame, that wtIA'"yh!"VYONOvwsFOsbhzkLH...
    which matches the following 21 letters from Love's Labour's Lost:
    ...KING. Let fame, that all hunt after in their lives,
    Live regist'red upon our brazen tombs, And then grace us in the disgrace of death;....

    In December 2004, the record reached 23 characters with

    ...Poet. Good day Sir FhlOiX5a]OM,MlGtUGSxX4IfeHQbktQ...
    which matched part of Timon of Athens
    ...Poet. Good day Sir Pain. I am glad y'are well.
       Poet. I haue not seene you long, how goes the World?
       Pain. It weares sir, as it growes....
    But I can report that in January 2005, after 2,737,850 million billion billion billion monkey-years of random typing, the record has stretched to 24 characters, with
    RUMOUR. Open your ears; 9r"5j5&?OWTY Z0d "B-nEoF.vjSqj[..."
    which matches 24 letters from Henry IV Part 2 "RUMOUR. Open your ears; for which of you will stop
    The vent of hearing when loud Rumour speaks?..."

    Which all goes to show: it is just a matter of time!



    Did you manage to answer the puzzle posed in Outer space: Racing certainties? If not, you can find the answer here!
    • Log in or register to post comments

    Read more about...

    probability
    outerspace

    Our Podcast: Maths on the Move

    Our Maths on the Move podcast brings you the latest news from the world of maths, plus interviews and discussions with leading mathematicians and scientists about the maths that is changing our lives.

    Apple Podcasts
    Spotify
    Podbean

    Plus delivered to you

    Keep up to date with Plus by subscribing to our newsletter or following Plus on X or Bluesky.

    University of Cambridge logo

    Plus is part of the family of activities in the Millennium Mathematics Project.
    Copyright © 1997 - 2025. University of Cambridge. All rights reserved.

    Terms