Randomness

From Maze

(Difference between revisions)
Jump to: navigation, search
(→The C64 and the RND Function)
(→The C64 and the RND Function)
Line 99:Line 99:
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. Pseudo-random number generators are the only kind that are useful in hashing, since they allow data to be distributed widely but also placed in known locations.
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. Pseudo-random number generators are the only kind that are useful in hashing, since they allow data to be distributed widely but also placed in known locations.
−
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.
+
By the time of the Commodore 64, random number generation was more sophisticated than in 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 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.

Revision as of 16:03, 16 June 2011

View this revision of Randomness.

Personal tools