The complete library of Babel

Each book contains four hundred ten pages; each page, forty lines; each line, approximately eighty black letters.

The library has existed ab æternitae.

There are twenty-five orthographic symbols.

There are no two identical books.

The library contains all previous, current, and future books.1)

(define alfabet (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, r, s, t, u, v, space, comma, period, ?))
(define tokens 80)
(define lines 40) 
(define pages 410)
(define tokens-per-book (* tokens lines pages))

(define tree-of-knowledge
  ((for symbol : alfabet) 
       (generate-complete-books 0 symbol))) 

(define (generate-complete-books token-number rest-alfa)
  (cons (first rest-alfa)
          (if (< token-number tokens-per-book)
              (generate-complete-library (+ token-number 1) alfabet)
          (if (null? (rest alfabet))
              (generate-complete-books token-number (rest rest-alfa))))))

1) In order for a book to exist, it is sufficient that it is possible. Only the impossible is excluded. For example, no book is also a staircase, though there are no doubt books that discuss and deny and prove that possibility, and others whose structure corresponds to that of a staircase.
the.complete.library.of.babel.txt · Last modified: 2011/09/17 06:13 by aksel