Pierre Monard, Author of the Genetic Algorithm

What is this?

The body you see growing before you is the result of your computer or device working diligently to faithfully recreate chapters XI and XXXVIII of the first part of the original Spanish text of Don Quixote.


These chapters were not selected at random. Rather, they are the exact chapters cited in Jorge Luis Borges’ famous short story Pierre Menard, Author of the Quixote. In his story, Borges proposes the idea of a French writer, Pierre Menard, who decides to recreate the entire text of the Don Quixote from scratch. Menard’s goal was not to merely copy the book, but to incidentally produce his own copy that happened to, line by line, match the original.

The task I have undertaken is not in essence difficult… If I could just be immortal, I could do it.

This page aims to digitally implement the idea of a Pierre Menard, someone who recreates an original work by chance, at least in spirit.


This isn’t the first time a Borges short story has been “digitally implemented”. The Library of Babel, created by Jonathan Bastille, is designed to mimic the library described in Borges’ story by the same name, which is perhaps even more well-known than Pierre Monard. To accomplish that, Bastille devised an extremely clever method to display the entire Library without storing a single byte.

Luckily for us, Borges detailed the exact steps necessary to digitally implement his other story:

This game of solitaire I play is governed by two polar rules: the first allows me to try out formal or psychological variants; the second forces me to sacrifice them to the “original” text and to come, by irrefutable arguments, to those eradications…

It turns out that this game is not far from the techniques used in genetic algorithms. In such a process, we would start by writing some chapters purely at random. Then from these chapters we would select the ones that “feel” the most like the Don Quixote out of the group, and “breed” them together, mixing the words to create new offspring books, some of which may have imperfections where a character is misplaced from their original parents’ text. These children make up the next generation, closer to the Quixote than the last, and we repeat the process with each generation until we reach one that contains the exact text of the original.

This is the exact technique we use to generate the paragraphs on this page, and it’s easy to imagine that Pierre Monard would take the same steps, too. With this process, we are able recreate the Don Quixote without knowing anything but how close a given text is to the original. The process itself is agnostic of the contents of the texts.

So What?

By itself, this type of algorithm is extremely simple. You could even consider it as the “Hello World” of genetic algorithms. If you know the answer you want, it’s pretty easy to get there.

But hopefully, this illustrates some of the depth in the core ideas of Pierre Monard. One of the central questions about the story is the veracity of Monard’s claims. Did he actually write the Quixote himself? Is that even possible? The narrator of the story claims that Monard destroyed all evidence of his intermediate attempts, so there’s no way to verify.

What if we did have proof? What if it was possible? The changing text on this page is the evidence lost in all of Monard’s bonfires. If you wait long enough you’ll see that it is indeed possible to happen upon the Don Quixote like an infinite number of monkeys with typewriters could.

Where the Library of Babel aims to get you lost in the infinite possibility of language, this page aims to be a companion when exploring the finiteness of language.