Every square in this grid is a tiny magnet that points one of two ways, gold or blue. Each one would like to agree with the four magnets next to it, and heat keeps knocking it about. Hot, the grid is a restless mixture. Cold, it is all one colour. The change between them does not come gradually. It comes at one temperature, and that temperature is known exactly.
For the curious kid.
The rule for one magnet is simple. Now and then it looks at its four neighbours. If flipping over would make it agree with more of them, it flips. If flipping would make it agree with fewer, it usually stays, but sometimes it flips anyway, and the hotter the grid the more often that happens. That is all. No magnet can see further than the ones it touches, and none of them knows what colour the grid as a whole is.
Press Cool it slowly. At first nothing much changes: gold and blue stay level, in patches that form and melt. Then, as the temperature passes 2.27, the patches stop melting. They join up, one colour gets ahead, and within a few degrees it has the whole grid. Watch the dots on the upper chart. They sit on the floor, and then they climb the dashed curve almost straight up. The curve was drawn before the cooling started.
Which colour wins? Nothing decides. The rule treats gold and blue exactly alike. Press Shuffle and cool it again, and it may go the other way. But it always goes one way or the other, and it always goes at the same temperature.
Real magnets do this. Heat a piece of iron past 770 degrees and it stops being a magnet, quite suddenly. Let it cool and its magnetism comes back at the same temperature. Inside, the atoms of iron are little magnets that would like to agree with their neighbours, and above 770 degrees the heat wins.
Deeper.
This is the Ising model. Wilhelm Lenz proposed it in 1920 and his student Ernst Ising solved it for a single row of magnets in 1925, where it does nothing interesting: a row never makes up its mind. For a flat grid, Lars Onsager found the exact answer in 1944, one of the hardest calculations anyone had completed by hand. With temperature measured in units of the pull between two neighbours, the decision comes at 2/ln(1 + √2) = 2.269185. Below it, the share of magnets on the winning side minus the share on the losing side is (1 − sinh(2/T)−4)1/8. Onsager wrote that formula on a blackboard in 1949 and never published a proof. Chen Ning Yang supplied one in 1952. It is the dashed curve in the upper chart.
The eighth root is what makes the decision look like a cliff. Half a percent below the critical temperature an endless grid is already 63% lopsided. The lower chart is Onsager's exact energy, which counts how many neighbouring pairs agree. At the critical temperature it is exactly −√2, which means that 85.4% of all neighbouring pairs agree with each other at the very moment the grid as a whole has no preference. Agreement is local long before it is general.
The formulas are for an endless grid, and no screen holds one. A finite grid cannot turn a true corner: its dots round the corner off and trail away above 2.27 where the law says zero. The trail has its own law. Exactly at the critical temperature a grid L magnets wide is lopsided in proportion to L−1/8, the same eighth root, so each doubling of the width takes off only 8%. Change the size of the grid and compare: 0.66 for 32, 0.60 for 64, 0.55 for 128.
One honest note. Near the critical temperature the simple rule is very slow, because patches of every size have to be turned over one magnet at a time. So the page also uses a faster rule, found by Ulli Wolff in 1989, which grows a clump of agreeing magnets and flips the clump at once. It reaches exactly the same balance of chances. Both rules, alone and together, were checked against a 4 by 4 grid whose 65,536 states can all be counted.
What if every magnet wanted to disagree with its neighbours? Type the four letters that mean against, as in the word for the opposite of clockwise.
Nothing chose the colour. Everything agreed on it.