← BACK TO CONTENTS THE LITERARY MACHINE CHAPTERSEPUBPDF

PART IV · THE FUTURE OF THE WORD / CHAPTER 15 OF 16

Information, Randomness and the Search for Meaning · ~26 min read

Download chapter Markdown ↓

The Infinite Library

Information, Randomness and the Search for Meaning

1. The Book That Contained Your Life

The librarian had spent forty years searching for a particular book.

She did not know its title.

She did not know its author.

She knew only that somewhere among the endless shelves there must be a volume describing her entire life.

It would contain the date of her birth, the names of her parents and the precise words of every conversation she had ever held.

It would record her mistakes, her disappointments and the circumstances of her eventual death.

Everything would be written down.

But finding the book was almost impossible.

The library contained too many volumes.

Most consisted of apparently meaningless arrangements of letters.

Some contained fragments of recognisable language.

Others described events that had never happened.

There were books claiming that the librarian had been born in another country, books declaring that she had died as a child and books recording convincing versions of events that were entirely false.

A volume containing the truth might stand beside a volume differing from it by only one letter.

Another might offer a perfect explanation of the library itself.

But without some independent way of identifying it, that explanation would be indistinguishable from countless fabrications.

One evening, the librarian discovered a book containing a recognisable sentence.

It described her childhood home.

The street was correct.

The colour of the front door was correct.

Even the name of the family dog was correct.

She turned the page.

The next sentence claimed that her father had murdered the king.

There had never been a king.

She closed the book.

For the first time, she wondered whether discovering a true sentence was any use at all.

This scene is an original fictional illustration, but it draws upon one of the most extraordinary imagined libraries in literature.

In 1941, the Argentine writer Jorge Luis Borges published La biblioteca de Babel, known in English as The Library of Babel.

The story depicts a universe organised as a vast system of interconnected hexagonal chambers containing books assembled from a restricted alphabet.

Its inhabitants believe that the library contains every possible arrangement of its permitted symbols.

If so, it contains every book that could be written using those symbols and the specified format.

It contains truths.

It contains falsehoods.

It contains magnificent literature.

It contains complete nonsense.

And it contains countless near-misses: volumes that appear meaningful but contain some tiny corruption.

The original story appeared in Borges's 1941 collection El jardín de senderos que se bifurcan and was later included in Ficciones in 1944. The Argentine National Library’s indexed bibliography identifies the 1941 publication; its full PDF exceeded the retrieval limit during this review.

Borges's idea is not merely a fantasy about a very large library.

It is an investigation into information, possibility, interpretation and the difficulty of discovering truth.

It also anticipates a problem that has become central to our digital world.

When information becomes almost unlimited, the difficult task is no longer producing or storing it. The difficult task is finding what matters.

Book stacks at Weltevreden Park Library, South Africa.

