

Mathematics: Came across the following gag. Is it true? - bjourne
http://math.stackexchange.com/questions/216343/came-across-the-following-gag-is-it-true

======
IsaacL
I'm guessing people here are familiar with Borges' "Library of Babel". (If
not, it's a short story about a library that contains every possible book).

I read an interesting thought experiment about the concept:

1\. There's lots of different languages around, but all languages (even
Chinese) use a finite alphabet of symbols. So for simplicity we can just
convert all languages in the Library into binary.

2\. On first appearance, the library would contain books of an infinite number
of lengths. But it would surely be more practical to split such books into
volumes.

3\. You'd have a maximum volume length of say, 1 million bits. Books shorter
than that can just be padded with 0s. But you can now double up volumes:
volume #6345 of book #1840849 might be an exact duplicate of volume #93974 of
book #11132445. Which means the library can now be finite in size: it only
needs to contain all one-million-bit strings, a mere 2^1000000 volumes.

4\. Why stop there, though? It's clear we could just use smaller volumes and
get a smaller library. In fact, the library only needs two pages - one '0' and
one '1'. Depending on the order you read them, you can get any book you want
out of it.

Information theory is weird.

Edit: here's the original:
[http://jubal.westnet.com/hyperdiscordia/universal_library.ht...](http://jubal.westnet.com/hyperdiscordia/universal_library.html)

~~~
bo1024
Not sure if we're on the same page here, but this does not conform to what we
know about information theory.

First, as someone else mentioned we'd have to have a maximum book length or
else your library contains an infinite number of books, which is simply absurd
because there would, for instance, be a book that contained all of the finite
books inside it, in alphabetical order.

Second, using your compression technique, we'd still need to have some
numbering on the volumes, and to describe a book, we'd have to do so by a list
of numbers describing which volumes comprise it and in what order.

Third, this makes clear what is happening in your reductio ad absurdum
argument -- we can reduce the volumes down to one dash, one dot; but then each
book needs to contain a listing in order of which "volume" is in which order.
So we're just writing the boks in binary again.

~~~
tripzilch
> Second, using your compression technique, we'd still need to have some
> numbering on the volumes, and to describe a book, we'd have to do so by a
> list of numbers describing which volumes comprise it and in what order.

Yes, for a normal library this would be the case. But this library contains
_every_ possible book.

So the index list you're asking for, describing which volumes comprise what
book in what order, is the complete list of _all_ possible orderings of
volumes up to the maximum book length.

You don't really need that list, because you know exactly what it looks like.

But then, you don't really need the volumes either, because you know what they
look like too (being all combinations of N bits).

So yeah, you'd just need a 0 and a 1.

I already got a copy of that library, and the cool thing is that it doubles as
a light switch.

~~~
bo1024
There seems to be some assumption here that books are named by their ordering
of volumes. But I might know the name of a book and not its contents, so I'd
need to look up the contents. (Of course, this is silly if you have every
possible book, because any other naming scheme means most names will be longer
than the books themselves....)

------
lutusp
Assuming that π is normal and infinite (that's redundant but for clarity),
then yes, it's true -- it contains every finite-sized number, every textual
sequence, every secret, every book ever written. Scientific secrets we may
never discover. Cures to nonexistent diseases. Everything!

But this is as meaningless as it is true, because the problem is not that
those secrets are present, the problem lies in locating them.

I had this conversation years ago on Usenet -- the same question, the same
answer. My correspondent seemed to think it was remarkable that all those
riches lay within π. He didn't seem to realize that the same could be said of
any normal, infinite sequence of digits, of which there may be an infinite
number (not proven, but it's possible that e, √2, indeed the square root of
any non-perfect-square number, all fall into this category).

If the grains of sand on a beach could be decoded as binary bits (or as digits
in any base) by some accepted convention, and making the same assumptions
about normality and infinity, then a beach also contains every secret, every
book that has ever been written or will ever be written. But it's the same
problem - those secrets cannot be located, distinguished from sequences we
might label meaningless, simply because they're answers we're not interested
in.

<http://en.wikipedia.org/wiki/Normal_number>

A quote: "While a general proof can be given that almost all numbers are
normal (in the sense that the set of exceptions has Lebesgue measure zero),
this proof is not constructive and only very few specific numbers have been
shown to be normal. For example, it is widely believed that the numbers √2, π,
and e are normal, but a proof remains elusive."

~~~
gabemart
I don't have a strong mathematics background, but would I be right in thinking
that the probability of a normal, infinite number containing a given arbitrary
string of digits is "almost sure" rather than "sure"? Or can it actually be
proven mathematically that it contains such a string?

~~~
notatoad
It's not proven, it's the definition. If there is a subsequence that isn't
contained in a non-repeating infintely long sequence, then it isn't a non-
repeating infinitely long sequence.

~~~
xyzzyz
This is not true. For instance, sequence 00 does not occur in sequence

010110111011110111110111111...

which can hardly be described as "repeating" (or periodic) sequence.

The point here is normality. Fix alphabet A having b letters. We say that a
sequence S of elements of A is normal if, for every word w, we have

lim n->inf C(S, w, n)/n = b^(-k)

where C(S, w, n) is the number of occurrences of w in first n letters of S,
and k is length of w. More intuitively, S is normal if every word occurs in S
with the same asymptotic frequency.

So, if a sequence does not contain some word as a substring, it cannot be
normal by above definition.

------
ramses0
[http://yro.slashdot.org/story/01/03/17/1639250/illegal-
prime...](http://yro.slashdot.org/story/01/03/17/1639250/illegal-prime-number-
unzips-to-decss)

This is from WAAAY back in the day.

"A person named Phil Carmody has found a very interesting prime number. When
converted to hexadecimal, the result is a gzip that contains a DeCSS
implementation. I've posted a short bit of Java here that takes the prime as a
command line parameter and dumps the result to standard out if you want to
test it."

...I actually ran it once upon a time, although I didn't check if the links
were current.

While slightly different context (prime #'s vs. PI) the concept is the same.
If you dig deep enough into prime numbers and it contains the "illegal" topic
du-jour expressed as a zip file... well, I won't put it past PI containing
almost everything else as well.

------
newhouseb
Ever since I was a kid in elementary school I've loved the idea/thought
experiment of owning a hard disk full of every possible n-by-n binary image.
By definition, on this hard disk you would have a sketch of every person
you've ever met, every person you've ever loved, every place you've ever been,
every alien in the solar system. On one hand, it's endearing you could depict
so many things in such a finite medium, but at the same time it's astounding
how much storage space you would need for even the smallest reasonable numbers
of N. Sometimes when I'm bored waiting for a bus, I love to think about what
it would be like to pour through all these images and somehow know which ones
would be meaningful in my future that I don't yet know.

~~~
caf
Sadly, there isn't enough energy in the entire Universe to cycle even a 16x16
black and white grid through all of its possible states.

~~~
randomdata
Unless you happen to own a quantum computer.

------
jbri
This reminds me of the "pi encoding" - if pi is, in fact normal, you can
encode any file as a tuple (`start`, `length`) encoding a substring of the
expansion of pi.

It's often phrased as a compression paradox of a sort - surprisingly many
people overlook the fact that `start` will tend to take a _lot_ of bits to
encode.

~~~
TazeTSchnitzel
It's also quite slow...

------
damian2000
Sounds similar to the <http://en.wikipedia.org/wiki/Infinite_monkey_theorem>
...

"a monkey hitting keys at random on a typewriter keyboard for an infinite
amount of time will almost surely type a given text, such as the complete
works of William Shakespeare."

~~~
Fice
In the ideal world of mathematics there is no distinction between creating and
discovering. Everything that is possible exists. That makes the infinite
monkey theorem or statements like "the answers to all the great questions of
the universe can be found in the digits of π" meaningless. For instance, every
future masterpiece of literature already exist in mathematical sense, yet it
will still take a genius to discover it in the infinite sequence of all
possible texts.

~~~
xk_id
Do you have any bibliography for this topic? I would be very grateful, I'm
extremely interested in this.

------
lifeformed
Does this mean writing out a normal number is illegal? They encode state
secrets, child pornography, pizza recipes, and entire computer simulations of
universes where owning pizza recipes is considered high treason.

~~~
teraflop
Only to the same extent that counting is illegal, because if you count high
enough you'll eventually generate a numeric representation of every possible
datum.

------
cammil
Infinite and non-repeating does not imply it contains every number.

For proof of this, consider an infinite non-repeating number, without the
number 9.

Pi is infinite and non-repeating. I have not yet seen proof that pi contains
every finite number.

------
digeridoo
a. proove it

b. pi as a decimal number is an approximation that is only as long as you
calculate it to be. Moreover, decimals do not contain non-numeric information.
That's just your own interpretation. Imagine a number system where pi is 1.
Clearly no names in 1. Now imagine a number system where pi is expressed as π,
like... the number system that we use. Clearly no names in π.

~~~
lutusp
> pi as a decimal number is an approximation that is only as long as you
> calculate it to be.

But Pi is not equal to our approximations of Pi. That's backwards. Pi owes
nothing to our lame efforts to approximate it. When someone asserts that Pi
may be an infinite sequence, the truth of the proposition doesn't depend on
someone computing an infinite sequence of Pi's digits.

> Moreover, decimals do not contain non-numeric information.

Are you aware that your typing is promptly translated into numbers for
transmission through the Internet? That A = 65 (in the old ASCII encoding), B
= 66, etc.? So yes, decimals do contain non-numeric information if we choose
to interpret them that way. And we do.

~~~
sp332
You're looking for strings in the decimal expansion of pi. Pi is not a decimal
number! Every decimal representation of pi is an approximation. Pi is not an
infinite sequence, it is a single value a bit higher than 3.14, it is only the
decimal (or other bases, besides 10) expansion that has an infinite number of
digits.

~~~
lutusp
> Pi is not a decimal number!

Of course it is -- although choice of base is quire arbitrary. Pi is as much a
decimal number as it is a binary number.

> Every decimal representation of pi is an approximation.

Our inability to represent Pi doesn't constrain Pi, it only constrains us. The
fact that we cannot fully represent Pi has no effect on Pi or its identity.
And Pi has the same identity in any base -- the ratio of a circle's
circumference to its diameter.

> Pi is not an infinite sequence

Pi is an infinite sequence.

<http://en.wikipedia.org/wiki/Pi#Infinite_series>

Quote: "The calculation of π was revolutionized by the development of infinite
series techniques in the 16th and 17th centuries. An infinite series is the
sum of the terms of an infinite sequence.[49] Infinite series allowed
mathematicians to compute π with much greater precision than Archimedes and
others who used geometrical techniques."

~~~
sp332
You're constraining yourself to a wrong definition of what a number is. The
number 0xA is not a different number from 0b1010 even though they have a
different number of digits.

 _> Pi is not an infinite sequence

Pi is an infinite sequence._

I was talking about an infinite number of digits, but even this new definition
is wrong. Pi is one single value. There are many ways to compute this value.
Some of them include infinite series. Note the wording: "The _calculation_ of
π was revolutionized by the development of infinite series _techniques_ ".
Other techniques were used before, and they are still valid. The only
advantage of infinite series is that they are easier to calculate, and the
approximations converge faster when you compute them on real (finite)
hardware.

~~~
lutusp
> You're constraining yourself to a wrong definition of what a number is.

That's your problem, not mine. You keep trying to say that Pi is defined by
our approximations of its value.

> Pi is one single value.

So, tell me, which part of "Pi is an infinite sequence" are you actually
disagreeing with?

> There are many ways to compute this value.

You persist in confusing Pi with our efforts to approximate its value.

> Other techniques were used before, and they are still valid.

False. 22/7 is not valid. 355/113 is not valid. This is valid:

<https://www.dropbox.com/s/423ieio63bsuaat/pi_w.png>

The reason? Pi is a mathematical idea that happens to have a numerical value,
but the idea transcends the value. The value is a coincidence, which is why
choosing to express it as 1 to the base Pi changes nothing, and why arguing
about the size of its approximations changes nothing.

> The only advantage of infinite series is that they are easier to calculate
> ...

No, they are much more difficult to calculate, but they convey more meaning.
Infinite series are why Pi isn't just a number, any more than e is.

~~~
sp332
> False. 22/7 is not valid. 355/113 is not valid.

Right, those are approximations. Those are not what we are talking about.

> This is valid: <https://www.dropbox.com/s/423ieio63bsuaat/pi_w.png>

I agree that it is valid. It is one of many ways of calculating the value of
pi. Here is another one:
[http://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Pi-...](http://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Pi-
unrolled-720.gif/200px-Pi-unrolled-720.gif) Also there are iterative
algorithms.
[http://en.wikipedia.org/wiki/Pi#Computer_era_and_iterative_a...](http://en.wikipedia.org/wiki/Pi#Computer_era_and_iterative_algorithms)

> No, they are much more difficult to calculate, but they convey more meaning.

Again, I didn't mean approximations like 22/7. I was comparing them to e.g.
the geometric method which took hundreds of years to extend to a few hundred
digits. The geometric method conveys the same "meaning" because it is an exact
description of pi, just like the infinite series and the iterative algorithms.

> Pi isn't just a number, any more than e is.

They are both just numbers. e is not infinite, in fact it is less than 3.

~~~
lutusp
> They are both just numbers.

No, they are ideas. The base of natural logarithms isn't an arbitrary number,
it has special properties. It's the same with Pi -- they're ideas that happen
to be expressible as numbers. But their numerical value is less important than
their identity as ideas.

> e is not infinite, in fact it is less than 3.

Straw man. No one claimed otherwise. But e appears to have an infinite digital
sequence, i.e. is "normal" in the mathematical sense.

But, as with Pi, the fact that e is likely "normal" is much less important
than the idea it represents.

~~~
sp332
OK. It sounded like you were saying that Pi is special just because there is
an infinite series that describes it. It's trivial to make an infinite series
that sums to any number.
[http://en.wikipedia.org/wiki/Series_%28mathematics%29#Conver...](http://en.wikipedia.org/wiki/Series_%28mathematics%29#Convergent_series)
So the number 2 is just as "infinite" as pi.

~~~
lutusp
> It sounded like you were saying that Pi is special just because there is an
> infinite series that describes it.

That would be because Pi is special because there are infinite series, and
integrals, and mathematical identities, and limit expressions, that describe
it in ways that give it a special meaning.

> So the number 2 is just as "infinite" as pi.

You're confusing the existence of a summation with its outcome. Obviously the
sum of 2^-n for n between 0 and infinity (inclusive) is equal to 2, but that
doesn't make 2 an infinite digital sequence, or in any other sense "infinite".

------
SeanDav
This is similar to the Infinite Monkeys theorem and is more nuanced than many
people think.

<http://milesmathis.com/monkey.html>

<http://en.wikipedia.org/wiki/Infinite_monkey_theorem>

------
walle_
I did a quick test for this, would add a comment to the stackexchange thread,
but it's closed now.

Test at <https://github.com/walle/pi2ascii>

The algorithm can be greatly improved though.

------
BasDirks
You could pose the question the other way around: is the infinite hidden
within the finite? This philosophical question is probably outside the realm
of mathematics, but an interesting thought-exercise.

~~~
lutusp
> You could pose the question the other way around: is the infinite hidden
> within the finite? This philosophical question is probably outside the realm
> of mathematics ...

There's a reason it's outside the domain of mathematics -- it contradicts the
definition of infinite. By definition, an infinite set cannot be a subset of a
finite one.

> ... but an interesting thought-exercise.

Briefly, but easily answered. :)

~~~
BasDirks
I came to think of it after reading part of one of the answers in OP link:

"So yes, it has the story of your life -- but it also has many false stories,
many subtly wrong statements, and lots of gibberish."

The "gibberish" is bound to contain many truths. This kind of encoding is very
different from the mathematical idea of subsets. I am probably bending
concepts beyond breaking point here, and you are correct.

------
sksksk
If computing ever got powerful enough to compute pi to an nth amount of digits
nearly instantaneously, would it be possible to compress everything by just
saying "get the digits between x and y"

~~~
lutusp
Yes, but not in a way that would be useful. For a sufficiently complex
message, the index into Pi that matches it might well be longer than the
original message. So, yes, but no gain -- the result would be larger than the
original.

This would be true for a huge set of Pi digits and some imagined fast way to
gain access to the right index -- the index into the set would likely be
larger than the message it indexes.

------
phylofx
Well, obviously, everything exists in the infinite - somewhere. A completely
trivial realization, however.

~~~
ColinWright
This is not true - you can have infinite things without them containing
evertthing. So no, this is _not_ obvious. Indeed, pi may not be normal, so
there may be things not contained in it.

------
ritratt
It represents a fractal.

------
Evbn
It isn't a gag. It is a (conjectured, tested, not proven) mathematical fact
explained on the SE page.

It is relevant to hackernews as a illustration of the effectiveness of
seemingly pointless pictures of text as memes, obnoxious though they be.

