Sacred Grounds Café (Southern Illinois I)

One of my little hobbies is to visit places that play a role in a book (or film) I like. This year, one of my favorite books so far has been John Burnside’s novel Ashland and Vine. Even though the author is Scottish, the book takes place in a generic Midwestern college town called Scarsville.

DSC 1547

The book is about a College student and an elderly Lady. I don’t like to write or read reviews, and in this case the title already is hint enough. It is a good book. We don’t learn much about the place, until a coffee place is mentioned with the uncommon (for a coffee place) name Sacred Grounds Café. Thinking about it, this is an excellent name for a coffee place, because it tells the customer that one is welcome to sit down for a while instead of just grabbing a quick coffee. In any case, I found the name odd. There are indeed real coffee places in the US with that name, and one of them is in Edwardsville, Illinois. Even better, it is also on Main Street, as in the book.

DSC 1539

I decided to pay the place a visit. Unfortunately, the staff didn’t know author or book, and the owner (who plays a role in the book, too), was not present.

The quiche with sweet potatoes and spinach was excellent.

DSC 1537

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.

Forward (Arizona V)

Not only looking down is worthwhile, but also looking ahead.

DSC 1583

So this is my collection of pictures of tree bark from Arizona. The textures are beautiful, and one wonders why the trees are making this effort.

DSC 1782

After all, the visible outer layer is just dead cells.

DSC 1802

So, more precisely: Does the beauty we (or is it just me?) see in these structures provide some evolutionary advantage?

DSC 2205

Not for the trees, I am afraid.

DSC 2207

But maybe for us,

DSC 2209

because the beauty we believe to see helps to keep looking forward, despite all the decay.

Moth bark

More Circle Magic

Today we revisit the three previous posts about playing with circles with Mathematica Code, as promised.

First, we set up a reference image we want to play with:

width = 3;
height = 2;
spacing = .2;
vectorrectangle = Graphics[{Thickness[.01],
   Join[
    Table[
     Line[{{i, 0}, {i, height}}, VertexColors -> {Red, Green}], {i, 0,
       width, spacing}],
    Table[
     Line[{{0, j}, {width, j}}, VertexColors -> {Blue, Yellow}], {j, 
      0, height, spacing}]
    ]
   }
  ]

Rect1

and convert this vector graphics into a bit image:

a = 500 width;
b = 500 height;
bitimage = Image[vectorrectangle, ImageSize -> {a, b}];
rectangleimage = ImageData[bitimage];

Instead of this, you can paste any bitmap into the Image[] function and adjust a and b to the correct dimensions.
ImageData converts the bitmap into an array of RGB values.

Now we do some complex analysis magic, using elliptic functions, in order to map the unit disk to the rectangle.

tau = b/a I;
modul = 1./(ModularLambda[2 tau])^(1/4);
ellipticwidth = (2*EllipticK[1/modul^4])/modul;

DiskToUpperHalfPlane[z_] := (1 - I z)/(-I + z);
UpperHalfPlaneToRectangle[z_] := 
  EllipticF[ArcSin[modul z], 1/modul^4]/modul;
UpperHalfPlaneToNormalizedRectangle[z_] := 
  1/2 + UpperHalfPlaneToRectangle[z]/ellipticwidth;
imre[z_] := {Im[z], Re[z]};

DiskToNormalizedRectangle[z_]

To compute the circular preimage of the rectangle, we create a 750×750 square and map each pixel of the disk within that square to the rectangle, using DiskToNormalizedRectangle, and some rescaling. We record in the square the coordinates of the image pixels, and mark all other pixels in the square that lie not inside the disk as {0,0}.

nn = 750;
scale[{i_, j_}] := 2 (i + I j)/nn - (1 + I);

tab = Transpose[Table[
    If[Abs[scale[{i, j}]] > .99,
     {0, 0},
     imre[a (DiskToNormalizedRectangle[scale[{i, j}]])]], 
	{i, 1, nn}, {j, 1, nn}]];

As the image coordinates are not integers, we interpolate the color of a pixel in the disk as the weighted average of the four adjacent pixels.

WeightedExtract[t_, {x_, y_}] := (1 - FractionalPart[x]) (1 - FractionalPart[y]) t[[Floor[x], Floor[y]]] +
  (1 - FractionalPart[x]) (FractionalPart[y]) t[[Floor[x],  Ceiling[y]]] +
  (FractionalPart[x]) (1 - FractionalPart[y]) t[[Ceiling[x], Floor[y]]] +
  (FractionalPart[x]) (FractionalPart[y]) t[[Ceiling[x], Ceiling[y]]];

colorpick[i_] := 
 If[i == {0, 0}, RGBColor[1, 1, 1], 
  RGBColor @@ WeightedExtract[rectangleimage, i]];

Image[Map[colorpick, tab, {2}]]

Rect2

