Field

Computation — page 4

A fixed set of operations, and the exact question of what it can and cannot build.
The longest code that survives every erasure pattern, by field and dimension. q 2, k 2: 3; q 2, k 3: 4; q 3, k 2: 4; q 3, k 3: 4; q 3, k 4: 5; q 4, k 2: 5; q 4, k 3: 6; q 4, k 4: 5; q 4, k 5: 6; q 5, k 2: 6; q 5, k 3: 6; q 5, k 4: 6; q 5, k 5: 6; q 5, k 6: 7; q 7, k 2: 8; q 7, k 3: 8; q 7, k 4: 8; q 7, k 5: 8; q 7, k 6: 8; q 8, k 2: 9; q 8, k 3: 10; q 8, k 4: 9; q 8, k 5: 9; q 8, k 6: 9; q 9, k 2: 10; q 9, k 3: 10; q 9, k 4: 10.

The longest code that survives every erasure

A Reed–Solomon code of k symbols can lose any n − k of its n and still be read. Over an alphabet of q symbols it can be at most q + 1 long — and it is conjectured that no code with the same perfect tolerance can ever be longer, apart from one family of exceptions in even characteristic. A search through every possible code for small alphabets confirms it cell by cell, a proof exists when q is prime, and for every other q the question is open.

Six permutations as six arrows between three symbols. A directed graph with 3 vertices and 6 arrows, one per permutation of 3 symbols in shorthand, every vertex with two arrows in and two out, numbered in the order of an Euler circuit spelling 213231.

Every ordering once, around a cycle

No cycle can show every ordering of three symbols as a window of three: a window holding each symbol once forces the next symbol to repeat the one just dropped, so the sequence has period three and shows three orderings of six. Two repairs work. Write each ordering by its first two entries and the transitions form a balanced graph, so Euler's theorem hands over the cycle at once. Or add a fourth symbol and ask only that each window keep a different relative order — which works too, but no graph explains why.

The most nearly equal dissections of a square into 3, 5 and 7 triangles found. 3 triangles, areas 0.25000, 0.50000, 0.25000, spread 2.5000e-1; 5 triangles, areas 0.19098, 0.21353, 0.19098, 0.19098, 0.21353, spread 2.2543e-2; 7 triangles, areas 0.14151, 0.14458, 0.14151, 0.14458, 0.14151, 0.14174, 0.14458, spread 3.0711e-3.

How nearly equal an odd number of triangles can be

A square cannot be cut into an odd number of triangles of equal area. It can be cut into five triangles whose areas differ by about two hundredths, seven that differ by three thousandths, nine by a ten-thousandth and a half — the spread falling by a factor of seven or more with every two triangles added, closing on equality and never reaching it. A search for the closest finds that the best five it can make have the golden ratio in their areas.

A random Latin square of order ten with an orthogonal mate. A 10 by 10 grid with a uniformly random Latin square and an orthogonal mate written into each cell; the square has 848 transversals.

A mate is rare until order ten

Euler asked whether a Latin square can have an orthogonal mate, and for every order but two and six the answer is yes for some square. For a square chosen at random the answer is different. Exactly 6 of the 56 reduced squares of order five have a mate and none of order six does; of squares drawn at random, about one in a hundred of order seven has one, one in three hundred of order eight, one in seventy of order nine — and three in five of order ten.

The low bits of a congruential generator, and the bits a permutation shows. First 128 steps of a 16-bit congruential generator: low state bits with periods 2, 4, 8, 16, 32, 64, 128, 256; permuted output bits all with period 65536.

A 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.

A Lights Out board and the presses that clear it. A 5 by 5 board with 11 lights on, cleared by 7 presses; it has four solutions in all.

The boards on which every light goes out

