home/ atoms/ pseudo-randomness

Computer-generated randomness is always pseudo-random, not truly random

A deterministic machine cannot produce truly random numbers. Processing’s random() function uses mathematical formulae typically seeded by the system clock to produce sequences that appear random but are fully determined by the formula and seed. This is called pseudo-randomness. For generative art purposes, pseudo-random values are perceptually indistinguishable from true random. Understanding it matters for reproducibility: the same seed produces the same sequence. Fixing the seed with randomSeed() allows fully reproducible generative output — useful for debugging or edition printing.

Examples

random(460) + 20 returns a pseudo-random float between 20 and 480. Run the same sketch twice with different clock seeds and you get different results. Call randomSeed(42) at the start and you get identical results each run.

Assessment

Explain why a computer cannot produce a truly random number, and describe one situation in generative art where the distinction between pseudo-random and truly random matters practically.

“Almost all programming languages include a function equivalent to Processing's random function, but returning a truly random number is an impossibility for a predictable machine. Computer-generated randomness is always pseudo-random, using mathematical formulae”
corpus · generative-art-a-practical-guide-using-processing-matt-pears · chunk 18