< Previous: A Mile Wide and an Inch Deep Up: Site Index Next: The Devil Cannot Abide Mockery >
How Big is the Library of Babel?

One of my favorite short-story authors is the Argentinean writer Jorge Luis Borges. Many of his stories deal with mind-expanding themes, including "Blue Tigers", about a handful of stones that do not obey the rules of mathematics, "The Book of Sand", about a book with an infinite number of pages, and "The Aleph", a point in space that allows one to observe all other points simultaneously.

However, Borges' most iconic short story is the one called "The Library of Babel", less a narrative with a plot than an extended thought experiment, about a race of people who live in a cosmos that is bizarre indeed. The universe in which these people (Babelians?) live is a vast, apparently endless honeycomb of interlocking hexagon-shaped rooms, each one with two hallways that connect it to other rooms on the same level and a spiral staircase connecting it to rooms both above and below. Every room's walls are occupied by bookshelves that are full of books. Most of the books are complete nonsense, nothing but random combinations of letters, but a few contain tantalizing hints of sense.

One which my father saw in a hexagon on circuit fifteen ninety-four was made up of the letters MCV, perversely repeated from the first line to the last. Another (very much consulted in this area) is a mere labyrinth of letters, but the next-to-last page says Oh time thy pyramids.

As Borges' narrator explains, the people of the Library of Babel have finally discerned the nature of their world, based on two observations: first, that every book uses the same twenty-five symbols for letters and punctuation; second, that no traveler has ever come across two exactly identical books. These people have come to the realization that the Library contains all books - that is to say, not just all books that have been written, not just all books that ever will be written, but all possible books, every single permutation of letters of a specified length.

Life in the Library is both a blessing and a curse. The vast - overwhelmingly, crushingly vast - majority of these books are total gibberish; but buried among them, somewhere, there are - there must be - books containing every truth that anyone could ever want to know.

Everything: the minutely detailed history of the future, the archangels' autobiographies, the faithful catalogues of the Library, thousands and thousands of false catalogues, the demonstration of the fallacy of those catalogues, the demonstration of the fallacy of the true catalogue, the Gnostic gospel of Basilides, the commentary on that gospel, the commentary on the commentary on that gospel, the true story of your death, the translation of every book in all languages, the interpolations of every book in all books.

There must be books that tell the true history of the Library of Babel, and explain how such a fantastic cosmos came into existence. There must be books that contain the truth about the existence, nature, and attributes of God. There must be books that tell the true biography of every individual's life, perfectly foretelling their every action from birth to death, if only there was a way to find them; Borges' narrator refers to these books as the Vindications. Of course, because this library contains all possible books somewhere, every such work of perfection will be undetectably camouflaged among an immense number of sinister counterfeits - books that tell you your life story in perfect detail up to the age of thirty, say, but diverge radically thereafter.

Though it is obvious that the Library of Babel must be vast, I did not appreciate just how vast it is until reading Daniel Dennett's discussion of it in Darwin's Dangerous Idea. Consider: according to Borges' description, each book in the Library is 410 pages; each page is made up of 40 lines each consisting of 80 positions, and there are 25 possible alphabetic symbols that can fill any of these positions. This works out to 410 x 40 x 80 = 1,312,000 positions per book, each of which can be filled in 25 distinct ways: 25 x 25 x 25... and so on, 1,312,000 times. In other terms, the Library of Babel contains 25(410x40x80) = 251,312,000 books. This is a number compared to which the number of atoms in our universe is infinitesimal.

Since it is all but impossible to get a handle on the size of this number, let us consider something more manageable: the number of variants of just one book, say, War and Peace. (I do not know if this book actually has something like the 1,312,000 characters possessed by each book in the Library of Babel, but say for the sake of argument that it does.) In all the vast Library there is only one book that replicates it exactly as it was written by Tolstoy. But how many slight variants are there, versions that differ by just one character?

Again, there are 1,312,000 positions in the book, each one of which can differ from the canonical version in 24 ways (since the original character at that position can be replaced with any of the other characters). Thus there are 24 x 1,312,000 = 31,488,000 one-character variants. By the same logic, there are an incredible 991,493,388,288,000, or about 991 trillion, copies of this book that vary by just two characters (31,488,000 ways to vary one character, times 24 x 1,311,999 = 31,487,976 ways to vary a different character). The number of three-character variants is exponentially larger, and the number of four-character variants larger still; and then there are the versions that differ by five, by six, by seven... (Dennett points out that even a copy with several typos on each page would still be quite recognizable.) And none of this includes translations of the book into other languages, retellings of recognizably the same story in different words, abridged versions, summaries, versions with scrambled page order, versions with alternate endings, commentaries, commentaries on the commentaries, reviews, parodies, scholarly analyses, denunciations, deconstructions...

