The Library of Babel
Day 15 / 365
You must be familiar with the infinite monkey typewriter experiment. It goes something like this
Give a monkey a typewriter and infinite time and it will eventually come up with the complete work of Shakespear
To which the great Karl Pilkington hilariously commented — “have they read Shakespear?”
The aim of this experiment is to show the crazy nature of infinity. The monkey is there just to provide a stream of random letters. Given infinite time, every word, every sentence, every paragraph you can think of, would have to appear somewhere in the result!
Of course, we can’t practically try this in real life (although some people did). But in the age of extremely powerful computers, we can have the next best thing, computer programs (our digital monkeys) just spitting out random characters forever. The best part is this is already being done, through a project Library of Babel. And the results are amazing.
The origins of the library of Babel
The idea of this library comes from a short story written in 1941. In it, the author envisions a universe comprising of hexagonal columns with 4 bookshelves on 4 walls. The bookshelves are filled with books with random content, every possible permutation and combinations of a few characters (letters, comma, and space).
All though almost any book you pick up would be filled with pure gibberish, there are bound to be some that contain meaningful words, sentences or even whole pages. Every poem, every story you can imagine would be in one of the books. There will be a book with your name, with details of how you spend each day, until the day you die. You have a slim chance of finding that book though. But somewhere there would also be a book with the perfect index of all the other books!
The digital library of Babel
Jonathan Basile, inspired by the story, tried to use computers to create his own Library of Babel. You can access it right now just go to
This library, however, doesn’t have all the infinite number of books. It just has around 10⁴⁶⁷⁷ (that’s 1 followed by 4677 zeros) which is tiny compared to infinity, yet still large enough to give some interesting results.
The website allows you to search for any word or sentence (up to 3200 characters) and it would tell you if it that is already present in one of its books. I started small, I searched for just my name “Pranav Tiwari”. sure enough, it found it in one of its books
That’s not so amazing. So I tried something else. Some fact about me. Say which college I went to.
See that. Now that’s quite amazing. Somewhere in the all those books generated randomly lies a truth about my life! Don’t believe me? you can browse to the same book, the same page and you’ll find the same sentence.
Hell, even the beginning of this blog was already in the library
You should see for yourself really. Go to the website and try out searching for random stuff. Makes you really appreciate the size of infinity.
This story is part of my 365 Day Project for 2019. Read about it here