To use Black products to create multiple copies of this image within the disk, we first generate a list of the zeroes of the Blasche factor, and then multiply the Black factors. Precomposing the Blaschke function with DiskToNormalizedRectangle makes things pretty.

ww = Table[(1 - 1/n^1.4) E^(.4 I n), {n, 2, 20}];
Blaschke[z_] := Product[
  Abs[ww[[n]]]/ww[[n]] (ww[[n]] - z)/(1 - Conjugate[ww[[n]]] z), {n, 
   1, Length[ww]}];

tab = Transpose[Table[
    If[Abs[scale[{i, j}]] > .99,
     {0, 0},
     imre[a (DiskToNormalizedRectangle[scale[Blaschke[{i, j}]]])]], 
	{i, 1, nn}, {j, 1, nn}]];

Image[Map[colorpick, tab, {2}]]

Rect3

To get this back into a rectangle, we need the inverse of the DiskToNormalizedRectangle function. This is done with Jacobi’s elliptical functions:

UpperHalfPlaneToDisk[w_] := (I (-I + w))/(I + w);
RectangleToUpperHalfPlane[w_] := JacobiSN[modul w, 1/modul^4]/modul;
NormalizedRectangleToUpperHalfPlane[w_] := -RectangleToUpperHalfPlane[-ellipticwidth (w - 1/2)];

RectangleSelfMap[z_] := UpperHalfPlaneToNormalizedRectangle[
	DiskToUpperHalfPlane[
   		Blaschke[ 
    		UpperHalfPlaneToDisk[
				NormalizedRectangleToUpperHalfPlane[z]
			]
		]
	]
]

Again, after some bookkeeping

aa = a/2;
bb = b/2;
eps = 0.000001;

scale2[{i_, j_}] := (i + I j)/aa
smash[x_, u_] := If[x  u, u, x]];
smash[{i_, j_}] := {smash[i, b], smash[j, a]};
colorpick2[i_] := colorpick[smash[i]];

tab = Transpose[Table[
    imre[a RectangleSelfMap[(1 - eps) scale2[{i, j}] + eps/2 b/a I ]], {i, 1, aa}, {j, 1, bb}]];
Image[Map[colorpick2, tab, {2}]]

we get our rectangular image back.

Rect4

Keemun

DSC 9850

This year’s first flush Darjeeling is a bit of a disappointment, so I have been revisiting other teas. One of my favorite Chinese black teas are the Keemun teas. They come with a hint of smoke and honey and are ideal afternoon teas. One commonly finds the Mao Feng and the more expensive Hao Ya teas. The leaves are short(cut) and coal black.

DSC 9865

In recent years, there have been interesting experiments. For instance, there is now a Keemun Snail tea with beautiful wiry leaves made from the first buds, with some golden tips. The taste is more subtle than that of a regular Keemun. I got my 2 ounce tin from Harney.

DSC 9844

Even mellower but also more complex is the Keemun Golden Tip Mao Feng which I found at Imperial Teas. It does not look like a Keemun anymore. In addition to the keemunesque smokiness, there are hints of chocolate. Very addictive.

DSC 9822

After brewing, the leaves of the two teas are almost indistinguishable. I wonder what the two signs mean.

DSC 9868 Edit

Playing with Infinity

After Squaring the Circle and using Blaschke products to squeeze finitely many disks conformally into a single disk, the restless mathematician wants to put even more disks into a disk. Infinitely many, that is. What we need for this is a conformal map that maps the disk infinitely often onto itself. We will cheat a little and employ the exponential function. It maps the left half-plane to the punctured unit disk, and because it is 2π periodic. Each point except the center of the unit disk has infinitely many preimages.

Expo 1

So, my first examples map the disk via a Möbius transformation to the left half plane (that is a bijection), and then via the exponential map back to the (punctured) disk. Missing one point won’t be a big deal – what is a single pixel? Pulling back the default spider web on the left replicates it infinitely often, but in a somewhat disappointing way: The circles of the original web become horocycles that are mapped periodically onto the circles. We just have an infinite hyperbolic wall paper, periodic with respect to a parabolic isometry. We can do slightly better by taking products of several such maps.

Below are products of three such Möbius-exponential maps,

Expo 3

and here the two images that use four factors. I have placed the parabolic fixed points symmetrically but played with the Möbius transformations a little.

Of course one can also use infinite Black products, as long as the zeroes of the factors converge rapidly enough to the boundary circle, and as long one is patient enough to evaluate the infinite products to sufficient accuracy.

Binfinity

In the left example, the zeroes follow a spiral, while in the second example, the zeroes alternate between two spirals that turn the opposite way. The zeroes correspond to the circular holes.

Jerome, oh why you treat me so cold? (Arizona IV)

Another example how to deal with days past can be admired in Jerome, an old miner’s town. Today’s population is a mere 5% of what it used to be 100 years ago when copper was plenty. So, where did all the people go, and what happened to the houses?

