Monday, February 18, 2008

Every possible random number

Recently I was kicking around the idea of calculating and storing every possible series of random numbers. Possessing every random number seems comforting... sort of the same feeling as having just done a load of laundry and every piece of your clothes is clean and folded in a dresser.

Isn't the number of random number series infinite? Not on computers. Computers use formulas to generate series of random numbers and those formulas have limitations (usually stemming from the default maximum integer value for the operating system).

Because the random numbers are created using formulas, they're more correctly referred to as pseudorandom.

When using a pseudorandom number generator, programmers prime the pump by providing it a seed value. The seed is an arbitrary number (most often the current time) and is the source of unpredictability for the number generator. A series of random numbers created by a pseudorandom number generator (using a particular seed value) will begin repeating within 2n-1 results (where n is the bit size of the seed number). A Sony PS3 console runs at 218 gigaFLOPS—i.e, 218 billion floating-point operations per second. Assuming a 32-bit seed value and 100 floating-point operations for each generated pseudorandom number, a PS3 could run through the entire series of random numbers associated with a particular seed in 1.97 seconds. A 32-bit number has 4,294,967,295 possible seeds values (again, 2n-1 where n is 32), so it would take 268 years for a single PS3 to go through every possible series of random numbers.

Still with me?

It occurred to me that using distributed computing (where many people allow me to use a bit of their computers' processing power) it would be possible to calculate every series of random numbers in a reasonable amount of time (perhaps a year or two, depending on how many people were participating in the project). However, there's the problem of storage.

Assuming the generated random numbers can have up to 5 digits, each number would require 17-bits of storage. So the storage space would be (using hard drive manufacturer's standard of expressing storage size in powers of 10 rather than powers of 2):

17 [bits] * 232-1 [seeds] * 232-1 [length of series]
/ (8 [bytes] * 1000 [KB] * 1000 [MB] * 1000 [GB] * 1000 [TB])

So, unfortunately, such a project would require 3.92 * 107 terabytes... that's just not possible. I'm sure before too long that sort of storage will be possible & affordable, but by then 64-bit operating systems will be the standard, so the number of seeds and the length of the number series increase to 264-1.

Oh well.

Labels:

Tuesday, February 12, 2008

One Million Random Digits


In my research I came across references to the Rand Corporation's A Million Random Digits With 100,000 Normal Deviates. It's a 600 page tome of random numbers for use in scientific and mathematical research (for example, running a simulation might require rigorously random numbers). It's available for free online or as a paper back book (it was original published in hardback in 1955).

Out of idle curiosity, I checked Amazon to see if it's available as a reprint, and sure enough it is... and there are 97 reviews of it. For example:

1.0 out of 5 stars Sloppy., July 27, 2005
By B. MCGROARTY (United States) - See all my reviews
(REAL NAME)
The book is a promising reference concept, but the execution is somewhat sloppy. Whatever algorithm they used was not fully tested. The bulk of each page seems random enough. However at the lower left and lower right of alternate pages, the number is found to increment directly.
and
5.0 out of 5 stars The most amazing book I have ever come across, January 16, 2005
By Jamie R. Wilson (Knoxville, TN USA) - See all my reviews
(REAL NAME)
A truly amazing genre-breaking work of art unlike any that has ever been or ever will. I was captivated from the moment I opened the cover until the extremely suspenseful moment I turned the last page. With that said, I was a little disappointed that 71602 was knocked off by 92937 just as the plot was unfolding, but the arrival of 96240 really got my blood pumping and I just couldn't put the book down from that moment on.

I am so glad that Amazon.com is offering the "Search Inside This Book" option for this book so that it can be enjoyed by countless other avid readers who otherwise may not have come across it. I wait, impatiently, for the audio CD version of this fine book.

A more serious review is available here.

Labels: ,

Tuesday, January 8, 2008

Your thoughts on randomness

I'm contributing a chapter about randomness, chance, & art to a handbook on computation and art. At this point I'm gathering my thoughts and writing paragraphs on the subject without worrying too much about the chapter's overall structure.

Most recently I was thinking about how using random variables in art does not necessarily mean a random result. The randomness of the result is completely dependent on how the artist structures the use of stochastic stimuli.

In the written thesis for my MFA exhibit I quoted Golan Levin:
His flower collages were good, but they were all equally good — and he failed to see that this made them all equally bad as well. It's one thing to endorse the beauty of unexpected outcomes, but we must confront the fact that our algorithms are capable of coldness and ugliness, too, or we will never learn anything.
Levin seems to be taking an aesthetic position that real beauty comes from a mixture of ugliness and prettiness. Or perhaps the real objection is that the outcomes aren't all the unexpected; that the algorithm for the flower generation had a narrow range of variety, so as to ensure a consistently beautiful outcome. In effect, the randomness of the flower generation is a bit of a cheat--the artist is using loaded dice.

It strikes me that there may be a sweet spot in framing how randomness manifests itself in art. If the result is too random, it is just noise. If the randomness is too constrained, it no longer is really an element of the artwork.

I've tried to come up with three simple examples of "too much variety," "not enough variety," and "just right!" The "too much variety" example is an algorithm that creates a grid of squares, each of which has an equal chance to be any one of 16,777,216 different colors. The "too little variety" example fills each square with one of three shades of blue. The "just right" algorithm fills the first square with a random color and then for each following square shifts the color by up to 0.00006% (I think I did my math right in calculating that percent... I take the current RGB hex value and add up to plus-or-minus 5).

I'm wondering, though, if my examples are stacking the deck... is this an intellectually honest analysis? I'm particularly suspicious of my "not enough variety" example. Is there a better algorithm to demonstrate that? See the three images below:


Too much variety


No enough variety


Just right!

Labels: ,

Wednesday, November 21, 2007

Popcorn & parrot art


Here are two interesting works, both dealing with language.

Talking Popcorn by Nina Katchadourian interprets popcorn popping as Morse code. A text-to-speech program provides simultaneous translation. Since popcorn doesn't have short & long popping sounds, the duration of the silence between the pops create the short Morse code "dots" and long "dashes."

I can see how this could create a series of random letters, but I wonder how it is turned into coherent words. Perhaps it waits until a word appears in the gibberish? The problem with that is you might pop an entire batch of popcorn and only get a couple of words. Perhaps the gibberish is translated into the closest matching word (in the same way that spell-checkers work).

In addition to the popcorn machine, Katchadourian has a nice series of spin-off works including The Popcorn Journal which consists of bags of popcorn along side their text output and Talking Popcorn's First Words which are bronze popped corn from the first batch (which was translated as "we").



may-por-e' is a work by Rachel Berwick in which she attempts to teach them the Maypure language. The Maypure were a South American tribe that were wiped out by the Carib in 1799. Parrots were among the items that the Carib's looted after the attack. A few days later, the German naturalist Alexander von Humbolt acquired one of these parrots. Realizing it was the last speaker of the Maypure language, he phonetically recorded the parrot's language. Using that sole record of the language, Berwick teaches contemporary parrot the Maypure language.

Labels: , , , , , ,