If you peruse the internet long enough, you might be fortunate enough to stumble across a particularly interesting experiment called the Library of Babel. It’s the pet project of one Jonathan Basile, who was driven to experiment and create his enigmatic library “by an interest in literature and iterability.” The website at which the library can be found is stark and monochromatic, so unassuming in its design. Browsing the library reveals that it’s organized into digital hexagons, with four of their six walls occupied by bookshelves. Clicking on a wall zooms in on its bookshelves, and clicking on a bookshelf zooms in on its books. Here is where one may click on a book to open it.
This is where a curious thing is discovered: the books are gibberish.
Certainly this begs the question of who would construct a library whose books are completely gibberish. As it turns out, Basile’s digital library is inspired by a fictional library of the same name, which was featured in the short story “The Library of Babel” by Jorge Louis Borges. Originally published in 1941, the story describes a universe-spanning library whose books, much like the digital counterpart, are seemingly gibberish. However, it is discovered by chance by the humans who inhabit the library that the reason most books appear to be gibberish is because the library, in fact, contains all possible books. Its collection is complete, its books representing every possible combination of a set of symbols.
Admittedly, Basile’s digital counterpart to this universal library isn’t necessarily the same as its fictional predecessor. Rather than containing every possibly book within its library, it instead contains every possible page. As a result, it’s of significantly smaller size than the library originally discussed by Borges. That doesn’t mean Basile’s library is small by any means: in fact, Basile reports that his library contains over 10^5076 books. Despite this, Basile succeeds in creating a library of that magnitude by avoiding storing the books in a digital format. Instead of storing each book individually, Basile’s library makes use of an algorithm to generate every book upon request. This algorithm doesn’t generate the books randomly, either; using a code to represent the name of every hex, as well as including the number for the wall in the hex, the number for the shelf on that wall, and the number of the book on that shelf, the algorithm uses all of this to generate the text of the book. The algorithm is also able to generate this hex name, wall number, shelf number, and book number based on the text of the book. As such, all books in his library can exist and be called up without having to be stored, and a book you discover can forever be found in the same location.
Basile had plans to build up from this concept. His hope was to release a downloadable iteration of the library — for free — which would expand the library’s collection to contain all possible books rather than all possible pages. Unfortunately, that project has been indefinitely put on hold, so in order to consider the full ramifications of the universal library, we must look away from Basile’s amazing feat and look back towards Borges’ concept.
In “The Library of Babel,” Borges informs us of that universal library which humans have forever inhabited. The library is constructed out of hexagonal rooms, with four of the six walls occupied by five shelves each that go from the floor to the ceiling of the room. Each shelf holds thirty-two volumes, all identical in format. A mere five centuries prior to the time of the story’s narrator, it was discovered that the library is total in that it contains all possible books, by every book representing just one possible way in which to combine the various symbols employed by the volumes. This realization was at once great and terrible: on the one hand, it was a great blessing, as humans were there to be the possessors of such an incredible collection of books; on the other hand, because of the vastness of the collection, no human would ever find a coherent book in their entire lifetime, as if making the collection completely worthless. This leads to a great depression, even driving many into violent and cult-like behavior in search of books that, by the laws of the library, cannot possibly exist.
One of the questions raised by the librarians of that story is whether or not the library is infinite. Some argue it unimaginable that the countless hexagons and endless stairways could ever come to a complete and total termination. Others argue it unthinkable that the library could be infinite if the collection of books, by the vary nature of mathematics, must inevitably be finite. It is only the librarian narrating the tale that declares that the library may be infinite despite a finite collection, and he postulates that the collection itself may, at distances far out of reach of mankind, be found to repeat itself.
Another question posed by the librarians is the nature of the volumes which hold text that appears to be total gibberish. It is suggested by some that these long lines of random combinations of symbols may not be gibberish at all, but in fact may be dialogue from entirely unknown languages. Even familiar languages are called into question, as some argue that the combination of letters forming “library” may come to represent a word that means something in one language while meaning something completely different in another. This speaks to the nature of the library and its volumes, given that the library is nothing more than a total collection of all of the possible combinations of the twenty-five permitted characters.
The nature of such a thing is not unlike the nature of the characteristica universalis, a universal and formal language conceptualized by German polymath Gottfried Leibniz. Using pictograms, Leibniz sought to create a language that could be used for all things conversational, mathematical, and scientific. It would have worked by way of diagrams that employed these pictograms, using various combinations of them to deliver different ideas. A popular example is the diagram used as a frontispiece in his 1666 De Arte Combinatoria (On the Art of Combinations), which represents the Aristotelian theory of how all material things are formed from combinations of four base elements.
Indeed, analyzing the mathematics behind Borges’ fictional library reveals some interesting insights. I won’t go into the mathematics here, since it isn’t entirely essential to the point I hope to make with this essay. However, to show the actual mathematics involved, I have provided a second post today which you can find here, detailing all of the mathematics of this essay in order of relevance (these will be referenced in this essay as a series of appendixes). Suffice to say, based on information provided in Borges’ story and the field of mathematical study known as Combinatorics, we can deduce the number of books in the library to be no less than 25^1312000. (See Appendix I: The Number of Books)
There are two major ramifications to this revelation. First, this is why the likelihood of a human ever encountering a coherent book within their lifetime is so infinitesimally small. If you were searching for a perfect copy of Bram Stoker’s Dracula, the odds of finding that book would be 25^1312000:1. In other words, the odds of finding this perfect copy are so small that they are the equivalent of a zero percent chance. Second, a collection of such a magnitude would be impossible to fit within our own universe. (See Appendix II: The Size of the Collection)
In addition, the library serves as a great template for a thought experiment regarding multiverse theory. Imagine for a moment that the library represents the multiverse, a perfect and complete ensemble of every possible reality that could ever exist. Given what we’ve observed about the library, we know that there exists a perfect copy of a biography describing one’s perfect life, so let us assume that this one book represents the universe in which you live a perfect life free from even the slightest problem. Imagine now that this one book is hidden among all the copies of that same book which feature but a single misprinted character in their entire volumes. This misprinted character represents a single thing going wrong at some point in your life. Now imagine — in addition to the volumes that contain a single misprinted character — that your single perfect copy is hidden among all of the volumes that contain two misprinted character. Now add the volumes that have three misprinted characters. Now add the ones with four. Now add all the ones all the way up to sixteen misprinted characters. The number of volumes you’d be forced to sift through to locate the single perfect copy grows exponentially. (See Appendix III: Misprints)
What can we learn from this? We already knew that locating a single specific book among the entire collection within the library is a mathematical impossibility. After all, the odds of locating that book are 25^1312000:1. However, if we focus on only the books that involve your life in some way, we still find that the number of books in the collection is so massive that locating a perfect copy among the misprints is, once again, a mathematical impossibility. What this means for us is that the odds of us living a perfect life are statistically impossible. In fact, the numbers show that we are exponentially more likely to live a miserable life as opposed to an acceptable one, or even a great one.
Why do I bring up such a depressing notion? Well, I bring it up because when we compare the size of the collection of books pertaining to your life — even the biographies that don’t describe your perfect life, along with all of their own misprinted copies — to the size of the library’s collection as a whole, we find that even that massive collection of books about your life is infinitesimally small compared to the library’s total collection. Just as our odds of finding a perfect copy of a perfect life’s autobiography were so small they were calculated as a zero percent chance, we also find that locating any book pertaining to our life in the library’s entire collection to be a mathematical impossibility. The math isn’t just arguing that having a perfect life has a zero percent chance of probability; it’s arguing that us even existing is just as unlikely.
So consider for a moment that despite all of the math being against you, you exist. Despite all the odds, you’ve probably even had at least one or two happy moments in your life. Despite all of the possibilities, you’re here — a mathematical anomaly if there ever was one.
“But Marcus,” you say, “the library is so massive, and the multiverse probably isn’t nearly as big.”
You’re right. The multiverse actually dwarfs the library. (See Appendix IV: Sizable Collections)
If you’re interested in seeing the library for yourself, I strongly encourage you to check out Jonathan Basile’s outstanding creation. You’ll also find the discoveries made by other people if you check out the website’s forums. If you’re interested in the mathematics involved in the story, you can check out my companion post to this essay or, if you want to dig deeper than that, you can check out William Goldbloom Bloch’s fantastic book The Unimaginable Mathematics of Borges’ Library of Babel.