Infinite Monkey Theorem: Could Monkeys With Magnets Ever Produce Windows?

Table of Contents (click to expand)

No: a 2024 study found that even 200,000 chimpanzees typing one key every second until the universe dies would almost never reproduce a single book, so the classic “monkeys will eventually type Shakespeare” idea is true in theory but useless in reality. Swapping the typewriter for a hard drive only makes it worse, because a household magnet can wipe a drive but its pull is the same across the whole disk, so it cannot flip one microscopic bit at a time the way a drive's own write head does. On top of that, those bits are built to resist flipping on their own, which is exactly the thing a lucky random Windows install would need them to stop doing.

There is a scene in Breaking Bad where the characters park a truck full of powerful magnets next to a police evidence room. They switch the magnets on. A laptop inside is wiped clean through the wall. No one touches it. The data is just gone.

The plan works. It is also the last time in this article that a magnet does anything useful to a hard drive.

Because there is an old idea that keeps getting dressed up in new clothes. Give enough monkeys enough typewriters and enough time, and one of them eventually bangs out the complete works of Shakespeare. So here is the modern version. Give a million monkeys a million hard drives and a million strong magnets, and let them wave the magnets around forever. Does one drive eventually end up holding a clean, bootable copy of Windows?

The intuitive answer is "sure, eventually, that's just what the theorem says." That answer is wrong, and it is wrong twice, for two reasons that come from completely different parts of physics.

What Is The Infinite Monkey Theorem?

Start with the plain version. Imagine a monkey mashing keys on a keyboard at random. Every key is equally likely. Given an infinite amount of time, the theorem says, the monkey will eventually type any text you like, including all of Shakespeare, purely by chance.

The math behind that is honest. If something has any chance above zero of happening on a single try, then over infinitely many tries it happens with certainty. Type random letters forever and every possible finite string shows up sooner or later. Hold on to that word "eventually," though. It is doing an enormous amount of hidden work, and the whole article is really about how much.

Here is the part almost nobody knows. The monkeys were never really about monkeys. The French mathematician Émile Borel introduced them in 1913, in a paper on statistical mechanics and irreversibility (MacTutor History of Mathematics). That is the physics of why heat flows one way and never runs backward. Borel wanted a picture for something so unlikely it would never once be seen. A million monkeys typing ten hours a day and reproducing every book in the world's libraries, he said, is fantastically improbable. And yet it is more likely than the air in a room spontaneously rushing into one corner.

So the monkeys started life as a yardstick for the impossible, not a promise of the possible. Keep that in your pocket. We come back to it at the very end.

Has The Infinite Monkey Theorem Actually Been Proven?

The pure theorem is a proven piece of math. The interesting question is what happens when you take the infinity away, because the real universe does not have one to spare. In 2024, mathematicians Stephen Woodcock and Jay Falletta ran exactly that calculation. They published it in the journal Franklin Open as a numerical evaluation of the "finite monkeys" theorem.

Their numbers were grounded in reality. Not infinite monkeys, but 200,000, roughly the actual chimpanzee population alive today. A 30-key keyboard. One keystroke per second. And a clock running not forever but until the heat death of the universe. That is around a 1 followed by 100 zeros in years (University of Technology Sydney, via ScienceDaily).

Let's run the smallest possible target ourselves, the word "bananas." The chance of any lucky run is one over the number of keys, multiplied by itself once for each letter:

chance = (1 ÷ 30)ⁿ

Here n is the number of letters in a row you need. Three quick steps:

  1. There are 30 keys, so each press has a 1 in 30 chance of being the letter you want.
  2. "Bananas" is 7 letters, so all seven in a row is (1 ÷ 30) multiplied by itself seven times. That comes to about 1 in 22 billion per attempt.
  3. A chimp pressing one key a second for a 30-year working life gets a bit over a billion presses. Divide, and you expect about 0.05 "bananas." So across its life, one chimp has roughly a 5% chance of typing the word.

A chimp will, given a career, quite possibly type "bananas." It is the most on-brand result in all of probability theory. But now stretch the target. Take Curious George, a children's book of around 1,800 words. The odds of a chimp reproducing it come out as a decimal point followed by roughly 15,000 zeros before the first digit. Even all 200,000 chimps typing until the heat death of the universe do not make a dent. Woodcock and Falletta's verdict on the classic theorem: "correct, but misleading." True in principle. Useless in a universe with a shelf life.

