Apologies if this is a very basic/obvious question. I have no training in philosophy, but have been making my way through Peter Adamson's History of Philosophy podcast.

Recently I listened to his interview with Richard Sorabji (the transcript can be found here), where they discuss views on time. In particular, he says this in the middle of a discussion about the difference between something being "eternal" and "necessary".

Now the common idea is that if you took monkeys - let them be eternally existing monkeys on an eternally existing typewriter - if they went on randomly typing for eternal time, they would eventually have to write out the works of Shakespeare. A lot of people think that's true, but it isn't actually true at all.

I'm approaching this from my background, which is in mathematics, where I would definitely feel comfortable asserting that the works of Shakespeare would eventually be written out, along with all other finite strings (maybe if considering infinite strings I would have to sit and think for a bit).

Is there some deeper philosophical idea why he says this? Is he arguing in terms of this question that the issue is just a logistical one? The claim isn't discussed any further so I assume it's not controversial, maybe there's a well-known refutation but at least on my limited research I haven't been able to find anything (except for some debates on the intention of art which have nothing to do with randomly generated strings).

(Tags are my best guess but please correct if there are more appropriate ones available.


13 Answers 13


Yes, the monkeys will do it. No, they don't have to.

It's mathematically true that after removing all logistical constraints - which is what we mean when we say there are infinitely many monkeys, given an infinite amount of time, typing with perfect randomness - we can be certain that the works of Shakespeare will get typed out with probability 1. But this is not the same as saying that this outcome is "necessary", which is what the speakers are discussing in the interview the quote is taken from.

When an event is considered as "necessary", it means that it is something that must happen out of essence, or by definition. It is inconceivable of that thing not happening; such a universe would be incoherent, it wouldn't make sense. For example, it is necessary that if a number x is less than 5, then x must also be less than 10. It's not a coincidence; it is an absolute fact that follows from the given information. It's not possible to even conceive of a situation where x could be greater than 10 if we knew that x is less than 5.

There are many things that happen that did not necessarily have to happen. The example in the interview is that the speaker Adamson has no sister, and will surely never have a sister, but that outcome is not due to some logical necessity that considers any universe in which he has a sister as inconsistent and absurd. It just happens to be the way things turned out.

So, regarding the monkey-typing-Shakespeare example: yes, we can reach mathematical confidence that the probability that the works of Shakespeare will not get typed would reach 0 in the infinite limit. But is the outcome in which the works get written something that is a logically required consequence of how this universe is in essence, such that we cannot conceive of any way that such a thing could not happen? Not really. The monkeys are not typing out these pages because some law of the universe is forcing their fingers into a specific pattern. It happens merely because there's enough time for such an unlikely accident to actually take place. (Indeed, the word "accident" is used to describe things that happen that are exactly the opposite of being "necessary".)

In this case, the event is only considered certain in the mathematical sense (events of probability 1 can still fail to occur - what if the monkeys, due to random chance, are extremely unlucky and only type the string "aaaaa...." eternally? This is not impossible) - and hence is not even certain in the normally understood sense of the word, let alone certain in the sense of being necessary.

  • Related answer, using dice as an example instead of typewriters: philosophy.stackexchange.com/a/94694/9274
    – kutschkem
    Commented Oct 19, 2023 at 8:22
  • 18
    +1 — this is the right answer in context. Since OP mentions their background is in mathematics, they may be familiar with the terminology “almost surely” or “almost everywhere” from probability/measure theory, meaning that the complement of an event has measure 0 (but isn’t necessarily empty). If I pick a real number uniformly from $[0,1]$, it will almost surely be irrational — the set of irrationals has measure 1. And for any given number, $x$ I will almost surely not pick exactly $x$. But we can’t say that I’ll necessarily fail to pick $x$ — because for some $x$, I will pick it. Commented Oct 19, 2023 at 8:36
  • 8
    "infinitely many monkeys" one monkey should suffice Commented Oct 19, 2023 at 12:31
  • Note that even though the monkeys will eventually produce the works of Shakespeare, you still need some kind of mechanism to detect and filter the good stuff so that it can be propagated and consumed. This is related to Maxwell's demon, where you need to spend effort to extract good patterns out of randomness.
    – Nayuki
    Commented Oct 19, 2023 at 19:11
  • 1
    While correct about the math, you are working with some unstated assumptions about the character distribution of the monkeys' output, which I addressed in my answer.
    – Sandejo
    Commented Oct 19, 2023 at 21:19

The difference is between in principle and in practice. If you did have an infinite number of monkeys typing at random for eternity they would produce the works of Shakespeare. However, even if every atom in the Universe was replaced by a typing monkey for the expected life of the Universe, the probability of producing the works of Shakespeare would be vanishingly small.

Separately, I suppose that just one monkey typing for an infinitely long time would eventually do the trick. Does that mean that one out of an infinite number of monkeys would achieve the result in a shorter period? It would take about 5 million keystrokes to type the complete works, so I suppose allowing for sleep, munching bananas etc, the fastest one of the infinite monkeys could do it might be around a year. That said, would you count it as cheating if individual works were typed by individual monkeys?

  • 1
    This and other answers/comments seem to be the consensus, so it seems to me that Richard's assertion that it wouldn't occur is purely logistical. That is, I can agree all day that it's unlikely and that any universe and any number of letter generators working as long as you like would never produce Shakespeare if stopped at a certain point, as long as we agree that in a truly infinite scenario, it is in fact produced. It just struck me as odd since the conversation was about things that are eternal, which is surely the same thing as truly infinite.
    – Uzai
    Commented Oct 18, 2023 at 9:32
  • 2
    @Uzai Eternity is a really long time, especially towards the end. -- Woody Allen
    – Olivier5
    Commented Oct 18, 2023 at 14:46
  • 1
    Infinite monkeys would produce Shakespeare in finite time. The version I usually hear is "a room full of monkeys with infinite time" Commented Oct 19, 2023 at 9:31

The odds are just too small for this to happen in any fathomable universe. From Wikipedia:

If there were as many monkeys as there are atoms in the observable universe typing extremely fast for trillions of times the life of the universe, the probability of the monkeys replicating even a single page of Shakespeare is unfathomably small. [...] In fact there is less than a one in a trillion chance of success that such a universe made of monkeys could type any particular document a mere 79 characters long.

79 characters is about the length of the first two verses of Romeo and Juliet:

Two households, both alike in dignity,
In fair Verona, where we lay our scene, ...
  • 16
    I accept the odds are incredibly/unreasonably low, but that doesn't contradict the assertion that it would happen after infinite time. A finite number of monkeys in a finite universe that only lasts a trillion times as long as the age of our universe is still a finite approximation. Or is being truly infinite considered "unfathomable", and that's enough (philosophically, if not logically) to refute the claim?
    – Uzai
    Commented Oct 18, 2023 at 8:51
  • 22
    @Olivier5 I think you're failing to understand the concept of "infinity". It doesn't matter how small the odds are. You could wait ten billion quadrillion trillion million quintillion years and you still have infinitely more time to wait. Even if the odds were 1/TREE(3) it's all but guaranteed to happen eventually. Commented Oct 18, 2023 at 17:51
  • 10
    @Olivier5 Isn't this cutting rather close to denying the antecedent? e.g. If infinite monkeys typed for infinite time, then they would produce the works of Shakespeare. "Infinite monkeys typing for infinite time" can't happen. Therefore, they wouldn't produce the works of Shakespeare. -- I'm not saying that questioning the premise isn't a valid approach. I'm just saying that invalidating the premise is very different from disproving the consequent under the assumption the premise is valid, which seems to be more what the quote is implying.
    – R.M.
    Commented Oct 18, 2023 at 17:57
  • 9
    we're not talking about a fathomable universe, but about an infinite number of monkeys. That's way more monkeys. ridiculously small odds doesn't change that fact. any odd > 0 is enough.
    – njzk2
    Commented Oct 18, 2023 at 21:13
  • 6
    @Olivier5 Also, if there is an infinite number of monkeys typing uniformly randomly and independently, then a minuscule fraction of them (but still an infinite number of them) would type the complete works of Shakespeare right away, without losing time writing any gibberish before!
    – Stef
    Commented Oct 19, 2023 at 16:07

This points to the danger of thought experiments. Clearly this isn't meant to be a realizable scenario. In a real-world version, even putting niceties such as immortality, feeding and materials aside, the monkeys might not even type, or might break the typewriter, or only be able to hit a bundle of keys at once.

But once we strip this of its real-world trappings, what's left? What are we really talking about? Is this just an elaborate metaphor for a mathematical concept?

Without knowing more about Sorabji's work and philosophical commitments, my base assumption is that he's talking about the fact that there's no possible real-world analog to this. At best, what we can take from it is the real-world phenomena that very improbable events can occur with relative certainty given a large enough set of relevant interactions.

  • The speaker is quoted as saying "... let them be eternally existing monkeys on an eternally existing typewriter..." so he's certainly not talking about real-world anything, so it seems reasonable to consider the discussion a (more amusing than elaborate) metaphor for a mathematical concept.
    – Spike0xff
    Commented Oct 21, 2023 at 5:09

How about instead of a typewriter the infinite monkeys each have a button for 0 and a button for 1 and truly randomly smacks one or the other until the end of time. We'll group up those 0s and 1s into bytes and convert them to ASCII. It's extremely likely that eventually a monkey will have randomly typed out the entire works of Shakespeare in binary. Though, however unlikely it is, there must exist an infinity where every one of the infinite monkeys always truly randomly picks only 0, in which case Shakespeare is never generated.


It is fairly easy to show that it is not necessary.

First let us simplify the model. Instead of a finite set of monkeys randomly typing keys on a type-writer for all of eternity, let's have a finite set of monkeys each continuously tossing a fair coin for eternity. And instead of the output being the works of Shakespeare, let the outcome be that there is even just one flip of the coin where it lands tails. We would expect that the coin would land tails pretty fast, but there is nothing to make it so, and in fact nothing to make it ever happen.

For each flip of the coin by each monkey we can write down the different possible outcomes. However large the number of monkeys and however many times the coin is tossed, there is always the possibility that every toss of the fair coin comes up heads (and if that were not possible, it would not be a fair coin!). It is one of the many billions and billions and [add whatever number you want here] of possible outcomes. There is no upper limit to the amount of straight heads in a row that could be tossed, and thus it is NOT necessary that even one single tails is ever tossed.

If you extend this to the monkeys on the typewriter, at any given point there will be a finite number of keys that have been hit. It is entirely possible that each and every single monkey randomly types out this exact post that you are currently reading continuously for ever. Or the American constitution. Or the collected works of Karl Marx. It is one of the theoretically possible outcomes however long the monkeys type for.

Notice that this is not bound by the length of time that the universe exists for or anything like that.


Since every answer here seems to be an aimless shower thought, trying to decode an assertion probably intentionally vague to make the guy who made it sound smugly intelligent, which is most of philosophy, I figure I'll throw mine in too.

I'm pretty sure what this guy's trying to say is that, even though the odds approach a limit of 100% as you approach infinite time (the probability of it not happening is zero), no matter how long you wait it's still one possibility among many that the monkeys still haven't typed out Shakespeare. It is one possibility out of infinitely many that, after an infinite amount of time, every single monkey has typed out the contents of the Wikipedia page on "Infinite monkey theorem" over and over again on repeat, by pure chance.


There will be a time when nobody remembers who Shakespeare is and what all these monkeys are doing. And that time isn’t very far away. After that, nobody will know when they write whatever I have forgotten.


Zayn's answer correctly points out the mathematical fact that, assuming the necessary assumptions, as the time goes to infinity, the probability of the output of the monkeys containing a given substring (such as the works of Shakespeare) goes to 1, which is not equivalent to it being necessary. However, that answer notably does not discuss those assumptions, so let's go over them here. The main unstated assumptions people seem to be working with here are that the monkeys are regularly typing a character that is uniformly and independently chosen from all of the characters the keyboard can type, or some similar assumptions that could be loosened slightly without changing the conclusion.

Now, we might wonder whether these assumptions are reasonable. To investigate this, I turn to a project from 2002, in which a group of monkeys at the Paignton zoo in the UK were given access to a keyboard connected to a monitor* for 7.5 weeks to observe what real monkeys would do with a keyboard. The output of the monkeys can be seen here. If you read through the text produced by the monkeys, you might notice that it looks like it was likely not produced by a stochastic process meeting the assumptions stated above. So, while we might argue that ideal monkeys at typewriters would eventually produce the works of Shakespeare, given infinite time, I'm not so sure that this would be true for real monkeys.

*Obviously, this is not exactly the same as a typewriter, but it is sufficiently similar for inference of similar behavior.

  • Thank you for the link to the output, that's very fun.
    – Uzai
    Commented Oct 20, 2023 at 17:53
  • The Paignton Zoo experiment was what I first thought of, too. But we don’t need the assumption that keypresses are independent and of uniform probability; we need that there is some tiny but fixed probability (say, 0.00001%) such that, given any history of keypresses, each key is at least that likely to be pressed. If this is met, then each finite substring will occur arbitrarily often with probability 1.
    – Charles
    Commented Oct 21, 2023 at 14:46
  • @Charles like I said, the assumptions could be loosened slightly. I just didn't think it was necessary to state exactly what the weakest conditions are.
    – Sandejo
    Commented Oct 21, 2023 at 21:23

So, regarding the monkey-typing-Shakespeare example: yes, we can reach mathematical confidence that the probability that the works of Shakespeare will not get typed would reach 0 in the infinite limit. - Zayn

So, you've asked a philosophical question because the dispute over whether or not infinite monkeys with infinite time revolves around the metaphysical conception of infinity. Believe it or not, it's actually contentious to use infinity without clarification because there are two positions on it, the actual infinity and potential infinity. The orthodoxy, which derives from Platonic thinking is that actual infinity is real, but the heterodoxy best articulated by Pierce and Brouwer is that it does not. Therefore, at the heart of your question, there is a question of ontological commitment that could easily be missed if you don't see the metalanguistic pragmatics of semantic ascent occurring. You've come to the right forum, because some of here have followed the linguistic turn and reject mathematical realism as naive and embrace something more in line with mathematical nomalism (SEP) in regards to mathematical discourse. It is not that one must abandon realism, but that it is simply less explanatory and expressive.

You said:

I'm approaching this from my background, which is in mathematics, where I would definitely feel comfortable asserting that the works of Shakespeare would eventually be written out, along with all other finite strings (maybe if considering infinite strings I would have to sit and think for a bit).

From a constructivist perspective, infinity is linguistic fiction. It is not a real thing. In fact, one can see it as derivative of grammatical strategy in which the semantics of infinite is best understood as defined by operational semantics that are subject to the constraints of physical computation (SEP).

You can say 'I can do things forever'. But here's a spoiler, in any possible metaphysical world where empiricism is a guiding force, you simply can't. Your brain only live 100 years. You PC only can run and exhibits limits of computational complexity. And when you have two competing asymptotic functions, what matters is the relative divergence of their graphs. You cannot actually have infinite monkeys and you cannot actually have them working infinitely long. So the question is, given the computational constraints of a finite number of monkeys working for a finite length of time, can the probability be crafted to show that Shakes' complete works can be produced. And the answer to that is it is not a mathematical a priori question, but it is an empirical question subject to mathematical modeling. Sure, if you accept actual infinity, you'll reason your way to assured production. But the farce of accepting actual infinity by abstracting out anything that resembles the constraints of physical reality is a form of metaphysical blindness that is akin to metaphysical speculation of angels and pinheads. Thus, if you have a respectable naturalized epistemology, the conclusion that seems far more likely is a resounding no.

  • There is a lot of bad metaphysics in the orthodoxy of mathematical philosophy. Don't continue to drink the kool-aid! ; )
    – J D
    Commented Oct 19, 2023 at 23:23

Yes, because Shakespeare and letters are finite

The problem is identical to matching a finite sequence of integers (1 character = 1 integer), given infinite random draws. Not only is this guaranteed to occur, it'll happen infinitely many times.

I disagree with Zayn's argument; the outcome follows the premise. "The monkeys are not typing out these pages because some law of the universe is forcing their fingers into a specific pattern" - the "pattern" is the randomness, and the mathematical result follows by definition.

No, they won't necessarily draw all Picasso

The problem is identical to matching a finite sequence of real numbers (1 color = 1 real), given infinite random draws. This is no longer guaranteed: there's more reals between 0 and 1 than there are integers, and the probability of picking any one real is 0. Though to be more precise, it's probably not guaranteed; it's ill-defined - point is, this case is clearly tough or impossible.

('Practically', they would, to humans, as we can't infinitely resolve colors; the reals are rounded.)

Actually, not absolutely necessarily

Proper reading is Infinite monkey theorem, and the proven answer is "almost surely". In short, in infinite coin tosses, the probability of not getting a single head is 0, but it's still possible (like the reals case). They could all just type 'aaaaaaaa...'. "Surely" can be achieved via a uniqueness constraint upon the random generator (in this sense, pseudo-random beats truly random).

Unless the podcaster means to make a meaningful point out of such coin tossing, however, I doubt this was the intent.

  • 2
    But since a Picasso is made up of a finite number of atoms, the color can't have infinite precision. But I guess once we get to that scale, the color is constantly changing due to individual molecules breaking down Commented Oct 19, 2023 at 15:02
  • Frequency is continuous, as far as that and all related Q&A's suggest, though I'd not know enough to assert it. Commented Oct 19, 2023 at 16:31
  • The number of colors distinguishable by the human eye is not infinite.
    – JimmyJames
    Commented Oct 20, 2023 at 21:01
  • @JimmyJames Yes, that's stated in the answer. Commented Oct 21, 2023 at 12:07
  • I guess I'm confused by the argument then. Why assert something and then add a parenthetical that invalidates it? In any event, while we can show that many things are discrete in nature, there is no way to prove that anything is continuous.
    – JimmyJames
    Commented Oct 23, 2023 at 14:52

It's no different than picking a winning lottery number that is absurdly large. In this instance instead of 10 digits there are 26 letters plus another 14 for punctuation. If there are n alphanumeric characters then the the number of possible n character "words" (including repeated letters and punctuation) is 50^n. A word only 20 characters, has 9.3 x 10^33 possible arrangements of letters and punctuation.

To put this into context There are 4.22 x 10^17 seconds in 13.4 billion years. Guessing once per second would take twice the current age of the universe. A work like Romeo and Juliet has over 100,000 alpha numeric characters. So 50^100000.

The probability may not be zero, but it is certainly below the detection limit of mortals. It's in the domain of miracles.

BTW infinity is not a number!

  • The question asked about "eternally existing monkeys," who presumably have an infinite amount of time to work with, so your points about the probability for a finite amount of time are irrelevant.
    – Sandejo
    Commented Oct 19, 2023 at 19:53
  • But the phrase "infinite monkeys with infinite time" does not actually translate to a brute force output of all possible combinations. If you observe a real monkey for a limited amount of time, and then extrapolate on the observed output, you'll never conclude that Shakespear would fit within the extrapolated data.
    – Nelson
    Commented Oct 20, 2023 at 1:52
  • Working backwards, knowing what the complete works of Shakespear looks like, and what real monkeys do, what exactly is the property of "infinite monkeys and infinite time" that would bridge the gap? You're not talking about a brute-force computer that systematically outputs everything, so to conclude that "infinite monkeys and infinite time" must produce Shakespear's work, infinity must fundamentally change monkeys into a brute force machine to somehow guarantee the output.
    – Nelson
    Commented Oct 20, 2023 at 1:55
  • @Nelson That's a good point. Monkeys are not that stupid to keep typing for eternity. They'd quickly throw the typewriters at one another, for the fun of it. :-)
    – Olivier5
    Commented Oct 20, 2023 at 6:19

Those would be the works of infinite monkeys, not the works of Shakespeare.

He says that they would eventually have to write out the works of Shakespeare, not write out works identical to the works of Shakespeare.

If there's a person a he cannot write out the works of person b because those would be the works of person a which would be identical to the works of person b, the works of person b wouldn't suddenly change ownership to the works of person a.

Some thing here but with infinite monkeys and Shakespeare instead of person a and b.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .