Abstract

Introduction
It is an amazing fact that the very first chess program in history was written a few years before computers had been invented. It was designed by a visionary man who knew that programmable computers were coming and that, once they were built, they would be able to play chess.
The man, of course, was Alan Turing, see Figs 1 and 7, one of the greatest mathematicians who ever lived. He was very interested in chess, but in spite of having a brilliant intellect and putting a lot of effort into learning the game, he remained a fairly weak player. While working at Bletchley Park on breaking the German Enigma code, and probably decisively influencing the outcome of the war, he took chess lessons from his GM-strength colleagues in the decryption team, and even invented “Round-the-house chess” – after each move you had to run around the house, and could play two moves in a row if you overtook your opponent (‘melamelachan’, 2017). Turing was an Olympic-class runner and this was his way of balancing out his lack of chess talent.

Alan Turing contemplating
In 1948 Turing, assisted by his friend David Champernowne, wrote the instructions that would enable a future machine to play chess. They called the program
Turing (and Champernowne) used the following piece values:
At the time, there was no machine of course that could execute this set of instructions, so Turing acted as a human CPU, using paper and pencil, requiring more than half an hour to calculate each move (Bell, 1978). He played a game against Champernowne’s wife, who was a beginner at chess, and won. Then he played one against a colleague, Alick Glennie, which he lost. This second game was recorded:
In the early 1950s, Turing began programming

Interestingly nobody seems to have written an actual computer program using Turing’s algorithm for more than fifty years after Turing devised it. In 2004, the programming team at the ChessBase software company decided to create a chess engine based on Turing’s algorithms. The basis was Turing’s description and the sample game against Glennie, and the programmer who undertook the task was Mathias Feist. He built a standard chess program interface for the ChessBase