Add a few letters to the target and the odds fall off a cliff. Pool every chimpanzee alive and let them type until the universe dies, and their entire combined output tops out at roughly one line of text. A whole book is not "unlikely." It is off the bottom of the page.
Add a few letters to the target and the odds fall off a cliff. Pool every chimpanzee alive and let them type until the universe dies, and their entire combined output tops out at roughly one line of text. A whole book is not "unlikely." It is off the bottom of the page.

What Happens When Real Monkeys Get A Keyboard?

Somebody actually tried it. In 2003, researchers from the University of Plymouth put a computer keyboard into the enclosure of six Sulawesi crested macaques at Paignton Zoo in England. They left it running for a month.

The monkeys produced about five pages of text, most of it the letter "S." Then they bashed the keyboard with a stone and used it as a toilet. The literature is unanimous that this is not Hamlet. It is a small, damp reminder that "random" is generous. Real animals are not even a fair coin toss across the keys, and the math above was already the best case.

Not one of the Paignton Zoo typists, but a close relative: a Sulawesi crested macaque, mid-grin. Given a real keyboard, its cousins produced five pages, mostly the letter "S," and treated the machine as furniture.
Not one of the Paignton Zoo typists, but a close relative: a Sulawesi crested macaque, mid-grin. Given a real keyboard, its cousins produced five pages, mostly the letter "S," and treated the machine as furniture.

Now Swap The Typewriter For A Hard Drive

The typewriter version is hopeless. The hard-drive version is hopeless in a more expensive way, and this is where the modern premise really lives.

A hard drive does not store letters. It stores bits. Each bit is a tiny patch on a spinning platter, magnetized one way for a 0 and the other way for a 1 (how a 1 TB drive differs from a 2 TB one). A "1 terabyte" drive, as sold, holds a trillion bytes. That is 8 trillion bits, and each one can be a 0 or a 1, independently.

So the number of possible things a single drive could contain is 2 multiplied by itself 8 trillion times. Written out, that is a 1 followed by roughly 2.4 trillion zeros. For comparison, the whole observable universe holds something like a 1 with 80 zeros' worth of atoms. The drive's list of possible contents does not just beat that. It buries it so far down that "astronomically larger" is a wild understatement. This is where the analogy should break. It actually breaks earlier, for a reason the probability never gets to.

The thing the monkeys are hoping to bully with a magnet: a platter and its read/write head. The data is a pattern of magnetized patches on that mirror-smooth surface, and the head hovers nanometers above it.
The thing the monkeys are hoping to bully with a magnet: a platter and its read/write head. The data is a pattern of magnetized patches on that mirror-smooth surface, and the head hovers nanometers above it.

Why A Magnet Can't Write To A Hard Drive

Here is the reason nobody in the original thought experiment reached, because they never got past the counting. A magnet cannot write to a hard drive at all. Not "unlikely to write something useful." It cannot set a single chosen bit. Ever.

To see why, look at how a drive actually writes. The data sits in a thin magnetic coating made of tiny grains, each only about 8 to 9 nanometers wide, with a whole cluster of them storing a single bit (Griffiths et al., J. Phys. D: Appl. Phys., 2013). Those grains are built to be stubborn on purpose. It takes a strong magnetic push to flip one, far stronger than a fridge magnet. Engineers call that stubbornness coercivity, and it runs to about half a tesla (Western Digital, perpendicular recording white paper).

The write head pulls it off with one trick: it squeezes its magnetic field into a tiny, sharply focused spot. The tip of the head hovers just a few nanometers above the spinning disk. That close, the field is fierce directly under the tip. A hair's width to either side, it has already faded to almost nothing (measured at about 0.87 tesla right at the tip) (Tao et al., Nature Communications, 2016). That sharp focus is the whole secret. The head can flip one tiny cluster of grains and leave its neighbor, sitting right beside it, completely alone.

A handheld magnet is the exact opposite in every way that matters. Its field is essentially uniform across a whole platter, so it has no fine control at all. It flips nothing, or it flips everything in a region at once. That is why a strong enough magnet can erase a drive, as the Breaking Bad magnet scene gets basically right. Erasing is easy. You just smear the whole disk. But setting one specific bit to one specific value, over and over, to write a file? A magnet does not do fine motor control. It is the difference between a scalpel and a house fire.

The whole difference in one picture. The write head's field is savagely steep, so it can flip one cluster of grains and leave the next one alone. A handheld magnet pushes the same way everywhere at once, so it can only wipe, never write.
The whole difference in one picture. The write head's field is savagely steep, so it can flip one cluster of grains and leave the next one alone. A handheld magnet pushes the same way everywhere at once, so it can only wipe, never write.