In Lights Out, pressing a light toggles it and its neighbours, and the goal is to turn every light off. Over the field with two elements the puzzle is a system of linear equations, and whether every pattern can be cleared depends only on whether one matrix is invertible. On a 3 × 3 board it is; on 5 × 5 a quarter of patterns can be cleared; on 39 × 39 one in four billion. Which sizes fail is decided by a common factor of two polynomials.

No pair of weights modulo ten catches everything. Two 10 × 10 grids over pairs of alternating weights modulo ten, shaded by the share of single errors and of swaps each catches. No pair is full in both; weights 3 and 1, ringed, catch every single error and 88.9% of swaps.

Ten digits need a symmetry that does not commute

A check digit should catch one wrong digit and two neighbours swapped. Over eleven symbols a weighted sum does both; over the ten decimal digits no weighted sum can, no scheme of any shape built on adding modulo ten can, and the reason is the same as the reason Euler's thirty-six officers cannot be paraded. What works is the ten symmetries of a pentagon, which do not commute.

Four seeds of the middle-square method, each until it repeats. Values against step for the four-digit seeds 6239, 1234, 5735, 4100 under the middle-square rule, each ending where a value repeats: after 111, 57, 31, 4 steps.

Square 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.

The centre of a circle found with six circles and no straightedge. A circle with two marked points 37.3° apart and the six compass circles that construct its centre.

The centre a compass finds in six circles

A circle is drawn and its centre was never marked. A straightedge alone can never find it again. A compass alone can, from two points on the circle, in six circles — and a search through every construction of five circles or fewer shows that six is the least. The reason six works is an inversion that turns the circle into a straight line; the price of discarding the straightedge is exactly one move.

The price of the centre, arc by arc. 10°: 5, 15°: 4, 20°: 4, 25°: 6, 30°: 3, 35°: 6, 40°: 6, 45°: 5, 50°: 5, 55°: 6, 60°: 2, 65°: 6, 70°: 5, 75°: 4, 80°: 6, 85°: 6, 90°: 5, 95°: 6, 100°: 4, 105°: 4, 110°: 5, 115°: 6, 120°: 6, 125°: 6, 130°: 5, 135°: 5, 140°: 4, 145°: 6, 150°: 3, 155°: 6, 160°: 6, 165°: 4, 170°: 5, 175°: 6.

The arcs that make the centre cheap

Finding a circle's centre with the compass alone, from two points on it, costs six circles when the points are placed with no special relation — and as few as two when the arc between them is 60°. Searching every arc in steps of five degrees maps the price exactly, and it is not a smooth function of the arc: it is a list of coincidences, each one a small number of compass steps that happens to land on a chord equal to the radius.

Every swap-proof scrambling, graded on twins and jump swaps. 34040 permutations; twin errors caught range 50–86 of 90, jump transpositions 600–848 of 900; Verhoeff's at (848, 86).

The best of thirty-four thousand scramblings

Verhoeff's check digit multiplies digits in the symmetry group of a pentagon after scrambling each one a different number of times, and 34,040 scramblings make it catch every swap of neighbours. Graded on the rarer errors, none of them catches everything, the best catch 86 of 90 doubled-digit slips and 848 of 900 swaps across a digit — and the scrambling Verhoeff published in 1969 is one of the forty that are best at both.

Every light on, on a board where most patterns are out of reach. A 5×5 Lights Out press pattern of 15 presses that turns all 25 lights on; the board's quiet space has dimension 2.

Every light on, from every light off

In Lights Out, pressing a light toggles it and its neighbours. On a five-by-five board only one pattern in four can be reached from all off — and yet all on is always one of them. The same is true on every board and on every network of lights whatever, provided the influence runs both ways. The proof is a single observation about symmetric matrices over a field with two elements, and it fails, as a three-arrow example shows, the moment influence runs one way.

Two grids of random-looking bits, one of rank thirty-two. 48 by 48 bit matrices: xorshift32 low bits, rank 32; xorshift32 multiplied, rank 47.

A 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.

