A computer is the most obedient machine ever built. It does exactly what it is told, the same way every time — which is precisely why it cannot, by itself, be surprising. And yet nearly everything we ask of it now depends on surprise: to simulate a galaxy or a pandemic, to shuffle a deck, to encrypt a message, to train a network, the machine must produce numbers that look like they were drawn from a hat. How does a perfectly deterministic device manufacture chance? It doesn't. It manufactures the illusion of chance — a stream of numbers each rigidly determined by the last, arranged so cunningly that no simple test can tell them from true randomness.
John von Neumann, who tried the first arithmetic recipe (the "middle-square" method) in 1946, saw the paradox with a clarity that has never been improved upon, and stated it as a joke that is also a warning.
"Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin." — John von Neumann, 1949
The sin is unavoidable; the craft lies in sinning well. In 1949 Derrick Lehmer proposed the recipe that would dominate for half a century — the linear congruential generator. Take a modulus m, a multiplier a, an increment c, and a seed X₀, then grind out the sequence by one line of arithmetic:
I · The RecurrenceOne line that never repeats too soon
Xn+1 = (a · Xn + c) mod m
Each number is the remainder of a multiply-and-add — cheap, and utterly deterministic. Because every value lies in {0, 1, …, m−1}, the sequence must eventually repeat; the only question is when. A generator whose cycle is shorter than m wastes most of its range and betrays itself quickly. Knuth devotes §3.2.1.2 to the conditions — the Hull–Dobell theorem — under which an LCG achieves the full period m: the increment must be coprime to m, and a−1 must be divisible by every prime factor of m (and by 4 if m is). Get those wrong and the illusion collapses at once.
But a full period is necessary, not sufficient. A generator can visit every value and still be deeply, fatally patterned — and the pattern is invisible in the raw stream. You have to look at it correctly. Plot each consecutive pair (Xn, Xn+1) as a point in the unit square, and the truth comes out of hiding.
Every linear congruential generator lays its points on a lattice of parallel lines. A bad multiplier packs them onto a few coarse stripes you can see across the room; a good one makes the lattice so fine it dissolves into apparent noise. Drag the Spectral Dial and watch the stripes multiply and vanish. This is the spectral test, performed by eye.
II · Random Numbers Fall in the PlanesThe spectral test
What you are seeing is not an artifact of the plot; it is the deepest structural fact about linear congruential generators. Because each term is a linear function of the last, the points (Xn, Xn+1) cannot be scattered freely — they are trapped on a regular lattice, and that lattice consists of a family of equally spaced parallel lines. In two dimensions you see lines; feed the same generator's triples (Xn, Xn+1, Xn+2) into a cube and you see planes. George Marsaglia announced this in 1968 with the greatest title in the literature: "Random numbers fall mainly in the planes."
The spectral test, which Knuth calls in §3.3.4 by far the most powerful test we have for these generators, simply measures the coarseness of that lattice: how few, and how widely spaced, are the hyperplanes onto which the points fall. A good generator's planes are so numerous and so tightly packed that no simulation can resolve them; a bad one's are few enough to distort any calculation that samples in that many dimensions.
The tragedy of RANDU: a = 65539, m = 2³¹. In two dimensions it looks flawless. But every triple it produces falls on just fifteen planes in the cube — and for a decade of Monte Carlo simulations, nobody looked in three.
Load the RANDU preset and drag nothing: the pair-plot is a convincing field of noise. That is exactly what made it so dangerous. IBM shipped it in the 1960s, it became the default on a generation of mainframes, and its three-dimensional catastrophe — fifteen planes where there should be millions — quietly biased published results in physics and chemistry before Marsaglia and the spectral test caught it. The lesson Knuth hammers home is that passing the tests you happen to run is not the same as being random; you must run the test that is designed to find the flaw.
III · Sinning WellWhat good randomness costs
The spectral test does not merely condemn; it guides. Knuth's Table 1 in §3.3.4 ranks multipliers by their spectral figures of merit, and the good constants — MINSTD's 16807, the multipliers inside modern generators — are precisely those chosen to maximize the spacing of the planes in as many dimensions as we can afford to compute. The linear congruential method survives today, in fast simulations and hash functions, wherever its speed is worth more than cryptographic strength, but always with constants that have paid the spectral toll.
"An algorithm must be seen to be believed." — D. E. Knuth
Where the LCG is not enough — where an adversary must not predict the next bit, or where thousands of parallel streams must not correlate — its descendants take over: the Mersenne Twister with its period of 2¹⁹⁹³⁷−1, the small fast PCG and xoshiro families, the cryptographic generators seeded from true physical entropy. But every one of them is judged by the same unforgiving standard von Neumann named and Knuth formalized: not "does it look random?" but "does it survive the test built to break it?" The illusion of chaos is only as good as the instruments we point at it — and the numbers that will decide whether you can trust the machine's next surprise were, all along, hiding in the planes.