Why The Bits Won't Even Stay Where You Put Them

Suppose we take pity on the monkeys and hand them a magic bit-flipper that can set any bit they like. The physics still fights back, from the other direction.

A bit keeps its value because there is a kind of wall holding the grain pointing one way. How high that wall is depends on just two things: how stubborn the material is, and how big the grain is.

E = Ku × V

In plain terms, a bigger, tougher grain sits behind a higher wall (E is the wall's height, Ku is the stubbornness, V is the grain's size). Now shrink the grain too far and the wall gets low. So low that the ordinary warmth of the room, the endless tiny jiggling of everything at room temperature, is enough to knock the grain over on its own. No magnet needed. Engineers call this the superparamagnetic limit. Drives are carefully built to stay well clear of it, so the wall stays tall enough that a bit survives about ten years without one accidental flip (Weller and Moser, IEEE Transactions on Magnetics, 1999).

Sit with what that means. The storage medium is engineered, atom by atom, specifically to resist random flipping. Random flipping is exactly what destroys your data. You are asking a filing cabinet that was purpose-built never to lose a file to spontaneously misfile everything into a masterpiece. The newest drives make this even worse. They use a coating so stubborn it can barely be written at room temperature at all. A tiny laser has to warm each spot first, just for an instant, before the head can change it.

Even With Perfect Bit Control, Windows Is A Vanishing Target

Grant the monkeys the magic flipper anyway, and let it be perfect. They still have to land on "working Windows," and that target is far smaller than it sounds.

A bootable Windows drive is not one lucky pattern. It is a stack of requirements that all have to be right at once. You need a valid boot sector. You need a consistent Master File Table that indexes every file. You need a coherent file tree tens of gigabytes in size (Microsoft lists 64 GB as the minimum storage for Windows 11), program files whose internal headers parse, and driver signatures that verify. One wrong byte in the boot sector and you do not get slightly-worse Windows. You get a brick.

So imagine the number of valid bootable Windows drives were somehow a 1 with 10 billion zeros. That is an absurdly generous count. It is still a rounding error inside a space of a 1 with 2.4 trillion zeros. The odds are not long. They are, for every practical purpose, indistinguishable from zero.

So, Could Monkeys With Magnets Ever Produce Windows?

No. And the two reasons it fails turn out to be the same reason, which is the quietly beautiful part.

The probability argument says the target is too small to ever hit in the lifetime of the universe. The physics argument says a magnet cannot aim at the target anyway, and that the medium is specifically built to undo any random hit. Both come straight from statistical mechanics, the physics of how enormous numbers of tiny particles behave. And that is exactly the field Borel invented the monkeys to illustrate back in 1913.

His monkeys were never a claim that monkeys could write books. They were a ruler for "so improbable it will never be observed." He built it to show that the second law of thermodynamics, that same one-way flow of heat we met earlier, is for all practical purposes inevitable. The hard-drive version proves his original point better than the typewriter ever did. The reason the magnets fail, thermal fluctuations and overwhelming odds, is the very same statistical mechanics the metaphor was created to make you feel. The monkeys came home.

If you enjoy this particular flavor of "absurdly unlikely given infinite resources," you are in good company. There is the Boltzmann brain, a fully-formed mind that fluctuates into existence out of random noise. There is Maxwell's demon, the tiny sorter that would break thermodynamics if only it could exist. The monkeys keep excellent company. They just can't type.

References (click to expand)
  1. A numerical evaluation of the Finite Monkeys Theorem — Woodcock & Falletta, Franklin Open (2024)
  2. It would take longer than the life of the universe for a monkey to randomly type Shakespeare — University of Technology Sydney, via ScienceDaily
  3. Émile Borel and the Infinite Monkey Problem — MacTutor History of Mathematics, University of St Andrews
  4. Directed self-assembly of block copolymers for use in bit patterned media fabrication — Griffiths et al., J. Phys. D: Appl. Phys. 46, 503001 (2013)
  5. Perpendicular Magnetic Recording Technology (white paper) — Western Digital
  6. Ultrasensitive mechanical detection of magnetic moment using a commercial disk drive write head — Tao et al., Nature Communications 7:12714 (2016)
  7. Thermal effect limits in ultrahigh-density magnetic recording — Weller & Moser, IEEE Transactions on Magnetics 35(6), 4423 (1999)
  8. Master File Table — Microsoft Learn
  9. Windows 11 Specifications (minimum 64 GB storage) — Microsoft