EGMO synopsis

I have returned from assisting at the Easter olympiad training camp at Trinity College, Cambridge. After we marked a selection test (the results of which I am not at liberty to divulge), a preliminary squad of nine people were selected, which will eventually be narrowed down to the six people that form the IMO team.

In addition to satisfying the role of General Dogsbody, I gave an unofficial talk on Ramsey theory at 7:00 am. Considering the early hour, lack of advertisement and the optional nature of the talk, the attendance (three people) was actually quite reasonable. I distributed a sheet of questions (PDF). If you wish to attempt them, I suggest familiarising yourself with the theorems in the third chapter (Combinatorics II) of MODA. Two of these were marked with a direct sum symbol (\oplus) to indicate that they’re extremely challenging, and far beyond the hardest of IMO questions.

Another function of the Easter camp was to prepare our team of four girls for EGMO 2013, which was held in Luxembourg last week. The scores at the end of the competition were continually updated to a live online scoreboard, followed shortly after by the medal boundaries. Danielle Wang (USA) won the competition, with a total of 38 marks out of a possible 42. Three nations (Belarus, Serbia and the United States) were tied in equal first position, with cumulative scores of 99.

Solutions and commentary (spoiler alert!)

The problems appear to be arranged in strictly increasing order of how interesting they are, so I’ll only discuss the second paper here.

Problem 4: Quintic polynomial

This one isn’t actually particularly interesting; however, I’ll include it here for completeness, since it would seem strange to only discuss questions 5 and 6.

4. Find all ordered pairs of positive integers (a, b) for which there are three consecutive integers at which the polynomial P(n) = \dfrac{n^5 + a}{b} takes integer values.

In problems such as this one, it is most convenient to let the three consecutive integers be {n − 1, n, n + 1}. Then, we require (n − 1)^5 + a, n^5 + a and (n − 1)^5 + a to all be divisible by b. Since b \mathbb{Z} is an ideal of \mathbb{Z}, we can add multiples of b and multiply by integers whilst retaining divisibility by b. Consequently, the polynomials n^5 - (n-1)^5 = 5n^4 - 10n^3 + 10n^2 - 5n + 1 and (n+1)^5 - n^5 = 5n^4 + 10n^3 + 10n^2 + 5n + 1 must also be multiples of b.

Hence, b and n are coprime, and both 20n^3 + 10n and 10n^4 + 20n^2 + 2 are divisible by b, so we can conclude (eventually) that b|11. For the case where b = 1, all integer values of a trivially work. For the other case of b = 11, it suffices to consider the residues of n^5 (mod 11) to find all solutions for a.

Problem 5: Mixtilinear incircle

5. Let Ω be the circumcircle of ABC, and let ω be the mixtilinear incircle touching BC, AC and internally tangent to Ω at the point P. A line parallel to AB and intersecting the interior of triangle ABC is tangent to ω at the point Q. Prove that angles ACP and QCB are equal.

What makes this problem particularly appealing is that there are only five important points. In a situation like this, one would normally find a clever Euclidean construction involving additional points, or apply some algebraic bash. Quite remarkably, we can solve this problem without introducing any more points.

egmo-q5

To solve this problem, we’ll use a Möbius transformation obtained by the composition of an inversion in a circle centred on C and orthogonal to ω followed by a reflection in the angle bisector of BCA. This is actually a natural thing to do, since lines through C remain as lines, the mixtilinear incircle ω is preserved, the circumcircle Ω is mapped to a line, and lines AC and BC are interchanged. Our Möbius transformation is an involution, although we don’t need this fact.

The image of Ω is the line A’B’, where A’ and B’ are the images of A and B. It shouldn’t be difficult to convince yourself that B’A’C is a homothetic copy of ABC, so A’B’ is parallel to AB. Also, A’B’ must be tangent to ω and intersect the interior of the triangle, so it is precisely the line used to construct Q. We can deduce, therefore, that P and Q are interchanged, whence it follows that angles ACP and QCB are indeed equal.

The Möbius transformation is colloquially referred to as an inverflection, being composed of an inversion in a circle followed by a reflection in a diameter of the circle. On the Riemann sphere, this operation is indistinguishable from a reflection in a point, which is why it is a natural thing to do. Sahl Khan applied this method to a difficult geometry problem on RMM 2011, and constructed several problems of his own relying on this principle.

Problem 6: Snow White and the Seven Dwarves

6. Snow White and the Seven Dwarves are living in their house in the forest. On each of 16 consecutive days, some of the dwarves worked in the diamond mine while the remaining dwarves collected berries in the forest. No dwarf performed both types of work on the same day. On any two different (not necessarily consecutive) days, at least three dwarves each performed both types of work. Further, on the first day, all seven dwarves worked in the diamond mine. Prove that, on one of these 16 days, all seven dwarves were collecting berries.

This is a thinly-veiled problem asking for you to essentially prove that the Hamming(7,4) code is optimal and unique. Its optimality follows from it being a perfect code; specifically, each of the 128 binary strings of seven digits is within a Hamming distance of 1 from precisely one of the 16 codewords.

Uniqueness is slightly more difficult. We are given that 0000000 is a codeword, and want to show that 1111111 is also a codeword. This must be a perfect code (essentially a space-filling sphere packing on the Boolean lattice), which means that every binary string must either be a codeword or differ from precisely one codeword in a single position. Consequently, every string of Hamming weight 2 (such as 1100000, 0010100 and 0001001) must differ from a codeword of Hamming weight 3 in a single position.

Essentially, we want to group the seven dwarves into overlapping ‘lines’ of three dwarves, such that any pair of dwarves determines a unique line. From this, we can deduce that each dwarf belongs to three lines, and thus there are seven lines (corresponding to codewords of Hamming weight 3). This describes the Fano plane, as Maria Holdcroft noticed when attempting this problem in the actual competition:

If the problem is false (i.e. 1111111 is not a codeword), then we must have a codeword of Hamming weight six. Without loss of generality, this is 0111111, and three of the other codewords are 1110000, 1001100 and 1000011. Now consider the string 0001111. This can’t be a codeword (since it differs from 0111111 in only two positions), so must differ from a codeword X in one position. Clearly, X cannot be 0101111 or 0011111 (since then it would be too close to 0111111). It can’t be 1001111 either, as that is too close to 1000011. Hence, X must be either 0001110, 0001101, 0001011 or 0000111. The first two ‘collide’ with 1001100; the last two collide with 1000011. Hence we obtain a contradiction, and our proof is complete.

A more difficult generalisation of this problem involves 23 dwarves who work for 4096 days, such that for any two days, at least 7 dwarves do different types of work. The unique solution is then given by the perfect binary Golay code.

Posted in Uncategorized | Leave a comment

Efficient computational matchings and lax sexual morality

Hall’s marriage theorem is well-known and frequently useful, but it’s a nightmare from a computational perspective.

The standard proof can be turned into an algorithm which finds a matching, but it’s impracticably slow. The reason for this is that the theorem contains the phrase “every subset”, and one doesn’t want to be testing every subset of a set in real life. Indeed, an algorithm that matches n men to n women in time O(2^n) is in some sense not much better than trying every possible matching in turn!

But, as it turns out, there’s another way of going about the subject which is much more efficient in practice: an approach apparently well-known to experts, but not well-known to one of the authors (JDC) until last week.

We’ll need the notion of a partial matching: that’s when we have some marriages, and perhaps some unmarried people left over. Ignoring civil partnerships, bigamy, trigamy, and all higher-order polygamy, real life is a partial matching; the concept is familiar.

Given a partial matching, we’ll say that a swingers’ party is a line of people with the following properties:

  • there are an even number of people (at least two);
  • they alternate between men and women;
  • the people at each end are unmarried (wlog, a man on the left and a woman on the right);
  • the people between the ends are a chain of married couples;
  • every pair of neighbours in the line wouldn’t mind being married.

In other words, it alternates between couples who simply fancy each other, and couples who are already married:

before

Note that there is a degenerate case, consisting of two people: one unmarried man and one unmarried woman who would be happy to be married. Conventional morality frowns strongly upon unmarried men being alone at parties with unmarried women, so we do not mind calling this degeneration a swingers’ party.

However, in a striking departure from conventional morality, swingers’ parties are a great thing for improving matchings. If you can find a swingers’ party, you can swap over the married couples and the unmarried couples, and that increases the number of marriages by one.

after

The theorem of interest is that a configuration admits a total matching if and only if, given every partial matching, and any unmarried person, we could hold a swingers’ party featuring that person. In fact it’s enough to have this true for any unmarried man, or alternatively for any unmarried woman.

