Magnetism

Magnetism is played by two players on a strip of squares, who take turns placing + and – tokens onto the strip. The only rule is that no two tokens with the same parity can be placed next to each other. For instance, there are three legal moves in the following position:

Legal

The player who moves last, wins. This makes Magnetism an impartial game, so that each position is equivalent to a Nim-pile. It turns out that Magnetism is very simple.
First we notice that any position is the sum of simpler positions that have tokens just at the end of a strip. (A sum of games is played by first choosing a game summand, and then making a move in that summand).

Sum 01

Therefore we will know everything about Magentism if we can determine the size of the Nim-piles (the “nimbers”) of the 9 elementary positions:

Nine 01

Things get even simpler. Because of the symmetry of things, there are only four truly different boards to consider.

Four 01

Let’s denote the nimbers of a board of n empty squares (thus not counting the tokens at the end when present) by G(n), G+(n), G++(n), and G+-(n).

n 0 1 2 3 4 5 6
G(n) 0 1 0 1 0 1 0
G+(n) 0 1 2 3 4 5 6
G++(n) 1 1 1 1 1 1
G+-(n) 0 0 0 0 0 0 0

Now you can win in a position with a positive nimber by moving to a position with zero nimber. For instance, on a board with a single + at one end, one possible winning move is to put a – at the other end.

Flat is Beautiful

Every flat 2-dimensional torus can be obtained by identifying opposite edges of a parallelogram.

Flatmarked 01

Each such torus has an involution that fixes four points, marked in four colors above. We can visualize the quotient as a tetrahedron with 180 degree angles at every corner by taking the triangle consisting of the lower left half of the parallelogram, and folding it together.

Tetra

So the space of all tori is nothing but the space of tetrahedra. Each such tetrahedron determines a unique point on the thrice punctured sphere. This can be seen by constructing the elliptic function on the torus determined by sending red to infinity, yellow to 0, and green to 1. The unique point is then the value of blue, and is called the modular invariant of the torus. To go backwards, take a point in the thrice punctured sphere and compute the quotient of elliptic integrals (using independent cycles)

Latex image 1

This complex number is the ratio of the two edges of the parallelogram that defines the torus.
This map is a Schwarz-Christoffel map: It maps the upper half plane to a circular triangle with all angles 0.
Restricting it to the upper half disk has as its image one half of such a triangle, namely

A 0 0 x

Let’s repeat all this starting again with a parallelogram, which now has been removed from the plane.

Complement 01

Identifying again opposite edges defines a translation structure on a punctured torus that corresponds to a meromorphic 1-form with a double order zero at red (because the cone angle there is 6π), and a double order pole at infinity (yellow) (because the holomorphic 1-form dz has a double order pole at infinity). For a given modular invariant, we can determine the parallelogram to use using another Schwarz-Christoffel map

Latex image 3

which maps the upper half disk to a different circular polygon:

A 1 0 x

Curiously, we see that the ratio of the edge vectors of the parallelogram can now also lie in the lower half plane or even be real, in which case the parallelogram degenerates. For instance, we can construct a torus that corresponds to the quotient -1 by slitting the complex plane from -1 to 1, and identifying the top of the slit from -1 to 0 (resp. 0 to 1) with the bottom of the slit from 0 to 1 (resp. -1 to 0).

Slit70 01

This corresponds to an ordinary torus whose parallelogram is a rhombs with angle 70.7083 degrees. Next time we will see what this torus is good for.

Drawing by Numbers

An easy attempt to make a model of color space is Philipp Otto Runge’s color sphere from 1810. The equator is colored by hue, brightness ranges from black at the north pole to white at the south pole.

Having such a color sphere suggests yet another way to visualize complex valued functions: Color a point z in the domain of the function by Runge’s color of the function value of that point, interpreted as a point on the Riemann sphere.

Square

For instance, up above is the coloring of the function f(z)=z^2 in the unit square. The white region at the center is caused by the zero, and that every color appears twice is of course a consequence of f being of degree 2. Let’s make it slowly more interesting. Here is the Möbius transformation f(z)=(z-1)/(z+1). Zero and poles are clearly visible.

Mobius

Locally, holomorphic functions are just as good or as bad as polynomials, so we shouldn’t expect anything more complicated to happen.

For me, the real excitement of complex analysis starts with essential singularities. There are the mind boggling theorems of Casorati-Weierstrass (images of neighborhoods of essential singularities are dense) and, much stronger and much harder to prove, Picard (images of neighborhoods of essential singularities miss at most two points).

Exp

Above is the coloring of f(z)= e^(i/z) in a thin rectangle centered at 0. We do see every color occurring infinitely often (more or less), but the image is still rather tame. After all, the exponential function is the simplest transcendental function. Things get truly wild if we look at the boundary behavior of gap series like

Gap2series

This series converges in the unit disk but cannot be homomorphically extended beyond.

Gap2

Unfortunately I don’t know enough about gap series to explain everything we can see here. Most puzzling are the circular arcs of increased brightness.

The Twisted Color Wheel