Just how big a number is this? The estimated volume of the observable universe is 1033 cubic light-years, or about 1087 cubic centimeters. Assume that the thickness of a sheet of paper is 0.1 mm, and that each sheet is of standard 8.5 x 11-inch dimensions (about 21.6 by 28 cm). Then the volume of a single book is 21.6 x 28 x (400 x 0.01) = about 2400 cubic centimeters. It would take 4.16 x 1083 such books to completely fill the volume of the observable universe. How many variants on War and Peace would this be?

Incredibly, all the books that were exact duplicates of War and Peace, save for a mere twelve or fewer single-character differences somewhere in the text, would more than fill the observable universe. (If you're not convinced of this, I've written a simple Java program that calculates the number of books in the Library of Babel that differ from a given book by X single-character changes. Download it here and check my math: BabelCalc.java). And the Library of Babel must contain these books, as well as all the other character variants, plus all the other relevant books mentioned above. The amount of space required to store all these near-duplicates - Tolstoy Space, let us call it - is, by many orders of magnitude, larger than the entire observable universe. And Tolstoy Space is just the infinitesimally small, vanishing fraction of Babel Space devoted to the variants of one book. Borges wrote that for every book in the Library there were "several hundred thousand imperfect facsimiles", but we can now appreciate just how much of an understatement that was.

March 14, 2006, 9:46 am • Posted in: The LibraryCommentOptions

Bookmark This:   Del.icio.us del.icio.us   Digg Digg   Reddit Reddit   StumbleUpon StumbleUpon  

24 Comments

Fun with infinities. There is a similar idea in our universe. If our universe is flat and infinite, then it has infinite matter. So take any probability, if it is finite, then it has occured an infinite number of times.

For example, what is the probability of an Earth-like planet developing similar to Earth? What is the odds it has life? Evolves humans? Has a history similar to Earth? Produces a human with DNA identical to me in an environment extremely close to me? Has a human that has a similar life history to me?

Whatever the probability.. say 1 in 10 to the trillionith power, it is finite and that means that there are infinite copies of me in the universe (if it is infinite).

Whatever the probability.. say 1 in 10 to the trillionith power, it is finite and that means that there are infinite copies of me in the universe (if it is infinite).

Hah, indeed. And another implication of this idea, even more bizarre: If the universe is infinite, there must be planets exactly like the Christian conceptions of Heaven and Hell. Not only that, there must also be planets exactly like the afterlife conceptions of every other religion that people have ever invented.

It's generally around this point that my brain starts to hurt from an overdose of philosophy and I have to go do something more useful to occupy myself. :)