If we have an incomplete matching with no potential swingers’ parties, then we can find a set which violates Hall’s marriage condition. Specifically, we choose an unmarried man, together with all the women whom he fancies, and all of their husbands, and so on until we can go no further. This cannot terminate in an unmarried woman, lest we would have a swingers’ party. Hence, the resulting set must necessarily contain a surplus of men, violating the marriage condition and thereby proving that Hall’s condition implies that every incomplete matching contains a potential swingers’ party. The converse is trivial, so this is equivalent to the existence of a perfect matching.

What’s more, this theorem leads to a genuinely efficient algorithm. Given a partial matching and a choice of unmarried man, we can construct a swingers’ party in time linear in the number of potential marriages, if one exists, by searching in the obvious way and keeping track of dead ends. That means that, starting from the empty partial matching, with everybody unmarried, one can produce a total matching (if one exists) in time O(n^3) (and less if the number of potential marriages is bounded somehow), which is a considerable improvement.

In the literature, swingers’ parties seem to go by the euphemism alternating paths, but our instinct is to call them what they are.

(This post is a joint effort with James Cranch. Both authors wish to apologise for the inherent heteronormativity of the subject matter, and would love to hear about theorems which reflect reality better.)

Posted in Uncategorized | Leave a comment

One-dimensional noughts and crosses

The ordinary game of Noughts and Crosses, also known as Tic-tac-toe, features a 3 \times 3 board on which two players alternate placing symbols (O for the first player, and X for the second player) in unoccupied squares, attempting to form a line of three collinear squares containing their symbol. It has been known since time immemorial that, assuming perfect play, the game results in a draw. Randall Munroe provided a beautiful illustration of the optimal strategy for each player.

There have been extensions to higher dimensions. For example, a popular variant involves a 4 \times 4 \times 4 board, where the first player to obtain four collinear cubes of their symbol wins. Apparently, this one is a victory for the first player (assuming perfect play), although humans play sufficiently suboptimally that this has no impact.

After receiving a particular text message ending with an alternating string of ‘X’s and ‘O’s, I was inspired to go in the opposite direction and consider variants of Noughts and Crosses on a one-dimensional board. One particularly interesting example is a game mentioned on the Advanced Mentoring Scheme:

Two players (Alice and Bob) alternate placing either an ‘X’ or an ‘O’ on an unoccupied square of a 1 \times n board. As soon as three adjacent squares form the string ‘XOX’, the player who has just placed that symbol wins. If the board fills up without this happening, the game is declared a draw.

It’s relatively easy to show that the only losing positions are those where the unoccupied squares form the string ‘X__X’, where placing either of the symbols in one of the empty spaces enables the opponent to secure an immediate win. Since losing positions must have an even number of empty spaces, we can prove that Alice can force at least a draw for odd n, and Bob can force at least a draw for even n.

To force a win, the favoured player must therefore simply attempt to form the string ‘X__X’ and then play naturally, knowing that parity will eventually reward him or her with a victory. If the board is sufficiently large, it is easy to see that a win is guaranteed. The thresholds for forcing a win are n = 7 for Alice and n = 18 for Bob, far below the n = 2010 in the AMS question.

Posted in Uncategorized | Leave a comment

Gamma(1/4)

The Gamma function, Γ, is an extension of the factorial function to the complex plane. Specifically, Γ(n) = (n−1)! for all positive integers n. It is defined, more generally, by analytic continuation of the following integral, which converges for all complex numbers with positive real part:

Gamma-integral

The factorial identity can be verified using integration by parts. Specifically, we get the recurrence relation Γ(z+1) = z Γ(z). Plotting the absolute value of the function in the complex plane yields the following surface, with poles situated at zero and the negative integers:

Gamma-function

At certain non-integer arguments, we get new irrational constants. For example, Γ(1/2) is the square-root of π. Γ(1/4) is even more interesting, and has been shown (by Yuri Nesterenko, in 1996) to be algebraically independent of both π and e^π; in other words, there is no non-trivial polynomial in π, e^π and Γ(1/4) with integer coefficients that evaluates to zero.

lemniscate

Also, we have \Gamma(\frac{1}{4})^2 = S \sqrt{2 \pi}, where S is the arc length of the lemniscate (shown above) given by the equation (x^2 + y^2)^2 = x^2 - y^2 (and, of course, \sqrt{2 \pi} is our favourite transcendental constant). The area bounded by the curve is precisely 1, otherwise known as Legendre’s constant.

Related to this is Gauss’s constant:

