Text as Number

 

I wrote a simple Processing sketch that returns binary values of characters from a split file (one letter per line), with an appended “0.” in front – this essentially makes this a single very complex number that holds all the information of the text.  Above is Shakespeare’s 51st sonnet stored as a number.

Based on a thought in Gary William Flake’s “The Computational Beauty of Nature” (pg 21).  As Flake describes it, “Now take a long number and put a zero and a decimal point in front of it.  We’ve just translated one huge number into a rational number between 0 and 1.  By placing this single point at exactly the right spot on the number line, we can store an unlimited amount of information.”

I think especially interesting is the idea that rather than the sonnet be translated to a number between 0 and a giant number (say 100 trillion, etc), the number is only between 0-1 but occupies a very specific point on the number line.  The resulting number is unique and no other text has that exact value.

Source code:

Shakespeare read in columns

Shakespeare’s 116th sonnet, rewritten as columns:

Let Admit Which Or O That It Whose Love’s Within Love But If I
me impediments, alters bends no looks is worth’s not his alters bears this never
not love when with it on the unknown time’s bending not I be writ,
to is it the is tempests star although fool, sickle’s with out error nor
the not alteration remover an and to his though compass his even and no
marriage love finds, to ever is every height rosy come, brief to upon man
of remove. fixed never wandering be lips hours the me ever
true mark shaken; bark, taken and and edge proved, loved
minds cheeks weeks, of
doom:

Particularly like “unknown time’s bending not I be writ” and “true mark shaken; bark, taken and and edge proved”.