Not really; just because the universe is infinite doesn't mean that every idea exists. I mean, heaven and hell are both, I think most of us agree, impossible; infinity doesn't allow the impossible anymore than a finite cosmos can (finity isn't a word, but what WOULD be the way to express that?)

Okay, you're right - anything that's forbidden by the laws of physics can't occur in our universe, no matter how large it is. I suppose it would be more accurate to say that if the universe is infinite, somewhere there must be planets very like the various religions' conceptions of the afterlife.

I think I came off harsh; sorry. But really, I would think that most planets would be very similar to earth, if they had life. I mean, the known elements in the universe are set; it would be unlikely that there is a different periodic table in the next galaxy. So, we know that conditions for life won't change much; they must be similar to earth. So yes, there should be an infinite number of human-like beings, but furthermore, there shouldn't be much life that's all that different from what we see on earth.

Actually, reflecting, most life in the universe should look simlar to what we have, or will look like that soon, or used to look like that; I suppose that an older planet, say 6 billion years, will definately have evolved forms of our creatures. Still, my point was that planet's like heaven and hell wouldn't really exist, not even remotely, because they wouldn't hold life. They'd BOTH be a form of hell, then.

I don't know if it is relevant, but the universe is not believed to be infinite. I think the theory is that it is expanding at the speed of light, and has been doing so for 15 billion years.
The theory of multible universes however, gives light to theories of unlimited possibilities: Even the ones that lie beyound our understanding of physics and causality etc.
Wonderfull stuff.

Erm, the universe can be infinite without containing every possibility. For example, one could have a universe containing an infinite amount of vaccuum. Indeed this is basically the nature of our universe, though there are some other things there too.

I play a game set in a fantasy multiverse. The multiverse contains many "planes", one "plane" being something like one of our 'universes'. Some of the "planes" consist entirely of fire, or water (with some life-forms in them), others are like our own universe, and so on. But the point is, just because a "plane" is infinite doesn't mean it contains every possible permutation.

While I question the applicability of Dungeons and Dragons cosmology to questions of physics, I would agree that a universe, in order to be "infinite," need merely have infinite spatial dimensions in some meaningful sense, rather than containing every possibility of...what? *blinks*

I think that if we are refering to spacial infinity we should then get out of the classic approach of newtonian and einsteinian physics (sorry english is my fourth lenguage) and see the idea from a superstring theory approach were all the physical posibilities can be represented given that there is enought time, a variable that becomes also infinite if you have infinite space.

Sure, they all can be represented. But they don't have to be, you could have infinite regions which contained merely one physical possibility, endlessly repeated. Unless that statement makes no sense in superstring theory, in which case I am out of my depth.

Oh come on, an infinite world cosmology simply has to contain every possible atomic structure combination: What is much more interresting is how we percieve it: Every combination of characters in a book can be read and deciphered in a thousand ways too, so every kind of data becomes more than douple 'useless' for the reader!
On the subject of infinite world, we have to remember the stuff about simulated worlds in simulated worlds..

But lets concentrate on The Library: I need some help by a mathematician to make some thesic calculations: I believe I have the theories required to make the calculations to make the calculations on where every book combination is placed from a Crimson Cubicle perspective: If the crimson book is made of a random pi based string of numbers, then we should be able to calculate where every combination is placed; That means that with some mathematical support we can make the thesic calculations on the billions of places that this text im writing is suituated within the theory of the library - and with enough calculating computerpower it should be possible to carry the calculations out.

write me a mail if you are interested in working with me
also if anyone has a point of view about the chaosmath possiblities in the library construction , mail me, please!
sorry my english is not very good

my mail is satansen(a)hotmail.com

In an infinite universe, the Library of Babel itself will occur somewhere (or the closest physically possible approximation to it).

This might be of interest in this context (plus some maths that might be relevant is given)

"Parallel Universes" by Max Tegmark

An infinite set is not necessarily an exhaustive set. For example, the set of even integers is infinite, but it contains only half (OK, not really half, but you get the point) of all possible integers, leaving out the odd ones....

Read "Infinity and the Mind" by the mathematician Rudy Rucker.....(his SF books are also mind-blowing...one of my favorite authors)....he makes exactly this point that an infinite universe is not inevitably an exhaustive one.

Also, infinite time does not guarantee every possible outcome must eventually occur.....does "infinite time" really mater when even the proton has a half life, and eventually decays.....

Latest evidence is that the Universe is expanding at an accelerating rate.....as matter and energy gets more and more diffuse, I would believe the probability of every permutation of matter occurring gets lower and lower, especially if the theorized a "big rip" happens......

It seems to me that you don't completely answer the question of how big the library itself is. What I wondered when I read this story was how many rooms it had, and what it would take to explore the whole library, or reach it's limit (although Borges says there is no limit, but what does he know? Has he explored the whole thing?). If my calculations are correct each room has 4 walls with 5 shelves each, and each shelf has 32 books, so 640 books per room.

My calculator won't let me divide 25^1,312,000 by 640, but perhaps we can estimate to 25*25, which 625 (some books were destroyed or tossed into the abyss if you recall, though probably not 15 per room). So 25^1,312,000/25^2 = 25^1,311,998. OK, that is a hell of a lot of rooms. Now lets assume that the library is a cube (though it is probably a sphere but that would be harder) - can we say that the dimensions of the library are 25^(1,311,998/3) or 25^437,333 on each side.

Well, now, that is not so big, is it? The sucky thing is that, say you wanted to reach the edge, you might start of only 10 rooms away, but you don't know what direction to walk, and you walk in the wrong direction! And you will never even know! Ah, life.

As I recall, Borges wrote that the Library is finite but unbounded. Like the surface of a sphere, it has no edge: if you travel in the same direction for long enough, you will eventually end up back at where you started.

Or else is a rectangle with periodic boundary conditions, giving it the topology of a torus (doughnut shape).

Well, yes the narrator said that he suspected that the library repeated after a while, but I don't think we can really know for sure. He was just one librarian, and we all develop a certain mythology/philosophy about the world we live in... sometimes wrong, no doubt.

"The sucky thing is that, say you wanted to reach the edge, you might start of only 10 rooms away, but you don't know what direction to walk, and you walk in the wrong direction! And you will never even know! Ah, life."

Your comment, and the story, remind me of the film Cube. A group of people find themselves stuck in a cube which has six doors, one on every side, that bring them into identical cube rooms. They eventually realize that there are coordinates for each cube, and that they are actually within a big machine that is moving and shifting the numerous cubes regularly, only briefly giving a chance for one door to lead outside of the maze. It's difficult to ever know how many cubes make up the entire maze, and actually figure out where one is within its structure as it moves.

Thank you so much for posting the link to the Babel short story. That was easily one of the best stories I have ever read. Any tips on links to his other stories, such as "Blue Tigers"?

Number of rooms in the library of Babel:

You can do this with logarithms:
There are 25^(1312000) books, if there are 640 in a room then the log of the number of rooms is:
1312000*log(25) - log(640) = 2624000*(0.699) - 2.806

which means there are about 1.563*10^1834173 rooms.

By the way, if each room is 1000 cubic meters, which seems reasonable, this gives us a volume of 1.563*10^1834170 cubic meters, which is something like a cube
10^611374 light-years on a side. This is 10^611356 times the radius of the observable universe. If you think its a long way to the drugstore . . .

It's big, folks.

The number of books in the library of Babel is finite, and has been calculated. But the number of possible (impossible?) subjects SEEMS to be infinite....a book on painting the hairs on Tunisian bees....a copy of the Bible with every other word being a swear word in Spanish....a book about drinking rabbit's blood while wearing pink boots.etc How long is the etc??? Surely I will never exhaust the list of titles I can concoct. I will I? Please help!!

Derek,

The answer to your dilemma is that the Library of Babel contains all possible books of a given, finite length. The total number of possible books is unlimited, but only because the potential length of a book is unlimited. That said, you can make any potential book, no matter how long, by binding together an appropriate number of volumes from the Library of Babel and treating the result as a single book.

Thanks for answering.....BUT....given that all the books in the library ARE of a FINITE length the number of possible subjects even in books of a finite length still SEEMS to be infinite. BUT, if the library contains ALL POSSIBLE books of a finite length then, by definition, EVERY imaginable book of a finite length must be there, mustn't it? For example, my example of "Speaking russian to widowed pink Tasmanian yaks on Tuesday mornings" MUST be there!! Am I missing something or is my logic faulty? The conflict in my mind is between the FACT that all possible books of a finite length MUST be present, but I think I can invent (write) books which are NOT there, as the number of possible subjects (even of a finite length) seems to be in finite. Am I crazy or just wrong?

If all books with at most some length are present, then the total number is finite. But in the absence of that restriction, then the total number is infinite. In fact, it is countably infinite or countable.

That will be the case even if one restricts the books' contents to syntactically and semantically correct language. That can be seen by constructing a subset of such books. The first contains "This is a sentence." The second contains "This is a sentence. This is a sentence." The third one contains three repetitions. Etc. It can be shown that the number of such books is countable. And since the set of linguistically-correct books is a superset of that set of books and a subset of books with all possible character combinations, it also has countable size.

Leave a comment

This comment form is a trap for spambots. If you can see it, don't use it. Use the comment form below.

Please uncheck this box before submitting your comment

Do not uncheck this box

Please uncheck this box before submitting your comment

Do not uncheck this box

Please note: First-time commenters are subject to moderation.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Comment preview:

Other options:

RECENT POSTS

MUST-READ POSTS (view all)

RECENT COMMENTS

SITE CATEGORIES (explanation)

ARCHIVES

BLOGROLL

PODCASTS

OTHER LINKS

THIS BLOG'S PARENT SITE

SEARCH THIS SITE

WHAT I'M READING

The Ancestor's Tale by Richard Dawkins

past books >

The Humanist Symposium
The Out Campaign

RSS 2.0 FEED

ABOUT THE AUTHOR

WHY "DAYLIGHT ATHEISM"?

FEEDBACK

Valid XHTML 1.0 Transitional Opera
Firefox

Powered by WordPress