Colors are curious. Physics tells us that, like sound, they are just waves. But while we can hear sound waves of wave lengths between 17mm and 17m, the wave lengths of visible light range between 390 and 700 nm. That’s sad. Wouldn’t it be cool if we could see colors resonate by being able to see both red (700nm) and ultraviolet (350 nm). Of course matters are more complicated because we perceive colors differently, using three specific color sensors. Imagine being only able to hear three different sound frequencies.

Colorwheel

A side effect of our biological limitation is that a color wheel makes sense to us, i.e. a continuous arrangement of the colors around a circle so that antipodal points represent complementary colors. This gave me the idea that one could color a Möbius strip continuously by hue so that points in the “front” and “back” are colored by complementary colors. Here is a 7-fold twisted rectangle as a ruled surface,

Mobius7

and here a minimal surface version based on a torus knot:

Llmc

Finally, a Klein bottle, the immersion being obtained by rotating and revolving a figure 8 curve:

Figureeightbottle

Terraforming

Unfortunately, the days are over when you could just ask the Magratheans to build you a planet to order. Let’s deal with what we have and deform it a little, continuing my little series of visualizing conformal maps. Here is what we have:

MobiusTrandormation0

The easiest we can do is to shrink and expand the hemispheres, counteracting centuries of imperialism. Mathematically, this is just a multiplication like say f(z)= z/2.

MobiusTrandormation1

Curiously, translations like f(z)=z+1 have a much more dramatic effect, they move the north pole (which corresponds to 0) and keep the south pole (infinity).

MobiusTrandormation1b

If we want to move both poles simultaneously and keep the equator where it is, we need Möbius transformations.

MobiusTrandormation2

This is about as general as it gets with degree 1 maps. Here is a degree 2 map, f(z)=z+1/z:

Quadratic

Both polar caps have been folded into one. From a quadratic map we would expect intersecting parameter lines. This doesn’t happen here because the map I have chosen is rather symmetric. To indicate what usually happens, below is the image of a hemisphere under the innocent map f(z)=(z+1)^2:

Quadratic2

Beach Balls

Following Jack’s suggestion, let’s try to visualize holomorphic maps from the Riemann sphere to itself. As a reference, here is the Riemann sphere with polar coordinates, and on the right hand side its cylindrical projection.

Identity

The preimage of this under a quadratic polynomial looks like this:

Square

And here a rational function function of degree 4:

Quartic

One can get quick images using uv-mapping, but there are some rendering artifacts I don’t know how to get rid of yet. Degree 5:

Deg5

Finally, the Gamma function, which has an essential singularity at infinity.

Gamma

Martha says their gypsum printer can print these in color. We’ll see, I hope.

Spring Cleaning II

This is a continuation of my previous post about this game. Because it is impartial and the rules are simple, one can write a computer program that computes for a given position of dirt pieces the size of the equivalent Nim heap (which is also called its Grundy number or its nimber). Because this is computationally prohibitive, one does this for simple shapes, discovers patterns, and proves these. We did this for rectangles the last time. To warm up, we do it for L-shapes today. Here is. (5,3)-L:

Sweep L53

The nimber of this position is 1, which means in particular that there is a winning move for the first player. You can for instance do vertical swipe in the second column, leaving the second player with two disconnected row/column of three dirt pieces each. From then on, we play symmetrically and win.

For the general (alb)-L, the nimbers are as follows:

a\b 2 3 4 5 6
2 0 4 4 0 3
3 4 1 0 1 0
4 3 0 3 0 3
5 0 1 0 1 0
6 3 0 3 0 3

In other words, the nimber of an L with legs at least 3 dirt pieces long behaves quite simple.
This is good, because if a player can easily memorize the nimbers of simple positions, and these nimbers are small, then the player can usually easily win against players who lack this knowledge.

But maybe all this talk about nimbers is just vain traditional mathematics, and there is an alternative way to understand this game and win easily, without any theory, just by being smart and tough?

Let’s look at at another type of Spring Cleaning positions which I call zigzags. Below are the zigzags Z(1) through Z(7),

Zigzags

and here is the table of the first few nimbers:

n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
nimber 0 0 1 2 0 1 2 3 1 2 3 4 0 3 4

Any pattern emerging? No? There is a solution: Whenever you have a sequence of integers you are clueless about, you had to the Online Encyclopedia of Integer Sequences, the best thing the internet has produced ever, and type it in.

It turns out that the sequence at hand is known as the sequence of nimbers of another impartial game which is called Couples are Forever. The rules are simple: The game is is being played with several piles of tokens. Both players take turns splitting any one pile of size at least three tokens into two piles. The game ends when no piles with more than two tokens are left. This impartial game, beginning with a pile of size n, has (with a shift of two) the same nimbers as the zigzags in Spring Cleaning.

Moreover, for Couples are Forever, the nimbers have been computed into the millions, and no pattern has been found whatsoever. It is not even known whether the nimbers remain bounded.

Couplesgraph

Above is the graph for the nimbers of Couples are Forever (or zigzags in Spring Cleaning) for pile sizes up to 25,000. At first (up to 10,000 or so), it looks like the nimbers are growing linearly, but then they appear to even out. Nobody knows. This is one of the famous open problems in combinatorial game theory.

It tells us also that there won’t be a tough&smart solution for this game, or for Spring Cleaning, or for reality. Which is a good thing.