Shuffle
A diamond of squares fills with dominoes, each round sliding every tile one step the way it was born facing, destroying the pairs that would collide, and filling the holes with a coin. What grows is a tiling chosen uniformly at random from 28,256 possibilities, and in it a theorem: the corners lock into brickwork, and all the disorder lives inside a circle nobody drew. Press and drag sideways to bias the coin, then let go; the circle becomes the ellipse the bias predicts. R reshuffles, F returns the coin to fair.
what this is
The Aztec diamond is the diamond-shaped stack of unit squares, and a domino covers two of them. In 1992 Elkies, Kuperberg, Larsen and Propp proved that the diamond of order n has exactly 2 to the power n(n+1)/2 tilings, and gave the algorithm this page runs to pick one with every tiling equally likely: grow the diamond one order at a time, let each domino slide one step in the direction fixed at its birth, remove the pairs that would pass through each other, and fill the empty two-by-two blocks with a coin. That the result is exactly uniform is a theorem, not a hope, and the gates below hold the code to it.
The picture the uniform tiling makes is the surprise. Near the four corners the tiles have no room to disagree and lock into brickwork, one direction to a corner; near the middle they mix. Jockusch, Propp and Shor proved in 1998 where the one gives way to the other: at the circle inscribed in the diamond, exactly, in the limit. Order is not imposed at the corners and disorder is not planted in the middle; both follow from counting. When the coin is biased the circle becomes an ellipse with semi-axes proportional to the square roots of p and 1 minus p, still tangent to all four sides, and this page measures it live each time the tiling comes to rest.
This is the third of a family. Topple counted the sandpile's recurrent states, Erase drew the spanning tree that counts them, and Shuffle tiles the diamond; all three are lattices where an exact theorem survives contact with a picture. The determinant that counts spanning trees is Kirchhoff's; the one that counts tilings is Kasteleyn's. Different determinants, the same lesson: the number of ways a thing can be arranged is itself a shape, and at this size the shape is visible to the naked eye.
the gates
Six checks were fixed in the project notes before any code existed and run headless against the same engine the page draws from.
- 1 · the count, exactly
Held: an independent enumeration, sharing no code with the shuffle, counted the tilings of orders one through six as 2, 8, 64, 1024, 32,768 and 2,097,152, each equal to 2 to the n(n+1)/2. - 2 · census of every round, exactly
Held: growing to order 128, after every one of the 128 rounds, every cell covered exactly once and 16,512 dominoes at the end, which is 128 times 129. - 3 · uniform, chi-square in band on two orders and two seeds
Held: all 8 tilings of order two seen in 40,000 runs, chi-square 8.3 then 5.2 on 7 degrees of freedom; all 64 of order three in 64,000, chi-square 66.2 then 56.3 on 63. - 4 · the height function, exactly
Held: every tiling carries a whole-number height field, rising one crossing no tile and falling three crossing one; on 10 sampled tilings of order 128 the field closed consistently around every face. - 5 · the arctic circle, radius and area within 3 percent
Held, and it is the gate that taught something: the first measurement failed its area half at 8.2 percent because the instrument counted brick pockets inside the disc as frozen. The radius said the geometry was right, so the instrument was corrected in the open and the tolerance left untouched. Second run, at order 256 eight times: boundary radius 179.8 against 181 (0.7 percent), enclosed area fraction 0.7717 against 0.7823 (1.36 percent). - 6 · the biased ellipse, axis ratio within 5 percent
Held: at order 192 with the coin at 0.7, eight samples fit semi-axes 162 by 102.8, ratio 0.6346 against the predicted 0.6547 (3.06 percent), long axis where the theorem puts it.
the picture
Each domino keeps the tone of the direction it was born facing, four greys in all, so the frozen corners read as four flat fields and the disc as a mixed weave; the circle is only the border between the two, drawn by nobody. The view recedes as the diamond grows. At rest the tiling is not finished, because a tiling never is: it keeps moving by the one local move tilings have, a two-by-two block of parallel tiles turning crosswise. Such a block needs two tiles in agreement, which happens only where there is disorder, so the stillness of the corners and the shimmer of the disc are the same fact twice. Monochrome, procedural, no paid instruments.