256 consecutive pairs from xₙ₊₁ = 137xₙ + 187 mod 256
lcg is one function. Everything below came out of it during this
build, at parameters taken from the essays rather than invented for this page — so a figure
here is the same figure a reader meets in an essay, and if the generator changes, this page
changes with it.
With nothing chosen
How far a filter spreads a generator's output
Half the patterns never happen
A filter that is its own undoing
The matrix that decides the spread
Two streams that look the same
What it checks while it draws
Collected by running the family and recording what it asserted, not written here. The count is how many separate times the claim was put to the test while these drawings were made.
- shift register, 17 bits rank at size 24 ×17
- the sampled yield at bias 0.2, depth 1, matches the recurrence ×12
- the XOR of 1 flips is 1 with probability ½(1 − (1 − 2p)^k) ×12
- and output 4, which was not ×11
- xorshift, 32 bits rank at size 40 ×10
- bit 0 of the state repeats every 2ᵏ⁺¹ steps ×8
- all 4 windows of 2 bits occur somewhere in the period ×7
- at 2 digits the middle square lasts a fraction of a random map's run ×4
- seed 6239 repeats after the step the census says ×4
- the recovered rule matches output 0, which was given ×4
- the modulus is a whole number between 16 and 65536 ×3
- the register of 4 bits visits every nonzero state before repeating ×3
- xorshift128+, lowest bit rank at size 144 ×2
- 32 bits cover 12 cards, 64 bits 20, and 128 bits fall short of 52 ×1
- 52! is about 2^225.58 ×1
- a 32-bit seed reaches at most one deck in 10^58 ×1
- a coin that can land either way ×1
- a lone 1 spreads to a handful of bits in the first ten twists and to about half the state within eight hundred ×1
- a multiplier consistent with the outputs exists ×1
- a multiplier is a whole number between 2 and 1048576 ×1
- a sample with two repeated gaps turns up quickly ×1
- a short vector the modulus annihilates exists ×1
- a state holding one small number starts in zeroland as a single bit does ×1
- an even number of flips drawn, so they pair up ×1
- and arrives at p(1 − p) bits per flip ×1
- and it is a de Bruijn sequence: every window of that width, exactly once ×1
- and its neighbouring output bits are correlated ×1
- and never exceed the Chor–Goldreich bound ×1
- and so is the second ×1
- and the all-zero window never appears ×1
- and the outputs cover as many values as random draws would ×1
- and the plain generator's ×1
- and they occur equally often, but for the one the all-zero state would have supplied ×1
- and visits every sixteen-bit state once ×1
- and visits none of them twice ×1
- applying the filter twice returns the word ×1
- at k = 16m nearly every run of the generator lands in the Poisson tail ×1
- at k = 16m nearly every run rejects, for every period from 2^12 to 2^30, with multipliers of merit above 0.97 ×1
- below its state size the generator gives nearly full rank ×1
- between 32 and 256 steps ×1
- bit b of the high byte is state bit b + 8, repeating every 2ᵇ⁺⁹ steps ×1
- bits above the lowest few are nonlinear and give nearly full rank ×1
- each card below the top is most likely to end one place higher than it started ×1
- each card ends somewhere ×1
- each extra level adds, and none passes the entropy ×1
- each item ends somewhere ×1
- each of them exactly once ×1
- each order's probability is a whole number of runs over 256 ×1
- each output bit is the sum of the bits five and two places before it ×1
- each window is between one bit and the register's width ×1
- every generator's points fall on a genuine family of parallel lines ×1
- every one of the 200 starts escapes within two million outputs ×1
- every order Sattolo's shuffle produces is a single cycle ×1
- every output bit of the permuted generator has the full period ×1
- every point of the sequence satisfies the relation exactly ×1
- every random rectangle obeys Lindsey's bound ×1
- every recurrence escapes within the outputs computed ×1
- every seed ends in exactly one cycle ×1
- Fisher–Yates gives every order of six cards the same chance ×1
- for decks of three to eight cards the unshuffled order is never the most likely ×1
- four outputs pin the permuted generator's state down to one ×1
- from the low bits only 22,282 orders appear, from the high bits a little more than a random assignment would give ×1
- how many high bits are predicted is a whole number between 1 and 8 ×1
- inside a single row of cells, the occupied cells have at most six different gaps ×1
- Lindsey's lemma: the rectangle's sum is at most √(|A||B|N) ×1
- middle-square seeds repeat in less than half the steps a random map's would ×1
- no filter passes the ceiling ×1
- no four-digit cycle is longer than four ×1
- no matrix from a linear generator exceeds the state size in rank ×1
- no more rows than state bits ×1
- no short whole-number relation holds between consecutive outputs ×1
- on the two perpendicular sets every entry is the same ×1
- only the 32-bit linear generator fails at forty ×1
- pairs, triples and quadruples all match λ at k = m and leave it a few doublings later ×1
- random points and the generator at k = m/16 both match the Poisson law closely ×1
- rank of the 192 × 192 grid from xorshift128+'s lowest bit ×1
- rank of the 48 × 48 matrix from the 32-bit xorshift ×1
- rank of the nine-by-nine grid from a five-bit register ×1
- raw, beyond one bit, only three outputs in a row are evenly spread — the three words of state ×1
- raw, the patterns that occur number 2^rank ×1
- Sattolo's shuffle of six cards produces exactly the 120 orders that are a single cycle ×1
- six cards identify every one of the 2²⁰ seeds ×1
- six digits: seventeen cycles, the longest of 210 ×1
- some card-and-place pairs are a third more likely than fair and some a quarter less ×1
- sources on coordinate blocks give bias ½·2^−(overlap) ×1
- tempered the rows are independent and raw they are not ×1
- tempered, every pattern occurs equally often but zero, which is one short ×1
- tempered, likewise ×1
- tempered, the rank is full ×1
- tempering never makes the spread worse at any depth ×1
- the 256 runs of four steps are shared among the 24 orders ×1
- the 65,536 states reach 62,616 of the 362,880 orders of nine cards ×1
- the all-zero state is the one the register cannot leave ×1
- the all-zero window is the one that is short, by exactly one ×1
- the bare rule from this seed visits only a handful of values ×1
- the bias grows with the deck ×1
- the catching sample is the cube root of 128m ×1
- the criterion and the measured period agree ×1
- the dimension is a whole number between 2 and 3 ×1
- the drawn steps compute the generator's output ×1
- the example word is a whole number between 0 and 255 ×1
- the fifteen gaps add up to the span and two of them repeat an earlier gap ×1
- the filter sends the 256 words to 256 different words ×1
- the first outputs are almost all zeros and those after 400,000 are not ×1
- the first prime is a whole number between 3 and 4000 ×1
- the first prime is three modulo four, which the construction requires ×1
- the first seed is one of the longest-lived ×1
- the flips drawn is a whole number between 8 and 48 ×1
- the high byte's triples fail it by far ×1
- the highest tap is the register's own width, or it is a shorter register ×1
- the increment is a whole number between 0 and 1048576 ×1
- the inner product is closer to fair than either simple rule ×1
- the larger and sparser the recurrence, the later it escapes ×1
- the last item stays last about half the time ×1
- the least likely order is the last card moved to the top, every other card one place down ×1
- the linear solve, run on this generator, predicts the next output wrongly ×1
- the low bits put cards in some positions far more often than others ×1
- the modulus is small enough that the arithmetic stays exact ×1
- the multiplied generator gives a nearly full rank ×1
- the multiplier 229 passes the two-dimensional spectral test well ×1
- the multiplier is a whole number ×1
- the multiplier is a whole number between 2 and 1048576 ×1
- the multipliers really do differ, by more than a factor of two in spacing ×1
- the multiplying generator passes the rank test at 32 ×1
- the number of outputs it then predicts is a whole number between 2 and 16 ×1
- the number of outputs the solver is given is a whole number between 3 and 8 ×1
- the number of points is a whole number between 16 and 4096 ×1
- the number of predictions is a whole number between 50 and 4000 ×1
- the number of triples is a whole number between 100 and 4000 ×1
- the occupied hyperplanes are consecutive, so the family has no gaps ×1
- the output is balanced to within sampling error ×1
- the output of the sticky source is balanced ×1
- the output shows every nonzero window of the register's width ×1
- the outputs drawn is a whole number between 16 and 96 ×1
- the patched sequence is as long as there are windows ×1
- the pattern is eight bits, so it fits a 16 × 16 grid ×1
- the permuted output leaves the share of empty cells a random sequence would ×1
- the permuted output's triples pass the chi-squared test ×1
- the plain recurrence matches λ up to k = m and leaves it from k = 16m on ×1
- the plain recurrence reaches 256 cells with ten gap lengths, the scrambled one with over forty ×1
- the plain recurrence's reachable cells never have more than forty different gaps; the scrambled ones have over a thousand ×1
- the predictor gets essentially every output right ×1
- the rectangle is one of random, subspace ×1
- the register does not repeat before its full period ×1
- the register visits every non-zero state before repeating ×1
- the register width is a whole number between 5 and 14 ×1
- the relation involves the middle coordinate, so an edge-on view exists ×1
- the relation involves the second coordinate ×1
- the relation's normal lies in the screen, so the planes are seen edge on ×1
- the scrambled states stay at λ however fine the cells ×1
- the second prime is a whole number between 3 and 4000 ×1
- the solver is given only a handful of outputs ×1
- the state is a sixteen-bit number ×1
- the state returns to its start after exactly 2¹⁶ steps ×1
- the state's own bytes leave far more empty ×1
- the taps are positions inside the register ×1
- the top card is equally likely to end anywhere, and every card is equally likely to end at the bottom ×1
- the triples lie on a small number of planes ×1
- the twisted generator runs through every non-zero state before repeating ×1
- the twister reproduces its reference outputs for the seed 5489 ×1
- the twister's own seeding puts out half ones from the first block ×1
- the two multipliers give different numbers of lines ×1
- the vector really does annihilate every point ×1
- the view is one of compare, period, planes, lfsr, spectral, recover, nextbit, bbs, equi, vneumann, rates, sticky, xor, kdist, patterns, rankgrid, temper, raster, twosourcegrid, lindsey, twosourcebias, twosourcesim, pcgbits, pcgpairs, pcgmachine, pcgtriples, pcgrecover, pcgperiods, mswalks, mstails, mscycles, msscale, msweyl ×1
- the width of the register is a whole number between 3 and 6 ×1
- three to eight multiplier-and-increment pairs ×1
- three to six bits ×1
- two multipliers below the modulus ×1
- two taps ×1
- which is enormously better than guessing the leading bits ×1
- while the independent coin's output shows no correlation ×1
- with the counter, no state repeats in the run ×1
Where it is called
Every figure on this list is drawn by the same rule, so a change to the rule changes all of them at once. That is why the list is published.
A filter that changes only the spread
The generator most simulations use passes every output through a last scrambling step before anyone sees it. The step is reversible, it changes nothing about the period, and it cannot make the generator any less predictable. What it changes is which patterns of consecutive outputs can occur at all — on a small twisted generator, from half of them to every one.
ComputationA grid of bits whose rank stops at the state
Fill a square grid with a generator's output bits and compute its rank over the field of two elements. Random bits give full rank or one short, in fixed proportions. A generator built from shifts and exclusive-ors gives full rank up to its number of state bits and then never one more — 32 for a 32-bit xorshift, 128 for the lowest bit of xorshift128+ — however large the grid. The test that catches it is decided by a line of linear algebra.
ComputationA memory of four bits
A register holding four bits, shifting them along and adding two of them back, runs through all fifteen nonzero states before it repeats. Which two are added back is a question about a polynomial, and getting it wrong costs fourteen of the fifteen.
ComputationA page that knows where it is
A four-by-four array of bits, cyclic in both directions, in which every two-by-two block appears exactly once. Print it repeatedly across a sheet and any four marks on that sheet are an address.
ComputationA perfect coin and a biased shuffle
Give a program a perfect source of random numbers and ask it to shuffle a deck by swapping each card with a card chosen from anywhere in the deck. The result is biased, provably and for every deck of three or more cards: there are nⁿ equally likely runs and n! orders, and the first number is never a multiple of the second. In a deck of 52 some card-and-place pairs come up a third more often than they should. Swapping only with cards not yet placed fixes it; swapping only with later cards makes nothing but single cycles.
ComputationA rotation that hides the lattice
A congruential generator modulo a power of two has a lowest bit that alternates and pairs of outputs that lie on a few lines. Keep the generator exactly as it is, and show only eight bits of each state, rotated by an amount the state's own top bits choose: every output bit now runs the full cycle, the pairs fill the square as a random sequence would, and triples pass a test the state's own bits fail by a factor of six. Nothing about the state has changed, and four outputs still give it away.
ComputationA seed is a deck
A shuffle that is perfectly correct, driven by a generator that passes every statistical test, can still deal almost none of the possible decks. A shuffle program is a function from the generator's starting state to an ordering of the cards, so it can never produce more orderings than the generator has states: a 32-bit seed reaches one deck in about 10⁵⁸. On nine cards and a 16-bit generator every case can be checked — 62,616 of the 362,880 orders are ever dealt — and on a full deck, six cards on the table are enough to name the seed and every card still to come.
ComputationBirthdays spaced too evenly
Scatter n birthdays through a year of k days, sort them, and count how many of the gaps between neighbours repeat an earlier gap. For random birthdays the count is close to a Poisson variable with mean n³/4k. A linear congruential generator with m states, read in pairs, matches that law until the grid has as many cells as the generator has states, and then leaves it at once: at sixteen times as many cells, every run of the spacings count rejects it. The sample that catches it is about five times the cube root of the period — 8,192 outputs for a 32-bit generator, thirteen million for a 64-bit one — and the same states, scrambled before they are read, pass.
ComputationFair bits from an unfair coin
Read a biased coin's flips in pairs, keep 01 as 0 and 10 as 1, and throw away the rest: the output is exactly fair, whatever the bias, and nobody needs to know the bias. The trick wastes most of the coin, the waste can be recycled almost up to the ceiling Shannon's entropy sets — and it fails quietly the moment the flips remember each other.
ComputationFour numbers and the rule is yours
A linear generator can be solved. Given a few of its outputs, the multiplier and the increment fall out of two congruences, and every future output is then known exactly — which is a failure of a completely different kind from the lattice defect, and is not detected by any test of how evenly the points are spread.
ComputationNineteen thousand bits of state
The generator most simulations actually use is not clever. It is a linear recurrence over the two-element field with an enormous state, and its virtues are a proved period, a proved equidistribution and speed — none of which is unpredictability, which it does not have and does not claim.
ProbabilityPoints too even to be random
Independent random points clump, and the clumping is what makes the error fall only as the square root. Points chosen to be evenly spread rather than independently beat that rate, and the price is that nothing about them is random at all.
ComputationRandomness that has to be earned
A generator that resists prediction cannot be built out of a rule anybody can fit. It has to be built out of a computation believed hard to undo, and the belief is the load-bearing part — which makes cryptographic randomness a conditional statement rather than a construction.
ComputationSquare it and keep the middle
John von Neumann's first generator of random numbers squared a number and kept its middle digits. Followed from every four-digit seed, it never lasts more than 111 steps before a value repeats — a third of what the birthday problem allows a truly random rule — and one seed in five ends at zero for ever. A counter added before each squaring cures the collapse.
ComputationThe planes a recurrence cannot leave
One multiplication and one addition, taken modulo a fixed number, produce a sequence that passes for random one value at a time. Taken two or three at a time it does not, and the reason is a whole-number relation that pins every point onto one of a small family of parallel lines.
ComputationThe test that ranks the generators
Every linear generator's output lies on a family of parallel planes. Which generator is better is decided by how far apart those planes are, and that distance is the length of the shortest whole-number vector the modulus annihilates — a quantity that can be computed exactly rather than estimated by testing.
ComputationThree hundred thousand outputs of nearly nothing
Start the Mersenne twister from a state with a single 1 among its 19,937 bits and it puts out zeros, then sparse ones, and only after about 340,000 outputs anything that looks random. Every linear generator has such a zeroland around the all-zero state; xorshift128 crosses it in 37 outputs, WELL512 in 44, and the twister's three-word twist makes it the slowest of all by four orders of magnitude.
ComputationTwo weak sources make one fair bit
No fixed rule can turn every weakly random source into fair bits: for any rule, some source with almost full unpredictability makes it constant. Two independent sources are different. Multiply their bits in pairs, add, and keep the parity — and if the two together carry more unpredictability than the length of one, the result is nearly fair, whatever else the sources do. The reason is that the table of those parities is balanced on every large rectangle.