The Library of Babel

"The Library of Babel" (Spanish: La biblioteca de Babel) is a short story by Argentine author and librarian Jorge Luis Borges (1899–1986), conceiving of a universe in the form of a vast library containing all possible 410-page books of a certain format and character set.
The story was originally published in Spanish in Borges' 1941 collection of stories El jardín de senderos que se bifurcan (The Garden of Forking Paths). That entire book was, in turn, included within his much-reprinted Ficciones (1944). Two English-language translations appeared approximately simultaneously in 1962, one by James E. Irby in a diverse collection of Borges's works titled Labyrinths and the other by Anthony Kerrigan as part of a collaborative translation of the entirety of Ficciones.
Borges' narrator describes how his universe consists of an enormous expanse of adjacent hexagonal rooms. In each room, there is an opening in the floor to the hexagons above and below, four walls of bookshelves, and two junctions between hexagons each containing a latrine, a sleeping closet, and a stairwell. Though the order and content of the books are random and apparently completely meaningless, the inhabitants believe that the books contain every possible ordering of just 25 basic characters (22 letters, the period, the comma, and space). Though the vast majority of the books in this universe are pure gibberish, the laws of probability dictate that the library also must contain, somewhere, every coherent book ever written, or that might ever be written, and every possible permutation or slightly erroneous version of every one of those books. The narrator notes that the library must contain all useful information, including predictions of the future, biographies of any person, and translations of every book in all languages. Conversely, for many of the texts, some language could be devised that would make it readable with any of a vast number of different contents.
Despite these theories, all books are functionally totally useless to the reader, as any correct, legible text that can exist occurs due to pure chance and must exist alongside countless completely incorrect writings. This leads to many superstitions, cults, and heresies within the wider organized religion of the library; The "Purifiers" arbitrarily destroy books they deem nonsense as they scour through the library seeking the "Crimson Hexagon" and its illustrated, magical books. Others believe that since all books exist in the library, somewhere one of the books must be a perfect index of the library's contents; some even believe that a messianic figure known as the "Man of the Book" has read it, and they travel through the library seeking him. The narrator notes the population of the library has been gravely decimated by centuries of religious conflict and disease, but maintains his faith in the beauty and organization of the library as undeniable proof of a God or other demiurge, reaffirming his own attempts to find some ultimate meaning to the library and humanity's existence within it.
The story repeats the theme of Borges' 1939 essay "The Total Library" ("La Biblioteca Total"), which in turn acknowledges the earlier development of this theme by Kurd Lasswitz in his 1901 story "The Universal Library" ("Die Universalbibliothek"):
Many of Borges' signature motifs are featured in the story, including infinity, reality, cabalistic reasoning, and labyrinths. The concept of the library is often compared to Borel's dactylographic monkey theorem. There is no reference to monkeys or typewriters in "The Library of Babel", although Borges had mentioned that analogy in "The Total Library": "[A] half-dozen monkeys provided with typewriters would, in a few eternities, produce all the books in the British Museum." In this story, the closest equivalent is the line, "A blasphemous sect suggested [...] that all men should juggle letters and symbols until they constructed, by an improbable gift of chance, these canonical books." Borges makes an oblique reference to reproducing Shakespeare, as the only decipherable sentence in one of the books in the library, "O time thy pyramids", is surely taken from Shakespeare's Sonnet 123 which opens with the lines "No Time, thou shalt not boast that I do change, Thy pyramids...".
Borges would examine a similar idea in his 1976 story, "The Book of Sand", in which there is an infinite book (or book with an indefinite number of pages) rather than an infinite library. Moreover, the story's Book of Sand is said to be written in an unknown alphabet and its content is not obviously random. In The Library of Babel, Borges interpolates Italian mathematician Bonaventura Cavalieri's suggestion that any solid body could be conceptualized as the superimposition of an infinite number of planes.
The concept of the library is also overtly analogous to the view of the universe as a sphere having its center everywhere and its circumference nowhere. The mathematician and philosopher Blaise Pascal employed this metaphor, and in an earlier essay Borges noted that Pascal's manuscript called the sphere effroyable, or "frightful".
The quote at the beginning of the story, "By this art you may contemplate the variation of the twenty-three letters," is from Robert Burton's 1621 The Anatomy of Melancholy.
In mainstream theories of natural language syntax, every syntactically valid utterance can be extended to produce a new, longer one, because of recursion. However, the books in the Library of Babel are of bounded length ("each book is of four hundred and ten pages; each page, of forty lines, each line, of some eighty letters"), so the Library can only contain a finite number of distinct strings. Borges' narrator notes this fact, but believes that the Library is nevertheless infinite; he speculates that it repeats itself periodically, giving an eventual "order" to the "disorder" of the seemingly random arrangement of books. Mathematics professor William Goldbloom Bloch confirms the narrator's intuition, deducing in his popular mathematics book The Unimaginable Mathematics of Borges' Library of Babel that the library's structure necessarily has at least one room whose shelves are not full (because the number of books per room does not divide the total number of books evenly), and the rooms on each floor of the library must either be connected into a single Hamiltonian cycle, or possibly be disconnected into subsets that cannot reach each other.
W. V. O. Quine notes that the Library of Babel is finite, and that any text that does not fit in a single book can be reconstructed by finding a second book with the continuation. The size of the alphabet can be reduced by using Morse code even though it makes the books more verbose; the size of the books can also be reduced by splitting each into multiple volumes and discarding the duplicates. Writes Quine, "The ultimate absurdity is now staring us in the face: a universal library of two volumes, one containing a single dot and the other a dash. Persistent repetition and alternation of the two are sufficient, we well know, for spelling out any and every truth. The miracle of the finite but universal library is a mere inflation of the miracle of binary notation: everything worth saying, and everything else as well, can be said with two characters."
The full possible set of protein sequences (protein sequence space) has been compared to the Library of Babel. In the Library of Babel, finding any book that made sense was almost impossible due to the sheer number and lack of order. The same would be true of protein sequences if it were not for natural selection, which has picked out only protein sequences that make sense. Additionally, each protein sequence is surrounded by a set of neighbors (point mutants) that are likely to have at least some function. Daniel Dennett's 1995 book Darwin's Dangerous Idea includes an elaboration of the Library of Babel concept to imagine the set of all possible genetic sequences, which he calls the Library of Mendel, in order to illustrate the mathematics of genetic variation. Dennett uses this concept again later in the book to imagine all possible algorithms that can be included in his Toshiba computer, which he calls the Library of Toshiba. He describes the Library of Mendel and the Library of Toshiba as subsets within the Library of Babel.