When a press skips its own light: one board lit, one proved impossible. 4 by 4: solved with 10 presses; 5 by 5: unsolvable, witness set of 5 lights each seeing an even number of the set.

When a press skips its own light

In Lights Out every board can be turned from all off to all on, because each press toggles its own light. Change the rule so a press toggles only the neighbours and the guarantee is gone: 310 of the 3,600 boards up to sixty by sixty cannot be lit. A single comparison of powers of two predicts every one of them, and on general graphs the answer depends on whether the number of vertices is odd or even, for a reason that is one line of algebra.

Press everything and the odd degrees light. Pressing every vertex lights exactly the odd-degree vertices; all 1024 all-odd-degree graphs on 6 vertices are litable; overall 18259 of 32768.

Half the chance for every silent set

In the lights game where a press toggles only the neighbours, a random network can be lit about 56 times in a hundred when it has an even number of vertices and 44 when odd. The numbers are 0.560562 and 0.439438, they add to one, and they come from a chain: each new vertex raises or lowers the dimension of the silent sets by one, and each dimension halves the chance.

Four generators climbing out of zeroland. Output ones-density from a one-bit start reaches 0.45 after: MT19937 374000, TT800 4500, WELL512 44, xorshift128 37.

Three 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.

Ten dots that never repeat a step. Welch array p=11, g=2: 0,1,3,7,4,9,8,6,2,5; difference triangle rows: 1 2 4 -3 5 -1 -2 -4 3 / 3 6 1 2 4 -3 -6 -1 / 7 3 6 1 2 -7 -3 / 4 8 5 -1 -2 -4 / 9 7 3 -5 1 / 8 5 -1 -2 / 6 1 2 / 2 4 / 5.

Dots that never repeat a step

Place n dots on an n-by-n grid, one in each row and column, so that no two pairs of dots are joined by the same step. These Costas arrays were invented for sonar, and finite fields build them: a primitive root modulo a prime gives one family, a pair of primitive elements in any finite field another. Yet the constructions account for almost none of the arrays that exist — 92 of the 2,160 of order ten — and for orders 32 and 33 nobody has found a single one.

Fifty-two cards, swapped the naive way. Naive shuffle, n=52: max ratio 1.3522 at card 2 → place 1; min ratio 0.7429.

A 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.

Every ordering of four in thirty-three symbols. 123412314231243121342132413214321: windows 1234 2341 3412 4123 (1231) 2314 3142 1423 4231 (2312) 3124 1243 2431 4312 (3121) (1213) 2134 1342 3421 4213 (2132) 1324 3241 2413 4132 (1321) 3214 2143 1432 4321.

The shortest string holding every ordering

Thirty-three symbols hold all twenty-four orderings of 1, 2, 3, 4 as blocks of four in a row, and no shorter string does. The formula 1! + 2! + … + n! gives the shortest length for up to five symbols and was believed for all of them — until a string of 872 for six beat its 873, and a lower bound posted anonymously on a forum left everything between 867 and 872 open.

Two hundred and three points from two. After two rounds: 203 points, 11 rational, 76 in ℚ(√3) but not rational, 116 needing a new square root (√2: 20, √5: 22, √7: 14, √11: 36, √13: 20, √35: 4); 10 lines and 16 circles in the second round.

What two points build in two rounds

Start with two points and draw every line and circle they allow; mark every crossing; do it again. The first round gives six points, the second gives 203, and the third gives over 1.7 billion. Computed exactly, the 203 points show the tower of square roots growing in real time — eleven rational points, seventy-six that need √3, and the rest needing one of six new square roots.

Every order of nine cards, and the ones a seed can reach. 16-bit LCG, 65,536 seeds, Fisher–Yates on 9 cards (high bits): 62616 of 362880 orders reached.

A 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.

The cells a small generator can reach. m = 256, a = 229, 64×64 cells: plain 256 cells, 10 distinct gaps; scrambled 252 cells, 46 distinct gaps.

Birthdays 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.

All essays