Enjoy the game? Check out my upcoming game VSCS-II, which contains an 80s-style remake of Infinite Monkeys (link opens in new tab).

## How To Play

The goal of the game is to write the entire first scene of the first act of Shakespeare's King Lear, one random letter at a time. Monkeys will type letters at random until one hits the correct one, and each completed letter gets you \$1. Use the buttons on the top floor to hire more monkeys and motivate the existing ones to work faster by buying posters and banana trees. Toggle the music and sound effects by clicking on the radio.

I highly recommend giving the write-up below a read while you wait for your monkeys to progress.

## Infinite Monkeys on Infinite Typewriters

This game is based on the Infinite Monkey Theorem, which posits that a monkey on a typewriter, if given infinite time, would be able to write any complex piece of literature, such as Shakespeare's King Lear. In I̶n̶finite Monkeys, your monkeys will have to type the entire first scene of King Lear - the length of the text is part of the absurd premise; I don't actually expect you to complete it all.

Though I do some really basic statistics below, I avoided all the very technical stuff like the formal proof of the theorem. Because if you've been on pop-science YouTube, you'll know that even though it's better for proofs to treat the monkeys in this theorem like uniformly random string generators, it's much more fun to just calculate big numbers and talk about monkeys.

## Finite Monkeys?

While planning this game, I wanted to make the description and premise somewhat dorky. The initial concept was to simulate a "true" version of the monkeys-on-typewriters experiment, with multiple rounds of guessing, and I wrote some test code for doing so (knowing that it wouldn't end well). A monkey would guess random words of length N until it got the right one, then a round would start for N+1. So on round 1, if the word was "A", it guesses "K"... "B"... "G"... "G"... "A"... okay! Now guess "UE", then "JHW" and so on.

The problem? Runtime. When you get to N=5 and above, the simulation becomes very slow. If we equate what the monkey in this example is doing to something more realistic, like password-guessing, it becomes clear why. If a human were guessing a 5-character password, they'd be foolish to guess the word "BEANS" once, only to guess it again a little while later. They already know the password isn't "BEANS"!

Monkeys aren't so smart, because the idea behind the experiment is that their actions are (in an abstract sense) random, or rather, any previous action has no bearing on the next in any meaningful way. This means that the "monkey approach" to password cracking is much worse on average than a brute-force attempt.

So even for tiny guesses of five characters, the program would sometimes run for much longer than it should have, because every attempt is a purely random guess. I knew the complexity would blow up very quickly, but the degree to which it exploded was a surprise - primarily because of the random element. Similarly, in I̶n̶finite Monkeys, you may notice that there are occasionally long stretches of time where no correct letter is hit, even with fast typing speeds. Fully random guesses are, generally, bad guesses.

## King Lear, Act I, Scene I

Now let's use King Lear as a more specific example, because the numbers are big and that's just more fun. The first scene in the manuscript of King Lear used in this game is 14326 characters long (the entire play is 150746). All sections of whitespace are replaced with only a single basic space character, and all letters are treated as uppercase. The punctuation symbols {. , ' : ; ? -} are also included.

So, suppose we had a single monkey which would generate purely random strings of length 14326 over some period of time, at which point we'd compare it to King Lear and give the monkey a thumbs up or (much more likely) a big ol' thumbs down.

Given the previous discussion, you may guess that it would take a few attempts. This is the reason why the thought experiment proposes "infinite" of a few resources. It varies, but this usually includes infinite time, monkeys, typewriters, and presumably zookeepers (so the monkeys stay in their seats).

So, how many possible strings of length 14326 could any given monkey generate in one attempt? Well, if we confine the alphabet to what appears in the correct full text, each character in the random string can be one of 34 characters (26 letters, 1 space character, and 7 punctuation marks). Now, for each character in the string beyond the first, we multiply 34 by itself to get the total keyspace of the 14326 character string.

The number of possible strings the monkey could generate is a whopping 34^(14326). That's a decimal number that's 21940 decimal digits long . For more context, there are approximately 6 x 10^(79) atoms in the universe, which is still less than the number 34^(53). Now multiply that number by 34 again, then do that another 14272 times.

Out of all those possibilities, only a single one is the true first scene of King Lear. So it's probably fair to also assume that the monkey must be immortal for this whole operation to get off the ground; it's going to take them a while.

## A Practical Compromise

Now, back to the game, which is probably still running as we speak, because half of the joke is that it's annoyingly long. I think I've made a case for why it isn't just a single chimpanzee in an armchair yelling random letters until one is right... because you'd be here until the heat-death of the universe waiting for divinely-primate-generated Shakespeare, even just to get that first act.

Instead, there's an obvious solution that makes things a bit more tolerable: make the monkeys less Darwinist and more collectivist, by which I mean they work together, and mistakes are ignored. I mean, we were already checking the output against a copy of King Lear in the last hypothetical for correctness anyways, so is writing it a letter at a time really cheating?

The answer is "yes", but again: waiting until the end of the universe certainly can't be any more appealing. It's much more interesting to watch monkeys hit things.

PS: if you want to support my future projects, check out my current game in development: VSCS-II. Thanks!

 Status Released Platforms HTML5 Rating Rated 4.4 out of 5 stars(106 total ratings) Author Skullbutton Interactive Genre Educational, Simulation Made with Unity Tags Animals, Funny, Idle, Math, monkey, Pixel Art, random, sitting-simulator

Infinite Monkey Type Beat.wav 11 MB

## Development log

Viewing most recent comments 1 to 40 of 73 · Next page · Last page

they should add something to do while you wai

at 10:50, is that a referance to this game?

It's literally just a reference to this:https://en.wikipedia.org/wiki/Infinite_monkey_theorem

Kind of like how this game is also a reference to that...

seriusly!?! no fkn way :o

(1 edit)

when I download and open the game it runs in media player, what can i do? or is the download only for the music and you have to play on the browser?

you should expand the game i got all the monkeys and upgrades to quick now i can only wait for them to finish :(

ME ENCANTÓ!!!

Seria legal se vc fizesse um projeto chamado "O macaco infinito", que seria um projeto onde vc faz literalmente esse jogo, mas as pessoas podem colocar o texto que elas quisessem no jogo, caso baixassem, assim as pessoas poderiam jogar com amigos e familiares, ou até mesmo criar conteúdo com sua comunidade, com textos que fazem sentido pra eles, não só o capítulo 1 desse livro.

I checked the Game in Development, nice touch adding the reference to this game!

Welp, going on ~3 hours and we've got 5%.

monkey smash

I did it

(2 edits) (+1)

This is some serious monkey business

10/10 great game

Dang you! I made a game with a similar concept, and I'm hoping that my teacher doesn't look up "infinite monkey game" because you did it SO much better. If you see this Prof. Bierman, I swear I found this after making my project.

Great game, I got to like 50% and left it for the night only to discover the next day that it doesn't save your progress.

Bunch of these comments are just people skipping the whole description saying that the game being slow as dirt is literally the joke.

I dislike how their is a max speed cap. gib infinite plants pls

quit at 10 percent, took to long. remove the MAX! thing for plants and posters please.

Quitting at 10% is valid, and as long as you've read the game description, I think you got the full experience. The absurd length of the game is very much intentional.

mnketypn

you should add something that shows stats, like what the speed they are typing at, and how many correct letters each monkey has got, and so on

(1 edit)

lol my monkey spelled n i g b a.

close one.

there should one hundred percent be a banana break option which lets you have a monkey rest for a couple seconds to eat bananas and it gives them +1% speed for every minute on banana break. I just want monke to eat banan.

(1 edit) (+1)

monke

computer unexpectedly restarted when I was finally halfway through, it took days to get there. why.

(1 edit) (+1)

Fun game but I feel like the limit on posters and plants makes it needlessly slow. If you could get more upgrades you could finish the game way faster.

Like, I "finished" the game (bought all upgrades) in like 20 or 30 minutes, but then there's just hours of waiting?

(4 edits) (+1)

finally got to 1%

EDIT: everything is max and it's at 5%

EDIT2: it's been 2 hours and it's at 15%

Deleted 183 days ago

The game is just played with the mouse; moving it around, left clicking, the whole shebang! The items on the top floor are your upgrade buttons. It's an idle game so the monkeys just kinda do their own thing. And by "own thing" I mean "generate surplus value for the bourgeoisie" (that's you!).

Hope this helps!

Passing the time.

Clicked on someone's name.

Had to go back onto the page.

Lost all of my progress.

I am in physical PAIN.

5. school. days.

What a quirky and fun concept

(2 edits) (+2)(-1)

What a nice game, boring as hell so I ran 6 monkey factory at the same time. 130 minutes and they are done

Here's the screenshot that I finished this

Also there was no randomness and they all finished the same time I ran them

lemme guess, school computer account?

great game on my tv took some time to make money because since there was no keyboard connected and mouse.

you should add endgame dlc (King Lear, Act I, Scene II)

Hmm. Monke.

anyway to make it full screen?

What a banging soundtrack, I´ve been listening to it for the past 2 hours

(1 edit) (+19)

i did this with one monkey (andy) and it took him 80.5 hours

Wishing Andy a healthy recovery from his carpal tunnel <3

I just love how frenetik the monkeys get at the end. THEY F*CKING LOVE TYPING SHAKESPEAR

Monke be like:

- I f*ckin love these clicketi-clacketing tap machines!!!

Didn't realize until I started looking at the comments how old this game was.  I just discovered it, though, and lucky me!  It was certainly amusing, and I liked the Donkey Kong beat!  Not sure how long it took me, but I did complete it.  Kind of funny how while it wasn't your intention that people would actually finish it, people sure seem intent on doing so.  Maybe you should have a version that does the whole text of King Lear :)

ok so, wierd question

can you make an alternative version where you can coppy paste a pice of your own text that the monkeys have to type?

i like that idea.

Skullbutton make this happen

Ups, had it running in the background

What a way to tell everyone you know what happened in King Lear act I scene I

Viewing most recent comments 1 to 40 of 73 · Next page · Last page