gauss-constant

AGM is the arithmetic-geometric mean, which is obtained by repeatedly iterating the map (x, y) → (√(xy), ½(x + y)) and taking the limit. There is an algorithm (the Brent-Salamin method) for calculating pi based on the arithmetic-geometric mean. The AGM converges extremely quickly, producing exponentially many digits of precision after n iterations. Nevertheless, the slower Chudnovsky algorithm is preferred for computing pi, due to the inefficiency of computing square roots.

Posted in Uncategorized | Leave a comment

Cipher 24: ADFGVX

For this week, I’ve decided to use a 95-year-old cipher employed by the German army during the First World War. You have the advantage, however, of the far greater computing power available today.

FFXGDXXDG VVAFVXDDA DAVAXDFXG DVDAAAXFV AFAVGVVDV 
XGDXVXGAX AFDAVXADA GDFVFDAFF AXDDAFFVG DGDDDXDAD 
GAXVGFXAA DAFFFGXFV XAAXAFFAG VXDVFDVVA AGDVGXVAX 
DDFFVADFD FDAAADAAV AXVAAXDFV VXADVDAAV GDXDXAGFF 
VVAXVFXVV AGDAFXDVX DVAVDDXAV VAFVVXAAA FXVDVFFVA 
VAVDFDDVD VDVDAAAAV DGGXFDAFX DFXVVXADD ADDAAVXGF 
GVAAGDFAD AAVXFDGDG XFVGADFGD AVXXVVVVV XDVDAFDAD 
VAXVAXVVD GVAAVXXVV XVXXDVAAX AFVAAXFXG GXAVFDVFA 
VDVVGDFAV XAXXAXAVG VVVXAAGVV ADDXDVVVF VFVAVXXVG 
DAXAFGAFD DDVGDFXGV FFFFDVVAG VVVAGGXVA DAXFDAGFA 
VDAVDXAAA AVFXAVAVV XDVVVADVA ADDFVADVA FADAADFDV 
AGXVDVAVD FXADAFFVG GVDFDAGXF GFAADDXDV GDADGXXDD 
XFVVAVXGA VGXDXGVVD XDGDDFFVX AXADXVAGV VDAVVVAAV 
VVFXXVADV XDAXGFAVV DAFFXVDFV FFGDXFADV AGFDVAAAF 
DAADAFXAV VAVVFDAVD FVXVVXXAA DVXXAVAFA ADAXAAXVG 
VVFFFGXAV XAAAADFAG DVVFFDGFX AVVVADFAD DDVVFDAAF 
ADDAVAAAA ADDXAVAVA DXDVGXDVV DVFDFAAFV FVDXAVFGD 
VADFDGDVG DVVVGXFAD DVFDVVAFF VFVADVDXV AVAADAAXV 
AXVAAGDVA ADVXDAAXD

I’ve also used the same key for both the transposition and substitution stages.

Posted in Ciphers | Leave a comment

Don’t do it!

Professor Sir Timothy Gowers FRS wrote about the usefulness of a particular proof strategy, known as ‘just do it’. He gives six example problems, providing proofs using this technique. I’ll now give alternative proofs, which use explicit constructions to avoid this idea completely.

Problem 1: Dense set in general linear position

The first problem is to find a dense subset of the plane, where no three points are collinear. We take z = (π + exp(π) i)/24, and let S be the set of all finite sums of distinct integral (both positive and negative) powers of z. For instance, S contains z^8 + z^79 and 1/z, but not 3z^3 or −z^2.

S contains no three collinear points, as otherwise we would have an algebraic relation between π and exp(π). Specifically, if a, b and c are collinear, consider a − b and a − c, where a has largest (or equal-largest) degree when viewed as a polynomial in z. They must be real scalar multiples of each other, i.e. Im((a − b)(a* − c*)) = 0. By the algebraic independence of z and z*, this means that (a − b)(a* − c*) must be a symmetric polynomial in z and z*. Considering the term of leading degree, a must have strictly higher degree (say, n) than both b and c. Now considering the terms divisible by either z^n or (z*)^n, we can deduce that b = c, so they are the same point.

S is dense, as we can easily show (by induction, or whatever) that every sufficiently large disc contains a point of S, and S is self-similar by definition. So we are done.

Points corresponding to sums of powers of z with degree between 1 and 14.

Points corresponding to sums of powers of z with degree between 1 and 14.

