Randomness
From Maze
Contents[hide] |
An essential element of 10 PRINT CHR$(205.5+RND(1));: GOTO 10 is randomness; the program could not have anything like the same effect without it. The program uses randomness that is built in to the Commodore 64's BASIC programming language via the RND function. And the RND function is not special to the Commodore 64; it was present in the original Dartmouth BASIC. Furthermore, it's not just Commodore 64 BASIC that supplies random numbers. There are capabilities for generating random numbers that are provided by the built-in operating system, the KERNAL (the source of randomness that is used by BASIC) and by the sound chip, the SID. It's randomness all the way down. Producing randomness is a standard capability of the Commodore 64, provided by several different techniques. Randomness is just as important to other forms of modern computing.
This chapter explains what random numbers are, explaining certain different types of randomness. Then, it looks at the historical inception of functions for generating random numbers and some of the ways these random numbers have been used. The chapter considers how and why randomness is used in the arts. Through a nuanced discussion of randomness, the chapter argues that the maze pattern which 10 PRINT produces is entwined with a history of aesthetic and utilitarian coin flips and random processes.
Since chance is happenstance, hap, the root of happy, it would seem likely that randomness, a type of chance, might have a happy etymology. But this is not so. In centuries past, before the philosophers and mathematicians in the Age of Enlightenment sought to rationalize even chance, randomness was a nightmare. Likely ancestors of the word "random" are found in Anglo-Norman, Old French, and Middle French and include randoun, raundun, raundoun, randon, randun, and rendon -- words signifying speed, impulsiveness, and violence. These predecessor words are found beginning around the 12th century and probably derive from randir, to run fast or gallop. Bumper stickers implore drivers to "practice random acts of kindness," but only because people in our culture fear random acts of violence so much that another phrase has become so ingrained that it can be punned upon -- and at a deeper level, perhaps, because the speed and violence of other vehicles are to be feared. While today it might be harmless for us to encounter "a random" (a person unknown to us, according to the Jargon File) sitting in the computer lab exploring a system at random, a "random encounter" centuries ago was much more likely to resemble a violent random encounter in Dungeons & Dragons. For instance, it could have been a figure on horseback hurtling through a village, trampling and slaughtering whoever he can reach.
Only recently have the meanings of the word "random" coalesced around science and statistics. Its history is littered with obsolete meanings. The degree of elevation of a gun that maximizes its range. The direction of a metallic vein in a mine. The sloping board on the top of a compositor's frame where newly arranged pages are stored before printing. These particular randoms kill opponents, create wealth, or incubate books. The RND found in 10 PRINT recalls the latter meaning of random, a structure integral to textual composition. RND selects one of two graphical characters. Flip or flop, a slash forward or a slash backward. Each random slash splayed across the screen with the PRINT command, an echo of the early days of BASIC, when PRINT meant putting ink on paper. The connections of RND on the Commodore 64 to the origins of the word -- to speed, violence, devastation, and yes, printing -- are inescapable.
Life itself is full of randomness and the inexplicable, and it is no small wonder that children and adults alike incorporate chance into their daily lives, as if to tame it. Games of chance are one of the four fundamental categories of games that all humans play, argued the French cultural historian Roger Caillois. Whereas agon are games dependent upon skill, mimicry are games of imagination, ilinx are games causing disorder and loss of control, alea are games of chance. Taken from the Latin name for dice games, alea "negates work, patience, experience, and qualifications" (17). When a player loses a game of chance, it is as if the gods themselves have cursed him or her. But when a player wins a game of chance, he or she has been blessed by the fates. Indeed, the roll of a die or toss of a coin have long foretold the fortunes of men, though gambling dens and casino halls have determined more futures than soothsayers and prophets. The rise of the scientific method can be seen as one enduring struggle to impose a more rational -- and predictable -- view upon the world. From Aristotle to Galileo to Newton, classical mechanics defined the universe as an organized system without random actions. Although Einstein may have declared that "God does not play dice with the universe," probability and statistics have been extremely important to our understanding of the world from the 20th century on, and have brought randomness into our basic scientific understanding of the world. From chaos theory and quantum mechanics through evolutionary biology and the simulation of dynamic systems, randomness may itself be modeled and incorporated into systems, but it can no longer be excluded from the scientific perspective on the world.
How appropriate, then, that poet Stephane Mallarme declared in 1897, in French, that "a throw of the dice does not abolish chance" -- presaging the importance than randomness and chance operations, and the seeming paradoxes of them, would have in the next century and beyond.
Randomness and Aesthetics Before Computing
While randomness has played a significant role in the visual arts, music, and other areas of aesthetic practice, it often goes by the name "chance" in these contexts. What is meant by "chance" is a bit more general than typical understandings of "randomness," covering a wider range of work. In his 1956 chapbook Chance Imagery, the conceptual artist George Brecht described two distinct types of chance operations, “one where the origin of images is unknown because it lies in deeper-than-conscious levels of the mind, and the second where images derive from mechanical processes not under the artist’s control.” The first definition describes the work of the surrealists and abstract expressionists who allow subconscious processes to dictate the work. The second definition is closer to the typical concept of randomness in computing; it describes the process of the artists most directly connected to 10 PRINT and its random process. Of course, the two senses are worth noting because it difficult to pull on one of the two senses of "chance" without the other one -- the unconscious, in this case - at least feeling a tug.
Artistic experimentation with randomness in the early part of the 20th century can be seen as a response to the sterile functionality of rationality and empiricism wrought by the Industrial Age, and later, as a deliberate reaction against World War I. Consider Marcel Duchamp's Three Standard Stoppages (1913-1914). According to his description of the piece, Duchamp dropped three meter-long pieces of string from the height of one meter and let gravity and chance dictate the paths of the twisting string downward. He then glued the twisted string onto canvas, the shape and length of which he preserved in 1918 in wooden cutouts, creating three new "stoppages," parodying the supposed rationality of the meter. When Duchamp described his method in 1914, he observed that the falling thread distorts “itself as it pleases” and the final result becomes "the meter diminished," subverting both the straightness and the length of what commonly goes unquestioned. On his use of randomness, Duchamp said, “Pure chance interested me as a way of going against logical reality.” Duchamp, like the other Dada artists with whom he associated, saw "logical reality" as a failure, epitomized by the horrors of World War I. Satire, absurdity, and the embrace of indeterminacy seemed to the Dadaists to be the most reasonable response to Modernity. In the words of the Dada musician Gabrielle Buffet-Picabia, “Dada wished to destroy the reasonable frauds of men and recover the natural, unreasonable order. Dada wished to replace the logical nonsense of the men of today with an illogical nonsense.” To Jean (Hans) Arp, a Dada artist, individual authorship was synonymous to authoritarianism and random elements were used to liberate the work.
[Tzara and Dada/Surrealist poetic composition using words from a hat. Burroughs/Gysin cut-up method.]
Continuing on with the musical interpretations, it is important to mention John Cage. Within the twentieth century, John Cage is most responsible for promoting random processes within the arts. Cage was strongly influenced by Duchamp. From Cage's point of view, random elements can remove individual bias from creation; they may be used to go beyond the limitations of the taste and bias through “chance operations”. In additional to his work as a composer following these ideas, Cage influenced generations of artists through his writing, lectures, and classes. In this text “Experimental Music”, Cage wrote, “Those involved with the composition of experimental music find ways and means to remove themselves from the activities of the sounds they make. Some employ chance operations, derived form sources as ancient as the Chinese Books of Changes, or as modern as the tables of random numbers used also by physicists in research.” [Cage 66, p. 10] [Note: Earle Brown used the following random sampling number tables: "M.G. Kendall and B. Babington Smith, A Table of Random Sampling Numbers. Tracts for Computers no. 24. (Cambridge, UK: Cambridge University Press, 1939)."] Cage's style of random composition was to create a system of parameters, then leave the results to circumstance. Cage explained, “This means that each performance of such a piece of music is unique, as interesting to its composer as to others listening. It is easy to see again the parallel with nature, for even with leaves of the same tree, no two are exactly alike.” [Cage 66, p. 11] Random components are used to transform a single composition into a space of potential compositions. Over the decades, Cage used an array of techniques to insert unexpected elements into this compositions. He defines the range of techniques used by himself and his contemporaries in the 1958 lectures “Composition as Process”. There are generally two methods for utilizing random values – using them at the time of composition to define the work, or to allow for variation while the work is performed. This second category of is most similar to 10 PRINT, where the random decisions are made during the programs execution, or to say it a different way, while the instructions are performed by the C64 operating system.
Within two-dimensional visual art, mechanical random processes were explored for the reasons championed by Cage. The eminent contemporary painter Gerhard Richter provides a simple answer to why this is beneficial, “I'm often astonished to find how much better chance is than I am.” There's precedent for chance used within visual works dating back to collage works by Jean (Hans) Arp from 1916, but the two most relevant early works to 10 PRINT are the Spectrum of Colors Arranged by Chance collage series (1951) by Ellsworth Kelly and Random Distribution of 40,000 Squares Using the Odd and Even Numbers of a Telephone Directory (1961) by François Morellet. Both of these works start with an even grid and proceed to fill the grid carefully with elements based on the algorithms developed by the artists. Kelly used squares of colored paper and placed according to a system he designed. He assigned a number to each color and then plotted the numbers on the grid according the a pseudo-mathematical system. [Malone 2009 p. 133] Morellet employed the more strict system by reading a series of numbers from the telephone book. He made a grid of 200 vertical and horizontal lines and if the assigned number was even, he painted the square blue; if the number was odd, he painted the square red. In both systems and in 10 PRINT, the structure of the grid makes it possible to focus on the variability created through the random operations.
The Emergence of Randomness in Computing
The RND command acts as the algorithmic heart of 10 PRINT, its flip-flopping beat powering the construction of the maze. The RND function is as fully specified and well-known as any BASIC keyword, but its output is, by that definition, unpredictable. This paradoxical function manifests a much deeper, latent sequence, operating underneath the surface of the machine.
An obvious question to ask about randomness is why bother at all? Why have the ability in the first place to generate random numbers? Computers are supposed to calculate with exactitude. Computers are supposed to order the world. Computers are supposed to sift through reams of data and model possible outcomes, possible futures. Yet a function to create random numbers was present in the first Dartmouth BASIC. Every version of BASIC since then has had one or more ways to create random numbers. Finally, nearly every contemporary programming language, including Python, Perl, Java, JavaScript and C++, has a way to generate randomness. It turns out to be impossible to simulate a wide variety of situations and systems without taking into account randomness.
[Explain why exactly people purchased & used AMRD - what did they do with it? Also Reference the modern Parodies to it?]
Quite simply, randomness is required for any statistical endeavor needing random sampling or tests of probability. And one or two random numbers are not enough. Large-scale statistical calculations or simulations require large batches of random numbers. In her history of humans’ quest for randomness--which Bennett suggests goes as far back as ancient Babylonia (17)--Bennett highlights one of the early and largest set of random numbers, the RAND Corporation’s A Million Random Digits with 100,000 Normal Deviates (135). Generated in 1955 “by random frequency pulses of an electronic roulette wheel,” the RAND’s set of random numbers was an important contribution to any study of probability and is still in use today. As the forward to the undated online edition of the table notes:
The tables of random numbers in the book have become a standard reference in engineering and econometrics textbooks and have been widely used in gaming and simulations that employ Monte Carlo trials. Still the largest known source of random digits and normal deviates, the work is routinely used by statisticians, physicists, polltakers, market analysts, lottery administrators, and quality control engineers. (RAND Corporation)
Considering its sophisticated origins and uses, A Million Random Digits suggests a surprisingly unscientific method of using its tables: "In any use of the table, one should first find a random starting position. A common procedure for doing this is to open the book to an unselected page of the digit table and blindly choose a five-digit number" (RAND). Once again, it's randomness all the way down. This seemingly benign instruction aside, the RAND report ominously explains that its one million random numbers were originally “prepared in connection with analyses done for the United States Air Force” (RAND Corporation). Like so many other advances in computing, randomness, it turns out, is intimately linked to Cold War military strategies. In fact, most of the early work on computer-based random number generation was performed under the auspices of the U.S. Atomic Energy Commission (see, for example, Rotenberg’s work in the late fifties) or the U.S military (such as Green et al’s work at MIT, with joint support of the U.S. Army, Navy, and Air Force).
As Donald Knuth relates in The Art of Computer Programming, John von Neumann was the first to propose the idea of harnessing a computer to generate random numbers (Knuth 3). It was around 1946 and von Neumann was fresh off the Manhattan Project and soon to begin his lead work on the hydrogen bomb. Seeking a way to statistically determine the countless random factors that arise during each stage of the fission process, Von Neumann and his colleague Stanislaw Ulam originally relied the Monte Carlo method to generate tables of random numbers. These tables, however, soon grew too large to be stored on computers (Bennett 138-139). Von Neumann’s solution was to design a computer program to produce random numbers "on the fly," called the middle-square method. It worked by squaring an initial random number and extracting the middle digits; this number was then squared again, and the middle digits provided a new random number. The disadvantage of this method soon became apparent: because each number is a function of the one before it, the sequence, as Knuth explains, “isn’t random, but it appears to be” (Knuth 3)--a phenomenon known today as “pseudo-randomness,” which arguably describes any human or machine attempt to generate random numbers.
Knuth gamely admits that his own attempts to generate random numbers through software algorithms—using what he hoped to be a “’super random’ number generator”--failed, though it’s worth noting that he wanted his machine language program “to be so complicated that a man reading a listing of it without explanatory comments would not know what the program was doing” (Knuth 5). It does not take a leap of imagination to see in Knuth’s desire for obscure code an early version of the same kind of mystery residing in 10 PRINT.
To those interested in randomness and expressive culture, perhaps the most intriguing element of Knuth’s magisterial discussion of random number appears in a footnote. Knuth recalls a CBS television documentary in 1960 called “The Thinking Machine” which featured “two Western-style playlets” written by a computer (Knuth, 1969, 158-160). In fact, three playlets were acted out on national television that day in October, 1960, generated by a TX-0 computer housed at MIT’s Electronics Systems Laboratory. As journalist John Pfeiffer noted in a book released two years after the documentary, SAGA II, the script-writing program behind the mini-Westerns, took programmers Douglas Ross and Harrison Morse two months and fifty-five hundred instructions to develop (Pfeiffer, 1962, 130-138). The key to SAGA II were its thirty “switches,” which made “various alternative or branching paths” possible (136). "Among other things,” Pfeiffer observed, “the robber may go to the window and look out and then go to the table, or he may go to the table directly. You cannot tell in advance which one of these alternatives the program will select, because it does the equivalent of rolling a pair of dice” (136).
Computational Randomness in Aesthetic Design
Even before the SAGA II playlets, there were other literary experiments with randomness and computers. Noah Wardrip-Fruin identifies the British computer scientist Christopher Strachey as the creator of the first work of electronic literature, a series of "love letters" generated by the Ferranti Mark I computer at Manchester University in 1952 (Wardrip-Fruin 2005). Affectionately known as M.U.C., the Manchester University Computer could produce the evocative love letters at a pace of one per minute for hours on end without duplicating any love letter. The "trick," as Strachey put it, was the two model sentences (e.g. "My adjective noun adverb verb your adjective noun" and "You are my adjective noun") in which the nouns, adjectives, and adverbs were randomly selected from a list of words Strachey had culled from Roget's Thesaurus. Adverbs and adjectives randomly dropped out of the sentence as well, and the computer randomly alternated the two sentences. On the whole, Strachey is dismissive of his foray into the literary use of computers, using the example of the love letters simply to illustrate his point that simple rules can generate diverse and unexpected results (Strachey 1954). Nonetheless, a decade before Raymond Queneau's One Hundred Thousand Billion Poems, Strachey had unwittingly laid the foundation for the combinatory method of composition, a use of randomness that would grow more central to literature and the arts in the following decades.
The 1960s were a time for radical experimentation with randomness in the visual arts. Even though computers were an available tool to explore chance operations, they were used in a limited way because of problems of access to the machines and a general distrust of computer technology within the arts. The 10 PRINT program is remarkable because it was created at the time when these reasons for not using computers in the visual arts were disappearing; the C64 was relatively inexpensive and designed for home use. Also, the public image of the computer was changing from a machine that supported technocracies to a tool for self-empowerment and creativity.
Before personal computers, calculating machines could only be found in universities and research labs and because of the cost and perceived use. They were typically used exclusively for serious work, not for creating aesthetic images. When artists did gain access to these machines it was typically through artists-in-residence programs at companies such as Bell Labs and IBM, and through infrastructure such as Experiments in Art and Technology (E.A.T) based in New York and the Los Angeles County Museum of Art's Art and Technology initiative in Los Angeles. In fact, many of the first aesthetic computer graphics were made not by artists, but by mathematicians and engineers who were curious about the potential for other uses for the machines at their labs.
Within the first years that computer images were made, random processes were explored thoroughly. The first two exhibitions of computer-generated graphics appeared in art galleries in 1965 and both shows included pieces that were created using random values. In New York, the works of A. Michael Noll and Bela Julesz, both researchers at Bell Labs, were exhibited at the Howard Wise gallery from 6-24 April under the title “Computer-Generated Pictures”. In Stuttgart, the works of Georg Nees and Frieder Nake were exhibited at the Wendelin Niedlich Gallery from 5 - 26 November under the title “Computer-Grafik Programme.”
In 1962, Noll published a technical memorandum at Bell Labs titled “Patterns by 7090”, the number refers to the IBM 7090 digital computer. He explained a series of mathematical and programming techniques that use random values to draw “haphazard patterns” to a Carlson 4020 Microfilm Printer. The eight patterns documented in the memo are the basis for his Guassian Quadratic image, which was exhibited in the 1965 exhibition. Noll used existing subroutines of the printer to draw a sequence of lines to connect a series of x- and y-coordinates that he calculated and stored inside an array. The x-coordinates in the array were generated by a custom subroutine he wrote called WNG (White Noise Generator) which produced random values within the range of its parameters and the y-coordinates were set through a quadratic equation. Through this series of patterns, Noll explored aspects of the important aesthetic aspect of creating a tension between order and disorder, regularity and random values.
In 1965, Nake created his Fields of Rectangular Cross Hatchings series, which succeeds through pairing ordered patterns with random placement. Nake explained the way random values are used in the images:
Within a given (arbitrarily chosen) image size, a random number of hatchings were generated. Each one of them was determined by the following random variables: location (x, y), size (a, b), orientation of lines within rectangle (horizontal or vertical), number of lines, pen. So for each rectangle there were seven random numbers determining its details.
[More on NAKE's random work]
After the first wave of visual images were created on plotters and microfilm at universities and research labs, a few professional artists independently started to gain access to computers and use them in their practice. The artists with the most success in integrating a computer into their work had previously created drawings with logical systems. These artists continue to use computers in their work to this day. Vera Molnar [??]. Manfred Mohr started as a jazz musician and later studied art in Paris; he started writing software to create drawings in 1969 at the Meteorological Institute of Paris during the night after the researchers left for the day. Edward Zajec studied painting in Slovenia and the United States; he starting working with computers while teaching at Carleton College in 1968. Charles Csuri... Other artists who worked seriously with computers in the late 1960s, either individually or with technical collaborators, include Lillian Schwartz, Colette Bangert, Stan Vanderbeek, and Harold Cohen. All of them employed random numbers in their early works created with software.
[MOLNAR]
In 1971, Mohr's work was featured in “Une Esthétique Programmée” at the Musée d'Art Moderne de la Ville de Paris. This exhibition is distinguished as the first solo show of artworks created with a computer to be shown at a museum. Random values were used extensively in the creation of the work, much of it [MORE]
Charles Csuri's Random War (1967) is another early notable work of computer art to use random values. Like much of Csuri's early computer work and unique in relation to his contemporaries, the work is figurative rather than abstract. This plotter drawing is comprised of outlined military figures patterned off of the little green army men toys popular at the time. Each figure, named after a real person, is placed randomly on the page and given a random status: dead, wounded, or missing. The solders of one army are drawn in red and the other in black; the names and status of each soldier appear at the top of the drawing. In general terms, Csuri's work comments on the often arbitrary nature of war through both its form and content; more specifically, with his reliance on random number generation, Csuri gestures toward the days of computers and random numbers, and their inextricable link to the Cold War.
While the first decade of computer-generated art was well documented in magazines, books, and exhibition catalogs, there are fewer source materials from the 1970s as public interest veered and the energy needed to publish and exhibition waned. Later in the decade as computer graphics started to make their way into advertising and films, the public record picks up. The 1982 film Tron is a landmark in the history of computation and aesthetics. This film pushed the aesthetics of computer graphics to a new level and it therefore also revealed the limitations of computer imagery at that time. Specifically, the images are purely geometric and cold; they lack the organic qualities of our natural world. Ken Perlin, one of the programmers for the Tron CGI, was frustrated with the clean look and he later developed a technique called Perlin Noise in 1983 to generate organic textures with a random appearance, but fully controllable to allow for careful design. Perlin Noise allows computer graphics models to have the subtle irregularities of real objects; it's used to create hard surfaces such as rocks and mountains and softer systems like fire and clouds. By the 1990s, it was used extensively in Hollywood special-effects films and had been incorporated into most off-the-shelf modeling software.
Today, within the traditional visual arts, the most widely known artists that utilize random values still do so without computers. For example, 2002 Turner Prize winner Keith Tyson has designed sculptures entirely through rolling dice. Certainly, one reason for this reluctance to use computers is the stigma surrounding its use in art. Manfred Mohr, an pioneer of computer-generated art remarked in an interview, "I called my work generative art, or occasionally also algorithmic works. The problem was that no-one understood either of these terms, and I was forced -- so to speak -- to declare my drawings as art from the computer... people accused me of degrading art, because I was employing capitalistic instruments of war -- computer was a word non grata!".[ddaa p. 35] While Mohr was referring to the 1970s, the aversion to computers remains strong today within contemporary art.
Within the last decade, however, as a new generation of visual artists have started to program their work, computed random numbers have played an increased role in the visual landscape. The most prominent programming languages used by visual artists have functions for generating random numbers, noise values, and setting the random seed value to repeat a sequence. [More?]
With the perspective of time, it seems that aesthetic computational work and random values are intertwined. Writing in 1970, Noll highlights randomness as an essential feature of the computer in relation to the arts, “The computer is a unique device for the arts since it can function solely as an obedient tool with vast capabilities for controlling complicated and involved processes, but than again, full exploitation of its unique talents for controlled randomness and detailed algorithms could result in an entirely new medium – a creative artistic medium.”
Randomness in Contemporary Computing
Randomness is not always visible to the everyday user of computers, but is often used in ordinary computing tasks. Randomness plays an essential role in the security and networking systems of networked computers, for instance.
When a computer needs to generate a new password for a user, a URL that will let someone in to reset a password, or a CAPTCHA that will help to keep automated spammers out and allow access to legitimate users, randomness is employed. A regular password would allow for a password, URL, or distorted word that could be guessed. But randomness also plays a role behind the scenes of protocols such as SSH (Secure Shell) and SSL (Secure Sockets Layer). Random values are used in a few ways, including the generation of keys for encryption and to pad out the rest of a block when the plaintext message is too short to complete it. Without randomness, it wouldn't be possible to complete a secure credit card transaction on the Web, which is protected by an SSL connection. In fact, early versions of SSL as implemented in the Netscape browser suffered from being insufficiently random. The seeds for random number generation were the the current time, the process ID, and the parent process ID, which left the browser vulnerable to attack. The solution was better randomness.
[Random choice of wait time during exponential backoff for Ethernet.]
[Hashing? Simulation? Fault tolerance?]
[Games (of chance)]
The C64 and the RND Function
Ever since the 1950s, a function to generate a random number has been built into most computer systems. The earliest version of BASIC included such a function, the familiar RND command. As the manual for the first Dartmouth version of BASIC describes the function, RND(X) produced a "new and different random number" between 0 and 1 "each time it is used in a program" (39). As noted by the manual, however, each time a program was run, "the same sequence" of random numbers is generated. If a BASIC program generated a string of random digits such as 9, 0, 4, 1, 6, 4, it would produce the exact same numbers the next time the program ran. This lack of variation is an extreme example of what mathematicians call "pseudo-randomness"--a process or algorithm that appears to be random, but which, if left running long enough, will reveal itself to be a pattern. While the "pseudo" prefix would seem to denigrate this type of randomness as "not really" random, pseudo-randomness is generally acceptable, and in fact, desirable in many situations. For example, engineers running a computer simulation often need random variables, but they need those random variables to be the same with every run of the simulation; otherwise it is impossible to narrow down what process is actually being modeled in the simulation.
By the time of the Commodore 64, random number generation was more sophisticated than the original BASIC. The random numbers generated by the RND function on the Commodore 64 repeat themselves every 58,078 cycles--certainly a large enough output that the pseudo-randomness is undetectable to the average observer. Because the random numbers begin repeating themselves after 58,078 cycles, the slashes that comprise the walls of the 10 PRINT maze begin repeating themselves after 58,078 times. After approximately 40,000 screenfuls, then, 10 PRINT begins to repeat itself.
The C64 User's Guide introduces the concept of randomness using an example that sidesteps the origins of randomness in computing. There's no mention of nuclear fission or computer-generated literature. Randomness comes into play in the shape of a game, when it's necessary to, as the manual puts it, "simulate the throw of dice" (48)--an example that takes us back to pre-industrial notions of randomness.
The MOS6510 chip powering the Commodore 64 featured three ways of generating random numbers. The RND function in BASIC supplies two official means, while the sound chip provides another route. In addition to these out of the box methods, programmers could also write their own randomization algorithms, similar to the way Von Neumann or Knuth attempted to generate random numbers through mathematical functions. In C64 BASIC, a simplified means of generating a random number might look like this:
5 rem simplified random number generator 6 a = 1 10 a = a*2 20 if a >= 256 then goto 30 25 30 random = a: print random: goto 10
This program produces [insert string of random numbers generated by program]
Of course, it's inefficient to need an entire routine such as this to generate random numbers. This is where the C64's RND function comes into play. As described above, when RND(1) is called on the Commodore 64, a deterministic sequence of random numbers is produced. The precise algorithm is called a linear congruential generator (LCG), first proposed by Lehmer in 1949, though the C64 version includes additional byte-swapping. The LCG begins with a common seed, and nearly every C64 in the world will respond the same way to the maze program because they all rely on this mode of random number generation.
[INCLUDE MORE ABOUT LEHMER AND A EASY-TO-FOLLOW SUMMARY OF HOW LCG WORKS. IN ADDITION TO REPEATABILITY, ARE THERE OTHER IMPORTANT PROPERTIES WORTH GOING INTO?]
Another way of using the Commodore 64's built-in random number generation begins by using RND(0)--as opposed to RND(1). This method uses the MOS6510 chip's timer as a random number generator. [HOW, EXACTLY?] [AND WHY WOULD A PROGRAM USE RND(1) OVER RND(0)? WHAT ARE ADVANTAGES AND DISADVANTAGES OF EITHER METHOD?]
Finally, it is possible to generate random number on the Commodore 64 without using either RND function, relying instead upon the Sound Interface Device (SID) chip to produce random "noise." Reading the SID from register 27 (in decimal format) returns the current value of oscillator 3. If it's set to noise, the SID doubles as a random number generator. [IT'S UNCLEAR HOW THIS WORKS...MORE EXPLANATION NEEDED FOR NON-PROGRAMMING READERS]
[SUGGESTION: INTRODUCE THE FOLLOWING PROGRAMS BY DESCRIBING THE FUNCTION OF THE PEEK AND POKE AND WALKING READER THROUGH THE WAY THIS PROGRAMS CALL UPON THE SID]
5 s=54272:poke s+15,100:pokes+18,128 10 print peek(s+27):goto 10
10 s=54272:pokes+15,100:pokes+18,128:printchr$(205.5+(peek(s+27)and1));:goto10
5 s=54272:pokes+15,100:pokes+18,128 10 print chr$(205.5+(peek(s+27)and1));:goto10
6 poke 54272+wave, noise 10 print chr$(205.5+peek(54272+osc3read));goto 10
In addition to these methods of generating a random number in BASIC, it is possible to generate a random number on the C64 in assembly language:
Rand8 lda random ; get seed (must be non-zero) asl ; shift byte bcc Rand8.no_eor ; branch if carry flag not set after left shift eor #$CF ; otherwise EOR with literal $CF Rand8.no_eor sta random ; save number as next seed
Works Cited
Bennett, Deborah. 1998. Randomness. Cambridge Mass.: Harvard University Press.
Caillois, Roger. 2003. Man, Play, and Games. Trans. Meyer Barash. New York: The Free Press.
Ekeland, Ivar. 1996. The Broken Dice, and Other Mathematical Tales of Chance. University of Chicago Press, June 15.
Felder, H. 1968. The GPSS/360 random number generator. In Proceedings of the second conference on Applications of simulations, 21–28.
Green Jr, B. F, J. E. Smith, and L. Klem. 1959. Empirical tests of an additive random number generator. Journal of the ACM (JACM) 6, no. 4: 527–537.
Isida, Masatugu, and Hiroji Ikeda. 1956. Random number generator. Annals of the Institute of Statistical Mathematics 8, no. 1 (12): 119-126. doi:10.1007/BF02863577. http://www.springerlink.com/content/02510157q12768k4/.
Knuth, Donald E. 1969. The Art of Computer Programming. Vol. 2. Reading, Massachusetts: Addison-Wesley.
Lord, E. A., and S. Ranganathan. 2006. Truchet tilings and their generalisations. Resonance 11, no. 6 (6): 42-50. doi:10.1007/BF02838881. http://www.springerlink.com/content/w1577r5g78rx2033/.
Neumann, John von. 1961. Various Techniques Used in Connection with Random Digits. In Collected Works: Design of Computers, Theory of Automata and Numerical Analysis, ed. A.H. Taub, 5:768-769. Oxford: Pergamon Press.
Pfeiffer, John E. 1962. The thinking machine. Lippincott.
RAND Corporation. 1955. A Million Random Digits with 100,000 Normal Deviates. http://www.rand.org/pubs/monograph_reports/MR1418/index2.html.
Rotenberg, A. 1960. A new pseudo-random number generator. Journal of the ACM (JACM) 7, no. 1: 75–77.
Smith, Cyril Stanley, and Pauline Boucher. 1987. The Tiling Patterns of Sebastien Truchet and the Topology of Structural Hierarchy. Leonardo 20, no. 4: 373-385.
Strachey, Christopher. 1954. “The ‘Thinking’ Machine.” Encounter III (4) (October): 25-31.
Wardrip-Fruin, Noah. 2005. Christopher Strachey: The First Digital Artist? Grand Text Auto. August 1. http://grandtextauto.org/2005/08/01/christopher-strachey-first-digital-artist/.
[ THESE NEED FORMATTING
Noll, Michael A. "Patterns by 7090," Bell Telephone Laboratories Technical Memorandum, MM-1234-14, August 28, 1962.
“Art Ex Machina,” IEEE Student Journal, Vol. 8, No. 4, (September 1970), pp. 10-14.
Chance Imagery. George Brecht
The Dada painters and poets : an anthology / texts by Arp ... [et al.] ; illustrations after Arp ...[et al.] ; edited by Robert Motherwell ; with critical bibliography by Bernard Karpel
John Cage, Silence. MIT Press, 1966
Chance Aesthetics. Meredith Malone. Mildred Lane Kemper Art Museum 2009
Janice M. Glowski, Editor. Charles A. Csuri: Beyond Boundaries, 1963 – present. ACCAD, The College of the Arts, OSU. 2006 ]