DSC 2333

The ones that appear not to be abandoned cultivate lucrative traditions

DSC 2314

or celebrate an unprofitable business by placing it at a location that makes it particularly difficult. How would you arrange the book shelves?

DSC 2362

For the curious tourist, accommodations are plenty,

DSC 2369

and transportation is traditional.

DSC 2453

Then there are the true and timeless inhabitants, always slightly annoyed.

DSC 2361

Spring Cleaning I

Spring Cleaning is played on a rectangular array of randomly placed dirt pieces. A sweep consists of removing a single row or column of consecutive dirt pieces.

Sweep legal

Above are some example of legal sweeps, and below are illegal sweeps.

Sweep illegal

This is a game for two players, who take turns by doing exactly one sweep. The player who sweeps the last time is the winner. This is an impartial game which means that each position is equivalent to a single game of Nim. This is usually bad news, because playing Nim well requires us to perform exclusive or additions of binary numbers in our head, for which our brains are not (yet) well equipped.

The good news here is that many simple positions are equivalent to very small Nim piles, meaning that computations are easy. I will explain this using an example. No proofs (even though they are easy, too).

Sweep win1

It’s your turn to find a winning move in the position above. You know (because I promise) that rectangles completely filled with dirt pieces are easy positions, so you will look for moves that separate the dirt pieces into such rectangles. Here is such a move:

Sweep win1 sol

After that, we are left with four separate rectangles, all completely dirty. This means that this game is equivalent to a game of Nim with four Nim piles. The question is what the pile sizes are. The answer is simple: Any rectangle both of whose dimensions are odd corresponds to a Nim pile of size 1, if both dimensions are even, the Nim pile is empty (size 0), and otherwise, the Nim pile has size 2. In our example, we have a 1×1 rectangle, a 1×3 rectangle, and two 1×2 rectangles. They correspond to Nim piles of sizes 1, 1, 2, and 2. The exclusive or sum of these numbers is 0. This is what we want, because it means that after this move, the game is equivalent to an empty Nim pile. From now on it’s easy. Suppose that our opponent performs a vertical swipe on the 1×3 rectangle. What do we do to return the game to Nim-value 0?

Sweep 3 01

We can sweep away any of the isolated dirt pieces: From then on, the game is symmetrical and we can win easily without any Nim-theory. And we better leave the two 1×2 rectangles untouched. Suppose we remove one of them completely. Then we are left with three 1×1 rectangles and a single 1×2 rectangle, which exclusive or sums up to a Nim pile of size 3, in which case our opponent can win.

Sweep 4 01

The winning move would be to reduce the remaining 1×2 rectangle to a 1×1 rectangle with a horizontal sweep.

So, if we know how to deal with Nim positions that consist of Nim piles of sizes 1 and 2, we will be able to win Spring Cleaning by dissecting a given position eventually into rectangles.

Recovery (DePauw Nature Park I)

DSC 0604

The main attraction of the DePauw Nature Park is its limestone quarry. It is a vast and eery place. After DePauw University took possession of the area, they removed buildings and other environmental damage, and allowed nature to recover.

DSC 0733

So one can see the effect of two different forces at once: The enormous momentous force of machines that cut through all that limestone, and the much slower force of plants that take roots again.

DSC 0658

This appears to be simple. We know the constituents: water, rock, grass, tree. But then there is weird stuff I don’t know. I will pretend it is harmless.

DSC 0631

Maybe Mars looked like this, too, millions of years ago.

DSC 0748

Playing with circular images

After successfully transforming rectangular images into circular ones it is time to do something with them. We have seen already that the one can deform them by shifting one point somewhere else. This is very much like rotating a globe.

But besides these angle preserving symmetries of the disk there are other maps from the disk to itself that also preserve angles but are not anymore 1:1. These are the Blaschke products, written in complex notation as follows.

Product 01

Let’s look at a simple example with just two factors, and choose the a-parameters to be 1/2 and -1/2. Then B(z) maps the double spiderweb on the right to the standard spiderweb on the left:

Blascke2 01

In other words, by taking preimages (or better, by using B(z) to pull back an image…), we can create multiple copies of a circular image within a circular image. The a-parameters designate the locations of the “centers” of the multiple spiderwebs where the strands converge.

Flower1

For instance, above is a circular image of a Spring wild flower, and to the left its 3-fold mutation. Below are 5-fold mutations with two different choices for the a-parameter.

Flower2

These images resemble kaleidoscopes, but are improved, because the copies of the original image fit together more evenly (smoothly, and not just by reflection). One can also make the result less symmetrical by choosing the a-parameters less symmetrical. Below the copies of the ferns are places at 120 degree angles but differently far out,

Ferns

and here we have a large copy of the original budding trillium at the bottom with two smaller copies to the left and right.

Flower3

Now I need to find somebody who writes an app that implements all this…