(a) The
In the process, however, the ChessBase team encountered a problem: the engine refused to duplicate all of Turing’s moves as recorded in the Glennie game. It deviated in ten places – significantly already on the first move: the Turing engine wanted to play 1. e3, whereas Turing had executed 1. e4 in his 1952 game.
The ChessBase team spent some weeks re-examining the Turing papers and discussing the implementation in the Turing engine. Since they could not locate the error, they consulted Ken Thompson, one of the pioneers of computer chess (and author of
So Frederic Friedel contacted Donald Michie, who had been with Turing at Bletchley, describing the problem in general and the most significant deviations the ChessBase Turing program produced after the prescribed three-ply search (which Turing used in his paper-and-pencil game). “It is possible that we have got something wrong,” he wrote, “but I doubt it, since very often, especially in the beginning, we get the same moves with exactly the same values. I think it is possible that Turing tired after fifteen moves, when in addition the position became quite complex!”
Michie’s reaction (in a phone conversation) was, “You are looking for a bug in the program, Frederic? No, no, you should look for it in Alan Turing! Alan did not care about details; he was interested in the general principle.” He also pointed us to a quote by Champernowne, who had assisted Turing during the 1952 game: “In the actual experiment I suspect we were a bit slapdash about all this and must have made a number of slips since the arithmetic was extremely tedious with pencil and paper.” (Champernowne, 1980; Copeland, 2004).
In June 2012, Friedel travelled to Manchester to attend the Alan Turing Centenary Conference. On the way, he spent June 23rd, Turing’s 100th birthday, at Bletchley Park, a visit he will never forget. In Manchester, he assisted Garry Kasparov in a commemorative lecture on Turing’s chess involvement. The two spoke about the reconstruction of the paper machine, and Kasparov actually played a game against it. You can watch the video of the entire one-hour lecture (Kasparov and Friedel, 2012).
In the lecture, Kasparov pointed to a key moment in the game: “It was the first time that a machine played a game of chess
Kasparov: “Blundering a queen in one move, that is not a great accomplishment. But still the game was played and there were 29 moves, not just legitimate moves but you may call them decent moves.” He confirms that he will play a game against the reconstructed engine at the end of the lecture, “the first official display of the
In the lecture, Friedel discussed the deviations we were confronted with and how they probably came about. An important point is that Turing, working with paper and pencil, clearly used his intuition to come up with the moves. Without knowing it, he used Alpha-Beta pruning, a technique that was invented by Allen Newell and Herbert A. Simon half a decade later, when machines could actually execute code. Essentially Turing did not bother to calculate every single move in a position. Some he thought were clearly inferior, and it seemed pointless to spend a lot of time working out exactly how bad they were (which is the point of Alpha-Beta).
In the lecture, we discussed the problem of the very first move: Turing played

In the initial position material is equal, no pieces are taken, nothing has happened yet. There are twenty legal moves for White – each of the eight pawns can move up one or two squares, and the two knights have two moves each. One wonders if Turing made twenty calculations, each taking a number of minutes, before he executed the first move, 1. e4. It is one of the two most common moves that start a chess game, the other being 1. d4.
Let us apply Turing’s rules to the initial position of Fig. 4(b). The e-pawn gets 0.4 points for moving two squares forward, but just 0.2 points for moving one step (rule 6: pawn credit). So 1. e4 is better. But then we apply rule 4 (king safety) by placing a queen on the square e1, counting the number of squares the queen can move to – they are the squares from which the king could be attacked by a rook or a bishop – and taking the square root to define its mobility. 1. e3 gets a malus of 1 (the square root of one square, e2, to which the queen can move), whereas 1. e4 reduces the positional advantage by 1.4 points (the square root of 2, for e2 and e3).
In his game score, Turing gives 4.2 points for the move he played, 1. e4, and adds an asterisk to the value, which indicates that “every other move has a lower position-play value.” The ChessBase engine, and that of Ken Thompson, give 1. e3 a positional value of 4.40, compared to Turing’s move: 0.2 less for advancing just one pawn but 0.4 more for king safety. Mathias Feist wrote “Turing‘s calculation for 1. e4 is correct, which means he did not really calculate 1. e3. As a chess player, he knew that this move is not logical because in the initial position king safety does not play a role. He probably looked at it and thought: everything is the same for both moves, except 1. e3 is 0.2 points worse because the pawn moves just one square. So he discarded it without further calculation.”
Incidentally the move 1. d4, one of the most popular in tournament chess, was certainly calculated by Turing, who must have seen that it is clearly worse. Putting a queen on the king square shows four squares to which it can move, i.e. the malus for king safety is 2.0.
Let us take a look at move four as in Fig. 4(c): Turing played
After 4. Nf3 the mobility of the queen on d1 sinks from six to three squares, and consequently the positional value from 2.4 to 1.7 (
After 4. dxe5 the d4 pawn has advanced by one square (+0.2) but is no longer defended (−0.3). The mobility of the queen increases from 6 to 9 squares (+0.6). The black pawn on e5 has disappeared, and with it the bonus for the two rows it had advanced (+0.4 for White). The black king safety increases from 4 to 5 (+0.2 for White). So in total 4. dxe5 increases the score by 1.1 points.
There were also some problems with the quiescence search (“captures had to be followed up at least to the point where no further capture was immediately possible”), as applied by Turing in the Glennie game.
On move five, see Fig. 5(a), Turing played

Similarly, in the position of Fig. 5(b), Turing played
There are a number of other deviations in the game, more towards the end, when Turing was apparently tiring. The game clearly demonstrates how tedious and error-prone human calculation in such a situation can be. On a modern computer, the ChessBase
For those of you who want to experiment with the ChessBase
There is a scan of Turing’s contribution to Bowden’s (1953) Faster than Thought on Google Docs (Google, 2017). It is the original submission by Turing, typed on yellow paper, with ink corrections. Turing quotes the game against Glennie but deviates on move 21 from the gamescore that was later published in all the reprints (Levy, 1988; Levy and Newborn, 1991; Newborn, 1975). It is to be assumed that he corrected this first version of his manuscript with the moves that have been preserved for posterity.

The first page of a facsimile of Turing’s original contribution to Faster than Thought (Google, 2017).

The Alan Turing statue, Sackville Gardens, Manchester. © Stephen Richards.