Problem 2: AP-free colouring of the integers

Is it possible to colour the positive integers with two colours, such that no arithmetic progression is either entirely red or entirely blue? Yes, we can. For example, colour the integer n according to the parity of the integer part of \sqrt{n}. For each colour, we get arbitrarily thick ‘bands’ that must contain terms of any given arithmetic progression.

colouring

Wow, that was really trivial. Much less involved than enumerating arithmetic progressions. If we replaced ‘arithmetic progression’ with ‘infinite recursively-enumerable set’, then the ‘just do it’ method is arguably better.

Problem 3: Packing spheres on the Boolean lattice

This asks for a collection of exponentially many subsets of {1, 2, 3, …, N}, such that the symmetric difference between any two elements of the collection is at least N/3. For N = 24, the binary Golay code is a beautiful example: there are 2^(N/2) = 4096 codewords, and the symmetric difference of any two of them has size 8, 12, 16 or 24.

A generalisation to arbitrary lengths is the notion of a lexicographic code, or lexicode. To construct a lexicode for this problem, we choose the lexicographically least subset of {1, 2, 3, …, N} which differs from existing subsets in at least N/3 positions, and continue until we cannot find any further subsets with this property. This construction necessarily works for the same reasons as Gowers’ ‘just do it’ approach. Lexicodes are also (entirely non-obviously) linear, which means that the symmetric difference of any two sets in the collection is also in the collection.

Problem 4: Finding a transcendental number

Liouville demonstrated that the number 0.11000100000000000000000100…, whose decimal representation is the indicator function of the set {1, 2, 6, 24, 120, …}, is transcendental. Naturally, the proof is a reductio ad absurdum, supposing that there’s a polynomial that vanishes at Liouville’s number.

Problem 5: Infinite matrix whose rows tend to 0, but whose columns tend to 1

This is really trivial. Merely extend the following matrix in the obvious way:

matrix

Problem 6: Every distance occurs once

The final of Tim Gowers’ questions is this: “Does there exist a subset Z of the plane such that for every positive real r, there is precisely one pair of points A,B \in Z such that AB = r?” He provides a non-constructive proof using transfinite induction up to the initial ordinal with the cardinality of the reals. I’ll leave the ‘don’t do it’ proof as an exercise to the reader…

Posted in Uncategorized | Leave a comment

3D chess is Turing-complete

As promised, here is the remainder of the proof of the Turing-completeness of three-dimensional chess. In the first part, we introduced the rules; in the second part, we built structures to function as logic gates and wires.

Counter machines

Instead of a Turing machine, I shall describe how to implement an alternative (equivalently universal) model, known as a counter machine. This is a finite state machine connected to a finite number (three is usual, but two is also sufficient) of registers, each of which can store a natural number. The finite state machine can send signals to increment and decrement the value of the register, and to test whether the register contains 0.

A more comprehensive description of a Minsky Register Machine (MRM) is included on Paul Chapman’s website, where he has built an implementation in Conway’s Game of Life. He uses sliding-block memory, developed by Dean Hickerson, where the position of a block represents an unbounded natural number. I have to admit that my design for a MRM in three-dimensional chess is directly inspired by Chapman’s implementation.

Sliding-king memory

The storage of positive integers uses a similar principle. The natural number is stored in the vertical position of a black king. Being able to increment and decrement the king with only finite support is non-trivial, and almost certainly the most difficult implementational detail. The key idea is to confine the black king to a helix, like so:

helix

Then, forcing the king to move anticlockwise corresponds to incrementing the counter, and forcing it to move clockwise corresponds to decrementing the counter. To control the horizontal components of the position of the black king, we have an array of rook cages below, threatening upwards, and a single white king directly below the black king, protecting it from the rooks. Whenever the white king moves, the black king must also move to remain directly above it.

The other detail is to ensure that the king remains on the helix. The helix is contained in the union of four vertical planes. For each of these planes, we need to ensure that the z-coordinate of the king is restricted to a particular modulo-4 residue. Let’s consider one of these planes:

vertical-plane

The white rooks are responsible for restricting the motion of the black king. Each rook is confined to a vertical column (shown in red); I’ll explain later how this is accomplished. The black knight is confined to two columns in the yz-plane, which ensures that the only positions on this xz-plane that it can occupy are those shown in light blue. The knight has the ability, therefore, to protect the king, provided he occupies a particular modulo-4 residue.