Book stacks at Weltevreden Park Library, South Africa. Credit: Gwyneth Perry. Source. [CC0](http://creativecommons.org/publicdomain/zero/1.0/deed.en). Resized; no crop.

2. Borges and the Architecture of Everything

The Library of Babel is constructed according to an elaborate fictional scheme.

Its chambers are hexagonal.

Bookshelves occupy the walls.

Corridors connect one chamber to another.

The books share a prescribed physical format.

Each volume contains 410 pages.

Each page contains 40 lines.

Each line contains approximately 80 characters.

The library's writing system contains 25 orthographic symbols.

These details are important because they transform the library from a vague image of infinity into something mathematically describable.

The books are not arbitrary objects of different lengths.

They follow common structural rules.

The variations occur within their contents.

A finite alphabet

Imagine an alphabet containing only three symbols:

A, B and C.

Using these symbols, we can construct several different strings.

With one position, there are three possibilities:

A, B, C.

With two positions, there are nine possibilities:

AA, AB, AC, BA, BB, BC, CA, CB, CC.

With three positions, there are:

3^3=27

possibilities.

Every additional position multiplies the number of possible strings by three.

The same mathematical principle applies to Borges's library.

But Borges uses a much larger alphabet and books containing more than a million character positions.

The result becomes unimaginably large.

The library's completeness

If every possible arrangement of the permitted symbols appears somewhere, then any text that fits the library's format is present.

This includes a correct description of a particular event.

But it also includes every incorrect description that can be expressed using the same symbols.

For example, suppose a book contains:

The king died on Tuesday.

The library also contains versions in which the king died on Wednesday, Thursday or Friday, assuming those strings can be expressed within its format.

It contains versions in which the king never existed.

It contains versions in which the sentence is followed by a contradiction.

The library's completeness therefore provides no guarantee of truth.

In fact, completeness creates an enormous burden.

For every useful statement, there may be an overwhelming number of misleading alternatives.

The reader faces a problem of identification rather than production.

A mathematical rather than physical infinity

There is a subtle distinction in Borges's construction.

The total number of possible books of a fixed length over a finite alphabet is finite.

However, the number is so enormous that it is effectively beyond human enumeration.

Borges also entertains an unlimited, repeating library in which volumes may recur.

An unlimited arrangement of shelves need not contain infinitely many distinct books.

The same finite collection of possible volumes could repeat without end.

This is a distinction between the size of a space and the size of the collection of distinct contents within it.

The library's corridors may continue indefinitely.

Its catalogue of unique fixed-format books remains mathematically finite.

The distinction matters because the work derives much of its force from the contrast between finite rules and incomprehensible consequences.

Four positions each choose A, B or C. ABBA maps to ternary digits 0, 1, 1, 0 and index 12.

3. How Many Books Can a Library Contain?

Let us calculate the size of Borges's imagined collection.

Using the story's stated book format:

410 × 40 × 80=1,312,000

Each book contains approximately 1,312,000 character positions.

There are 25 possible symbols for each position.

Therefore, the number of possible books is:

N=25^1,312,000

This number is extraordinary.

Writing it in ordinary decimal notation would require more than 1.8 million digits.

We can understand its approximate size using logarithms.

log₁₀N=1,312,000log₁₀(25)

Since:

log₁₀(25) ≈ 1.39794

we obtain:

log₁₀N ≈ 1,834,097

So the library contains on the order of:

10^1,834,097

different fixed-length books.

This is not a count of meaningful books.

It is a count of possible symbol sequences.

Every arrangement receives a place in the mathematical space, regardless of whether anyone could interpret it.

Why this is different from Queneau

In Chapter Nine, we studied Raymond Queneau's Cent mille milliards de poèmes.

Queneau's book provides ten alternatives for each of fourteen poetic lines.

It contains:

10^14

possible sonnets.

That is an enormous number, but the components are carefully authored.

The alternatives are designed to preserve poetic form and compatibility.

Borges's library follows a far less selective principle.

Its symbols may occur in any permitted order.

There is no requirement that they form words.

No requirement that words form sentences.

No requirement that sentences make sense.

The resulting space is incomparably larger, but it is also overwhelmingly filled with arrangements that offer no obvious literary value.

This reveals an important distinction.

A system can increase its output possibilities by relaxing constraints.

But that expansion may reduce the proportion of outputs that readers find meaningful.

More possible texts does not necessarily mean more worthwhile texts.

What the calculation does not tell us

The formula counts different strings.

It does not count true statements.

It does not count beautiful poems.

It does not count coherent novels.

It cannot tell us how many books contain the biography of a particular person.

Those questions require additional definitions and methods of evaluation.

Mathematics can describe the full space of possible texts without telling us which members deserve attention.

That is the central difficulty of the infinite library.

4. The Search for One True Sentence

Imagine that a librarian is searching for the following sentence:

The bridge will collapse at midnight.

In Borges's library, the sentence may appear in some books, along with countless variations.

Perhaps a book predicts a real future collapse.

Another describes an event that will never occur.

A third contains the correct statement but attributes it to the wrong bridge.

A fourth provides accurate information on one page and fabricated information on every other page.

How could the librarian distinguish them?

The answer cannot simply be to find a volume containing the desired words.

The words are not sufficient evidence.

Existence is not verification

Suppose a search system finds a book claiming:

The missing ship sank near the northern coast.

That claim might be true.

But its presence in the library gives us no reason to believe it.

The library contains incompatible claims about the same ship.

To determine the truth, we would need evidence independent of the search result.

Perhaps there are navigational records, eyewitness accounts or physical remains.

The library supplies possible descriptions.

It does not identify which description corresponds to reality.

This is a profound distinction between retrieval and verification.

Retrieval asks whether a piece of information can be found.

Verification asks whether it is supported by reliable evidence.

The two activities are related, but they are not identical.

The problem of false precision

A particularly dangerous book might contain extremely detailed information.

It could identify dates, measurements, names and places.

Its precision might make it appear authoritative.

But mathematical completeness guarantees that false precise accounts also exist.

A detailed falsehood is not automatically more credible than a vague one.

This problem extends beyond Borges's fiction.

Modern information systems can produce or retrieve large quantities of apparently precise material.

But the ability to provide a fluent explanation or an exact date does not guarantee accuracy.

The reader still needs reliable sources and sound methods of evaluation.

The librarian's predicament

The inhabitants of Borges's library search for books that might reveal profound truths.

Some seek explanations of the library.

Others seek predictions or justifications.

But the library's abundance makes reliable discovery extraordinarily difficult.

This gives the story a tragic dimension.

Everything may be written somewhere.

Yet the inhabitants remain ignorant.

Their problem is not a shortage of possible answers.

It is the absence of a reliable method for distinguishing correct answers from incorrect ones.

The infinite library is therefore also a story about the limits of information abundance.

5. Claude Shannon and the Mathematics of Uncertainty

Borges published The Library of Babel in 1941.

Seven years later, Claude Shannon published A Mathematical Theory of Communication.

Shannon's work appeared in two parts in The Bell System Technical Journal in July and October 1948.

It established the foundation of modern information theory.

Shannon was not trying to solve Borges's fictional library.

His problem was an engineering one.

How can information be represented and transmitted reliably through communication systems?

The mathematical relationship is nevertheless striking.

Both Borges and Shannon were concerned with messages selected from spaces of possible arrangements.

But their objectives differed.

Borges investigated the philosophical and literary consequences of textual possibility.

Shannon investigated the mathematics of communication, uncertainty and coding.

Information without meaning

Shannon's central move was to separate the technical problem of communication from the semantic interpretation of a message.

A communication system must be able to transmit a selected message.

It need not understand what that message means.

Consider two possible transmissions:

HELP

XQZT

The first is recognisable English.

The second appears meaningless.

But a communication channel can transmit either as a sequence of encoded symbols.

The engineering problem concerns preserving the intended sequence despite possible noise and errors.

Its success does not require the channel to understand the words.

A telephone network can carry a philosophical argument.

It can also carry nonsense.

The network's task is to communicate signals according to its technical requirements.

The meaning is supplied by the people and contexts involved.

The significance for literature

Borges imagines a library containing every possible book.

Shannon provides mathematical tools for analysing the uncertainty associated with possible messages.

Together, the two ideas reveal something important.

Text can be studied at more than one level.

At one level, it is a sequence of symbols.

At another, it has statistical properties.

At another, it may express meaningful statements.

And at another, those statements may be true, false, beautiful, offensive, moving or absurd.

No single measure captures all these properties.

Information theory is extraordinarily powerful.

But it does not replace literary interpretation.

6. Why Randomness Is Not Meaning

Imagine two machines.

The first always prints:

AAAAAAAA

The second selects each character independently from an alphabet containing eight equally likely symbols.

The first machine's output is perfectly predictable.

The second machine's output varies.

In Shannon's mathematical framework, the second source has greater entropy.

For a source with n equally likely symbols, the entropy per symbol is:

H=log₂(n)

For eight equally likely symbols:

H=log₂(8)=3 bits

The first machine, always producing A, has zero entropy per symbol.

But which message is more meaningful?

We cannot tell from those entropy values.

Perhaps AAAAAAAA is a recognised distress signal.

Perhaps the random characters are meaningless.

Or perhaps the apparently random characters are encrypted instructions.

The statistical uncertainty does not settle the semantic interpretation.

Information and surprise

An unlikely outcome can carry more information in Shannon's technical sense than a likely outcome.

Suppose a source emits A with probability 0.9 and B with probability 0.1.

Receiving B is more surprising.

Its information content is:

I(B)=-log₂(0.1) ≈ 3.322 bits

Receiving A conveys:

I(A)=-log₂(0.9) ≈ 0.152 bits

These measurements concern the surprise associated with particular outcomes under an assumed probability distribution.

They do not establish that B is more emotionally moving than A.

Nor do they prove that the symbol B conveys some deeper message.

This is a technical distinction, not a judgement about literary merit.

The danger of confusing novelty with creativity

A text generator can produce bizarre combinations.

Some may be surprising because the words rarely appear together.

Consider:

The violet staircase remembered tomorrow.

This original sentence is unusual.

It might be interpreted as surreal poetry.

But unusual combinations are not automatically valuable.

Compare:

The mother kept the child's shoes beside the door.

The second sentence is less linguistically surprising.

Yet within a story about loss, it could be devastating.

Its significance depends upon context.

Literature is not simply a competition to maximise statistical unpredictability.

A powerful sentence can be familiar.

A meaningless sentence can be unique.

The difficulty is understanding how arrangement, context and experience produce significance.

7. The Problem of the Perfect Search Engine

Suppose someone builds a search engine for Borges's library.

You enter a sentence.

The system identifies where that exact sentence appears.

You can retrieve it immediately.

Has the central problem been solved?

Not necessarily.

The search engine has made finding a known sequence easier.

But it has not established whether the sequence is true, original or valuable.

Searching for what you already know

If you enter the entire text of a particular poem, a sufficiently complete mathematical library contains that poem.

The search system may return it.

But you had to supply the poem in order to search for it.

The retrieval may demonstrate the system's completeness without providing new knowledge.

This distinction is easy to overlook.

A search engine that can locate any supplied string is not the same as a system that can discover which strings are worth reading.

Searching for what you do not know

Now imagine asking:

Find the greatest poem about loneliness.

What does greatest mean?

The poem with the most original imagery?

The strongest emotional effect?

The most admired historical reputation?

The most precise depiction of a particular experience?

Different readers may disagree.

Even if the library contains every possible poem, finding the greatest one requires criteria for evaluation.

A search engine cannot derive those criteria merely from the fact that all texts exist.

It needs additional information about readers, values, interpretations and perhaps cultural history.

The problem moves from generation to judgement.

Search can become creation

There is also a subtle paradox.

Suppose the search system takes an original poem supplied by a user and calculates an address where it can be found in a mathematically defined library.

The system may not store that poem in any physical volume.

Instead, it may use a mathematical mapping between addresses and strings.

The result can look like a discovery.

But the user provided the text, and the system computed a location corresponding to it.

That is not equivalent to discovering an independently existing masterpiece through literary criticism.

Computational demonstrations inspired by Borges can use such techniques.

They are intellectually interesting.

But their underlying mathematics should not be confused with a literal warehouse containing all possible physical books.

The distinction between representing a possibility and materially storing it matters.

8. Compression: Finding Patterns in the Library

There is another way to investigate Borges's enormous collection.

Instead of asking which texts exist, we can ask how efficiently particular texts can be described.

Consider:

AAAAAAAAAAAAAAAA

This sequence contains sixteen characters.

But it can be described compactly:

Print A sixteen times.

Now consider:

QZMRBTXKPLWJNVHA

This sequence is also sixteen characters long.

It does not have an obvious short repeating pattern.

One sequence appears easier to compress than the other.

What compression reveals

Compression techniques exploit regularities.

If a text contains repeated patterns, an encoding system may represent those patterns using fewer bits.

For example, a long passage containing the same phrase repeatedly may be more compressible than a similarly sized passage with little repetition.

Natural language contains substantial redundancy.

Common words recur.

Grammatical patterns constrain which sequences are likely.

Certain letters often follow others.

A compression algorithm can exploit such regularities without understanding the text's meaning.

This connects directly to Shannon's work.

Information theory helps describe the relationships among uncertainty, statistical structure and efficient coding.

Algorithmic information

A related but distinct idea appears in algorithmic information theory.

One central concept is Kolmogorov complexity, associated with work by Andrey Kolmogorov and independently developed related approaches by Ray Solomonoff and Gregory Chaitin during the 1960s.

Informally, the Kolmogorov complexity of a string is the length of the shortest program capable of producing it on a specified universal computing system.

The important qualification is that the answer depends upon the chosen description language or universal machine up to a bounded additive constant.

For finite strings, exact Kolmogorov complexity is generally not computable.

It should not be mistaken for an ordinary compression score that software can always calculate precisely.

The literary problem remains

A highly regular text may be easy to describe.

A random-looking text may be difficult to compress.

But compressibility is not identical to meaning.

A deeply significant sentence may be short and predictable.

A random character sequence may be incompressible while communicating nothing useful to a reader.

A novel may contain repeated motifs that increase its literary force while making some patterns statistically predictable.

Again, mathematics describes one property of the text.

It does not exhaust its significance.

9. The Library That Could Not Be Printed

How could Borges's library exist physically?

Even if we ignored the size and weight of the books, the number of possible volumes is beyond any realistic storage capacity.

The collection is not merely larger than existing libraries.

Its size exceeds ordinary physical imagination.

But the mathematics permits a different approach.

We could write a program that generates symbol sequences.

For a finite alphabet and fixed text length, the program could enumerate every possible arrangement in principle.

The procedure would be simple.

Its execution would be hopelessly impractical at Borges's scale.

The distinction between specification and execution

Imagine a program containing the instruction:

Generate every string of one million characters using an alphabet of twenty-five symbols.

The instruction can be expressed concisely.

But executing it completely would require an extraordinary number of operations.

The program specifies a mathematical space without needing to produce every member immediately.

This is a recurring feature of computation.

A short description can define an enormous collection of possibilities.

Queneau demonstrated this with sonnets.

A software generator can demonstrate it with character strings.

Borges's library extends the principle to an almost unimaginable scale.

The virtual library

A computer can use an address to determine a particular sequence.

Instead of storing every possible text, it can calculate the text corresponding to a selected address.

This is conceptually similar to using a number to identify a position in an ordered enumeration.

The complete library exists as a mathematical definition.

Individual books can be generated when requested.

That does not mean the physical computer contains all the books simultaneously.

It means the program can represent the rules governing the collection.

The distinction is essential to understanding how digital systems can describe spaces far larger than their storage capacity.

10. The Difference Between Generating and Knowing

We have now encountered three different activities.

A generator produces possible texts.

A search system identifies texts satisfying specified criteria.

An evaluator determines whether particular texts are accurate, meaningful or valuable.

These activities can be combined, but they should not be confused.

Generating a historical claim

Imagine a system that produces:

The first submarine crossed the Atlantic in 1692.

The sentence is grammatically plausible.

It contains a date, an event and a historical subject.

But its plausibility does not establish its truth.

To evaluate the claim, we need historical evidence.

The generator has produced a possible statement.

It has not demonstrated that the statement corresponds to an actual event.

Generating a fictional scene

Now imagine:

The submarine surfaced beneath the ice, and its captain discovered a second moon above the horizon.

In a science-fiction story, this could be an intriguing sentence.

Its value depends upon the fictional context.

Perhaps the submarine has travelled to another world.

Perhaps the narrator is hallucinating.

Perhaps the moon is an artificial structure.

The sentence may be successful precisely because it departs from ordinary reality.

The standards for evaluating historical claims and fictional possibilities differ.

Generating literary quality

A system might produce thousands of scenes.

A human editor selects one.

The editor may value its rhythm, emotional complexity or relationship to the larger story.

Those criteria are not contained automatically in the generation process.

They must be supplied or developed through evaluation.

This returns us to the central difficulty of Borges's library.

A complete collection of possibilities does not eliminate the problem of judgement.

It makes judgement more important.

11. The Reader Who Gives the Library Meaning

There is another reason why Borges's library cannot settle the meaning of its contents.

Meaning is not always a property that can be identified by examining symbols in isolation.

Consider this sentence:

The door was open.

In one story, it might indicate that a prisoner has escaped.

In another, it might express an invitation.

In a third, it might suggest that a family home is no longer secure.

The words are identical.

Their significance changes with context.

A complete collection of possible strings cannot eliminate the need for context.

Meaning is relational

Readers interpret literature through relationships.

They connect a sentence with earlier events.

They recognise metaphors.

They remember characters.

They bring cultural knowledge and personal experience.

They notice contradictions and implications.

A poem may acquire new meanings when read in another historical period.

A phrase that once seemed ordinary may later appear politically charged.

The symbols remain unchanged.

Their interpretation changes.

This is not proof that meaning is entirely arbitrary.

Language possesses conventions.

Texts establish relationships.

Interpretations can be supported or challenged through evidence.

But meaning cannot ordinarily be reduced to the mere existence of a particular character sequence.

The library cannot choose its readers

Borges's library contains an astonishing abundance of possible expression.

But it does not determine how people should live, what they should value or which stories they should remember.

Those activities involve judgement.

The same is true of modern generative systems.

A machine can produce many possible responses.

It can estimate which responses are likely or preferred according to particular objectives.

It can assist with selection.

But the objectives and evaluation standards matter.

A system designed to maximise engagement may favour different material from one designed to preserve historical accuracy.

A system designed to produce surprising poetry may select differently from one designed to write clear safety instructions.

The difference lies partly in what the system is trying to achieve.

The existence of possible outputs does not establish which goals should govern their selection.

12. The End of the Search

The librarian returned to the chamber where she had found the book describing her childhood home.

For years, she had believed that somewhere there must be a perfect account of her life.

A book containing every important event, every forgotten conversation and every hidden truth.

Perhaps such a book existed.

Perhaps thousands of almost identical versions existed beside it.

But she now understood that merely finding a detailed account would not establish its accuracy.

The library could produce every plausible biography.

It could also produce every lie.

She would need something beyond the library to recognise the truth.

She would need evidence, memory, relationships and judgement.

She would need to understand what the words meant.

The imagined librarian is our invention, but her predicament captures the central concern of Borges's story.

The Library of Babel contains possibilities on an overwhelming scale.

Its completeness creates a terrible shortage of trustworthy guidance.

Everything might be written.

Yet the inhabitants remain uncertain about what to believe.

The lesson of the infinite library

Across this book, we have repeatedly encountered the relationship between generation and meaning.

Swift imagined a machine assembling words without understanding them.

Queneau constructed a physical book containing an enormous space of possible poems.

Strachey and Lutz used electronic computers to generate language.

Hypertext authors created networks of possible readings.

Game designers constructed simulated worlds capable of producing unexpected events.

Modern language models generate fluent passages from learned statistical relationships.

Each development expands what machines can do with text.

But none makes human interpretation irrelevant.

A system can enumerate possibilities without valuing them.

It can produce a statement without verifying it.

It can generate a moving scene without necessarily experiencing the emotions it describes.

It can reproduce a familiar literary pattern without understanding why that pattern matters to a particular reader.

These distinctions do not make computational literature unimportant.

They help explain its significance.

Machines extend the space of what can be written and encountered.

Readers and writers must still decide which possibilities deserve attention.

The last question before the last book

We are approaching the end of our investigation.

The first chapters asked whether machines could produce words, think, possess consciousness or govern societies.

The middle chapters explored how writing becomes information, instructions and executable processes.

The later chapters examined generative literature, interactive worlds, artificial intelligence and authorship.

Now Borges has brought us to an unexpected conclusion.

The ultimate problem is not that we might run out of stories.

It is that we may produce more stories than anyone could ever read.

In such a world, meaning becomes inseparable from selection.

A reader must decide what to encounter.

A writer must decide what to preserve.

A culture must decide what deserves remembrance.

The infinite library contains every possible story, but it cannot tell us which story we need.

That task remains unfinished.

And it leads us towards the final chapter.

Questions to Take Away

  1. Why is the number of distinct fixed-length books in Borges's library finite, even if its physical arrangement is imagined as unlimited?
  2. What is the difference between a book existing somewhere in the library and the claims within it being true?
  3. Why does increasing the number of possible texts not necessarily increase the proportion that readers find worthwhile?
  4. How does Shannon's mathematical concept of information differ from the everyday concept of meaningful information?
  5. Can a random character sequence contain more Shannon information than a meaningful sentence?
  6. Why might a search engine capable of locating every possible string still fail to identify the best poem?
  7. What is the difference between compressibility and literary significance?
  8. How does a mathematical description of a complete library differ from physically storing all its books?
  9. What standards should be used to evaluate a generated historical claim, and how do they differ from those used to evaluate a fictional scene?
  10. If machines can generate effectively unlimited quantities of text, how might that change the cultural importance of editing, criticism and preservation?

A Small Reader Experiment: The Library of Eighty-One Books

We will build a tiny version of Borges's library.

Our library uses only three symbols:

A, B, C.

Every book contains exactly four characters.

All possible four-character strings are included.

Step 1: Count the possibilities

There are three choices for each of four positions.

Therefore:

N=3^4=81

The library contains 81 distinct books.

Some examples are:

AAAA

AABC

ABBA

CCCB

CCCC

There are many others.

Step 2: Search for a meaningful string

Suppose we decide that ABBA is a meaningful message.

Perhaps it is an abbreviation in a fictional language.

Perhaps it represents a password.

Perhaps it is the name of a character.

Our tiny library contains it.

But it also contains eighty other strings.

Finding ABBA does not establish what it means.

We need an interpretation supplied from outside the mere enumeration.

Enable JavaScript to use this experiment. The chapter text remains readable.

Step 3: Generate the library

The following Python program enumerates all 81 strings in lexicographic order, searches for ABBA and reports its zero-based index.

It is finite, deterministic and uses no files, network access, external APIs or arbitrary code evaluation.

from itertools import product

alphabet = "ABC"
length = 4
target = "ABBA"
books = ["".join(symbols) for symbols in product(alphabet, repeat=length)]
matches = [index for index, book in enumerate(books) if book == target]
print("Possible books:", len(books))
print("Target:", target)
print("Matches:", len(matches))
print("Index:", matches[0])
print("Probability:", f"1/{len(books)}")

Exact output

Possible books: 81
Target: ABBA
Matches: 1
Index: 12
Probability: 1/81

The reported probability assumes that one book is selected uniformly at random from the 81 possibilities.

The target appears at index 12 because Python uses zero-based indexing.

It is therefore the thirteenth book in the ordered enumeration.

Step 4: Trace the index

For lexicographic ordering, assign numerical values:

A = 0, B = 1, C = 2.

The string ABBA corresponds to the digits:

0, 1, 1, 0.

Its zero-based index is:

0 × 3^3+1 × 3^2+1 × 3^1+0 × 3^0

Therefore:

0+9+3+0=12

The calculation identifies the book directly.

We do not need to examine all preceding strings individually.

Step 5: Increase the size

What happens if every book contains eight characters instead of four?

The number of possibilities becomes:

3^8=6561

For twelve characters:

3^12=531441

For twenty characters:

3^20=3,486,784,401

The alphabet has not changed.

Only the length has increased.

Yet the number of possibilities grows exponentially.

Step 6: Think about meaning

Suppose you are allowed to declare any one of the strings meaningful.

Does your declaration change the number of possible books?

No.

Does it change the mathematical position of the selected string?

No.

But it changes the relationship between the string and your interpretation of it.

You have supplied a convention that allows the symbols to represent something.

Now imagine someone else assigns a different meaning to the same string.

Which interpretation is correct?

The answer depends on the surrounding language, agreement, context or evidence.

The library itself cannot decide.

What this experiment demonstrates: A computer can enumerate every possible string within a finite system and calculate where a particular string occurs. Neither enumeration nor retrieval establishes the truth, value or meaning of the selected text.

Further Reading

Original Literature

Jorge Luis Borges — The Library of Babel (1941)

The foundational story imagining a universe of books containing every possible arrangement of a fixed set of symbols.

New Directions — Labyrinths, official publisher edition

Argentine National Library — Bibliographical record of the 1941 publication

Jorge Luis Borges — Ficciones (1944)

The collection incorporating The Library of Babel and other works exploring labyrinths, possibility, interpretation and the relationship between fiction and knowledge.

Penguin Random House — Collected Fictions, official edition

Information Theory

Claude E. Shannon — A Mathematical Theory of Communication, Parts I and II (1948)

The original research establishing a mathematical framework for information, entropy and communication.

Nokia Bell Labs — Official publication record

Part I — Bell System Technical Journal, July 1948

Part II — Bell System Technical Journal, October 1948

Complete paper — Princeton-hosted PDF

Algorithmic Information and Computation

Gregory J. Chaitin — On the Length of Programs for Computing Finite Binary Sequences (1966)

An early foundational paper in algorithmic information theory, examining how the length of a program can serve as a way of describing information.

ACM — Original publication

Ray Solomonoff — A Formal Theory of Inductive Inference (1964)

An influential early treatment connecting formal computation, probability and prediction.

Part I — Original publication

Suggested Reading Order

Begin with Borges. Read The Library of Babel as fiction rather than attempting immediately to convert every detail into mathematics.

Then examine Shannon's original paper, concentrating on the distinction between the transmission of messages and their semantic meaning.

Finally, investigate algorithmic information theory to understand why the shortest description of a string provides a different perspective from Shannon entropy.

The three approaches illuminate different problems.

Borges investigates the human consequences of limitless textual possibility.

Shannon studies the mathematics of communicating information.

Algorithmic information theory studies the relationship between strings and the programs capable of producing them.

Together, they reveal why the abundance of possible texts does not eliminate the problem of understanding.

Up Next — The Last Book

The Computational Future of Literature

We began this journey with machines imagined as writers.

We encountered mechanical word generators, thinking engines, artificial persons and algorithmic governments.

We explored cryptography, programming languages, executable literature and computer-generated poetry.

We entered branching stories and simulated worlds.

We examined artificial intelligence, authorship and the almost limitless possibilities of computational text.

Now we must ask what all these developments mean for the future of literature itself.

Will books remain fixed sequences of words?

Will stories become responsive systems that adapt to their readers?

Will artificial intelligence become an ordinary participant in literary composition?

Will every reader encounter a different version of a novel?

And if machines can produce more text than humanity can ever read, what becomes of the author, the editor and the reader?

The final chapter will not attempt to predict one inevitable future.

Instead, it will examine several possible futures for literary creation, publication and interpretation.

Some will preserve the familiar book.

Others will transform it into an interactive, generative or personalised experience.

All will confront the same central question.

When machines can generate almost any conceivable text, what will make literature worth creating—and worth reading?

Borges — Story text, university teaching copy

Chaitin — Original paper, university-hosted scan

Solomonoff — Author’s publication archive