In other words, the black king can only occupy the squares highlighted in green. By including four copies of this mechanism, each screw-rotated by pi/2 and translated vertically upwards by one unit, we can restrict the black king to a helix.

Restricting the motion of rooks and knights

This mechanism would operate as the basis for a functioning sliding-king memory, assuming we can restrict the motion of the white rooks and black knights as described. Since this detail is quite difficult, I’ll explain precisely how this is accomplished. We’ll start with the white rooks. It’s easiest to explain this with a diagram:

pinned-rook

The white rook (light green cube in the diagram) is pinned by the black rook immediately below it. The white king cannot move from its vertical column, lest it would be threatened by the eight surrounding black rooks. A fortress of pawns protect the white king from any attacks by rogue rooks; the king and pawns can move upwards to extend the reach of the rook.

The nine black rooks should actually be virtual rooks, emulated by a rook cage (nonplanar hexagon of mutually pinning rooks) as described in the previous article.

It is more difficult to control the black knights, since we need to restrict them to two vertical columns as opposed to just one. Equivalently, this reduces to preventing the black knights from landing on any of the sixteen columns shown in red in this horizontal cross-section:

knight-positions

To accomplish this, we have white rooks positioned directly below these columns, able to kill the knight if it enters one of them. We also have a black rook immediately below the white rook, able to destroy the white rook as soon as it moves (so as to prevent the rook from escaping) but not beforehand (as that would enable a defending white pawn to capture the black rook, resulting in a discovered checkmate). Using extra circuitry, it’s possible to ensure that checkmate occurs unless the black rook returns to its original position on the following move.

Completing the sliding-king memory

So far, I have described how the increment and decrement operations are carried out. It is also necessary to be able to test whether the black king is in a particular position (called the zero position). When in the zero position, the black king prevents a white king from passing through squares adjacent to the zero position, so the white king cannot generate a NZ (non-zero) signal. However, the black king also blocks a horizontal line of attack from a nearby black rook, so the white king can pass through a different passage, generating a Z (zero) signal.

Together with the fixed circuitry from the previous article (diodes and transistors), we can build a Turing-complete counter machine, proving that three-dimensional chess is itself Turing-complete.

Unsolved problems

There are still some unsolved problems:

  • On each turn, a player has a potentially infinite number of moves (consider a single rook, for example). In theory, it may be possible to prove something stronger than Turing-completeness, namely that every statement in first-order Peano arithmetic can be encoded as a configuration. It seems as though this should be the case, although proving it will be tricky. This idea of infinitely many choices was necessary in the construction of positions where one player can force a mate, but not in any finite number of moves.
  • Does three-dimensional chess retain Turing completeness when restricted to a smaller subset of pieces? In this proof, I required four distinct pieces, namely kings, rooks, knights and pawns.
  • Is two-dimensional chess Turing-complete?

I believe that the answers to all of these questions are ‘yes’, but they are probably more difficult than this proof that three-dimensional chess is Turing-complete.

Posted in Chess | Leave a comment

BMO training

Assuming everything has gone to plan, I am now introducing myself at the British Mathematical Olympiad training camp at Trinity. I’ll be assisting the future IMO team by making tea and providing biscuits (integral, if somewhat overlooked, roles in the administration of the camp), marking selection tests and promoting the use of transfinite induction, Muirhead’s inequality, and poles and polars.

Suffice it to say, I won’t have internet access for the next few days. As such, the posts you’re viewing have been written by me several days before, and have been set to automatically appear at predetermined times.

The British RMM team, and one of the guides. From left: Andrew, Silvia, Gabriel, Sahl, Daniel, Warren and Matei.

The British RMM team, and one of the guides. From left: Andrew, Silvia, Gabriel, Sahl, Daniel, Warren and Matei.

Also on the topic of UK olympiad training, Matei Mandache has written a very readable report about his experiences in the sixth Romanian Masters of Mathematics (whence the above photograph was taken). He has continued the very admirable tradition of mentioning me in student reports of competitions in which I didn’t compete.

I would, however, like to mention a single erratum (even if it may seem hypocritical, with my own report containing such howlers as ‘IMO stationary’ and ‘the Delhi Brassiere’!). Where he says ‘as they plan to be guides again, there is a good chance Gabriel or Warren will see them again, but for the rest of us the goodbye is final’, I have to disagree. At least one of the guides is intending to matriculate at Cambridge. Rather in the style of Douglas Adams, who didn’t immediately reveal who bruised his or her upper arm in The Hitchhiker’s Guide to the Galaxy, I shall not reveal to which of the four guides I am referring, thereby retaining an element of suspense…

If you’ve been affected by any of the issues in this post, you may want to take a look at MODA.

Posted in Uncategorized | Leave a comment

Circuitry in 3D chess

This is the second of a projected three-part series of articles, which will ultimately prove the Turing-completeness of three-dimensional chess. In the first article, I described the basic rules of the game. In this article, I shall show how to construct basic logic gates using rooks, kings and pawns. The final article, which demonstrates Turing completeness, requires a fourth piece, namely the knight.

Constraining motion

With thousands of pieces on an infinite board, the game could quite easily become very chaotic. As such, it is necessary to somehow restrict the motion of the pieces to prevent unexpected moves. The simplest pieces to constrain are pawns, since two pawns of opposite colour on the same vertical file (white below black) block each other:

pawn-trap

In the diagram above, horizontal planes are separated by commas, in descending order of altitude. In other words, the black pawn is directly above the white pawn. This convention will be used throughout this article.

Using these pawn couples, it is possible to build a more sophisticated cage for trapping two kings of opposite colours. In the configuration below, all of the pieces are eternally trapped.

king-cage

This is not immediately useful on its own, but twelve of them can be used to construct an even more complicated rook cage, where six rooks are trapped in space. If one of the rooks attempts to move, it would result in a king of that colour becoming checked, effecting an immediate loss.

rook-cube

Sorry about drawing the rooks (green) twice as large as the kings (blue) and pawns (grey), but it was necessary to emphasise their comparative importance. The red lines highlight the nonplanar hexagon of mutually pinning rooks. The rooks can protect squares from enemy kings along the yellow lines. We can, in effect, regard the six rooks as two virtual rooks, one of each colour, positioned on the triple intersections of yellow lines. Any excess lines can be blocked by pawn couples.

Corridors, diodes and transistors

Recall that the statement of Turing completeness, in this context, is to be able to devise an algorithm for converting a Turing machine into a chess position, such that white can force a win if and only if the Turing machine halts. Hence, we shall have white ‘in control’ of the game, able to move kings along corridors formed by solid walls of pawn couples. Shown below is an example of a bend in such a corridor:

corridor-corner

These are to be used as ‘wires’ to connect components such as diodes and transistors to form more complicated logic gates, latches and switches. We can also construct wires in the vertical plane using exactly the same principle, allowing wires to be crossed without any of those silly conglomerations of three XOR gates.

Diode and transistor: click to enlarge

Diode and transistor: click to enlarge

Shown above is a combined transistor/diode. In ‘diode’ operation, a white king at the bottom left can force his way to the bottom right, but the black rook can prevent reverse flow. In ‘transistor’ operation, a white king can only pass through the upper channel if another white king occupies a position in the bottom channel to threaten the rook.

Important: The black rook is constrained by a rook cage (not shown) to remain on a single vertical file.

By combining these components, it is possible to build latches, switches and logic gates. This is sufficient to prove that three-dimensional chess can emulate any linear-bounded automaton (i.e. a Turing machine with bounded tape).

If we were allowed infinitely many pieces, this would also suffice for Turing-completeness. However, we are not. When restricted to finitely many pieces, it is necessary to be able to store an unbounded amount of information with only finite support. This will be accomplished in the third article, where we implement a register for a counter machine.

Choice gates and alternating Turing machines

We can create two other components, namely white and black choice gates. A white choice gate is simply a T-junction with diodes, which enables a white king to make a choice between either of two exits:

white-choice

A slight modification of this is to allow a black king to force the choice by being able to guard the two exits. This called a black choice gate, since the black king has control of which exit the white king takes.

When we add these two components, the Turing machine is then upgraded to an alternating Turing machine. Before, we were able to encode PSPACE-complete problems as positions on bounded grids in three-dimensional chess. Now, we can instead encode APSPACE-complete problems. Chandra, Kozen and Stockmeyer demonstrated that this is equivalent to being EXPTIME-complete.

Posted in Chess | Leave a comment

Cipher 23: Orthogonal boustrophedons

This cipher is inefficient, in that it merely encodes 39 characters in the following (rather large!) matrix. Your challenge is to determine how this is done, and thus obtain the password.

orthogonal-boustrophedons

Posted in Ciphers | Leave a comment