Winning Strategies (and Sylver Coinage)
The Mintmaster and her Apprentice
The following question was posed first by John Conway in chapter 18 of Winning Ways:
The mintmaster (Alice) and her apprentice (Bob) take turns quoting denominations of coins greater than 1, on the condition that the denomination of any new coin should not be achievable by using combinations of previous coins. The first person with no playable move loses. Is there a winning strategy?
In other words two players take turns naming positive integers greater than 1 that are not the sum of nonnegative multiples of previously named integers; the first one to not be able to do so loses.
This is a two-player game of perfect information- both players know everything about what has been played and what can be played, and there is no chance involved. The players alternate playing natural numbers, building a possibly infinite sequence (called a play of the game) in the process. The entire game can then be encoded as a game tree: a directed graph whose nodes are tuples in , which represent truncations of the plays at various points in time. The edges of the graph represent moves, so the progress of a play can be tracked by walking down the graph. For example, is a relatively short play in which Alice loses. Odd length plays will then correspond to wins for Alice, and even length plays will correspond to wins for Bob. Plays that last forever will then have to be declared a draw, in which case the notion of a ‘winning strategy’ makes no sense.
It is not obvious at all if this game will even end always: it is clearly unbounded, since given any it is possible to have a game of length , simply by looking at the play .
Exercise: show that Sylver coinage is unboundedly unbounded, i.e. for any it is possible to play moves without making the game bounded.
A natural thing to try is looking at coprime numbers and using Bezout’s theorem, an elementary number theoretic result which says that two integers and are co-prime if and only if there are integers such that . Suppose two of the moves are co-prime integers (>1) then there are non-negative integers with Then given an integer , we can find integers and such that
Hence if any two moves are coprime, the game immediately becomes bounded. The bound we have found is rather weak: James Joseph Sylvester (after whom the game is named) proved that if are co-prime positive integers, is the largest integer that cannot be written as a sum of non-negative multiples of and
We don’t need to limit ourselves to pairwise co-prime plays. A natural extension of Bezout’s theorem is the fact that for positive integers , it is possible to choose non-negative integers such that
(Proving this result is a simple exercise in induction.) Then the same analysis as above can be used to show that the game becomes bounded as soon as the of all the moves becomes 1. More generally, if the first moves are then the allowable moves are restricted to only finitely many multiples of , or non-multiples of the Let denote the number of multiples of that are allowable next moves. Define a function on the nodes of the game-tree by One of two things can happen:
the next integer played is a multiple of . Then and ,
the next integer played is any non-multiple of , and necessarily .
In either case, we can say that . Here, is the lexicographic order on , defined as
Thus is a monotone function from the game-tree to . The following fact is crucial:
Lemma The lexicographic order is a well-ordering on .
Proof Suppose is an infinite descending chain in . Then we must have , but the standard ordering of the naturals is a well-order so there must be an such that . But then we must have an infinite strictly decreasing chain of natural numbers, a contradiction.
Remark The same reasoning can be used to show that the lexicographic product of any two well-orders is itself a well-order.
Now it is clear that any play of Sylver coinage must be finite, since any infinite play would give an infinite descending chain in . Thus the game terminates, and accordingly one of the players must win- there can be no ties.
If there is one thing you take away from what we have done so far, it is the neat trick of finding some monotone function into a known well-order to show that a chain terminates. In fact this is not a mere ‘trick’ but a reflection of the deeper fact that there is always a monotone function from any terminating chain into the canonical well-order of the ordinals. Infact, the ordinals are the terminal object in the category of well-founded relations, where the morphisms are parsimonious monotone functions.
More general games
We can now talk about if it is always possible to force a win in a play of Sylver coinage. In fact, we can talk about this in a more general setting of Gale-Stewart games:
Definition A Gale-Stewart game is a two-player game of perfect information where the players take turns to build an infinite sequence of natural numbers, called a play of the game. The first player is said to win if the play is an element of a payoff set , and the second player wins otherwise. Conventionally, player one and player two will be referred to as Alice and Bob respectively.
Since the game is entirely determined by the payoff set, we denote the game by . Such games can be encoded, like Sylver coinage, in game-trees which necessarily are non-terminating here. How could this definition be of any use? Most games we care about don’t allow unrestricted moves- we can get around that by declaring the first player to make an illegal move automatically lost. What about terminating games? The solution is simple- just imagine the players kept playing even after there were no legal moves left. The player who lost has to make the first illegal move, and so still loses in the ‘infinite’ play. Thus the notion of a Gale-Stewart game is very broad, and can be used to talk about most two player games as long as the moves can be encoded as natural numbers.
Winning the game
A strategy for Alice is a function on even-length tuples that determines the next move (a strategy for Bob is defined likewise.) Strategies just encode the players responses to each situation, and making aggressively bad moves is also a strategy. A winning strategy is a strategy using which the player can win, no matter what the other player responds with. An intelligent player will, then, always play according to a winning strategy if there is one. A game is determined if one of the players has a winning strategy- its called so because if two intelligent players play the game the outcome is already determined. Some results are natural- for instance, if the payoff set is too small in relation to all possible plays (), then Alice cannot have a winning strategy.
Theorem If the payoff set is countable then Bob has a winning strategy.
Proof We use Cantor’s diagonalization argument to construct a strategy for Bob. Let the payoff set be He then plays so that the number in the play is . The play then cannot be a member of the payoff set, hence Bob wins.
Thus countable payoff sets are always determined. Assuming the continuum hypothesis, this says that player one has a winning strategy only if the payoff set has cardinality . This result is in fact true even without assuming the continuum hypothesis.
Terminating games correspond to decidable payoff sets- a set is decidable if for any , a finite initial segment of determines whether or . To show all decidable sets are determined, we will use the notion of a position being determined. Observe that given any node of the game-tree, the subtree with root at itself determines a game (all plays of the game have appended at the start.) Restricting the payoff set to this subtree, we can ask if there is a winning strategy for either player in the subtree, if there is one we will call the position (node) determined in favour of that player. Colour a node red if it is determined in favour of Alice, and blue if it is determined in favour of Bob. Then the basis of our proof relies on determinacy of nodes propagating up the tree.
(Terminology: node is a ‘direct successor’ of node in the directed graph if there is an edge from to .)
Theorem If the payoff set is decidable then the game is determined.
Proof Since the game terminates, the end positions are determined in favour of the winner and every end position has a colour.
Call a position even if it is Alice’s chance to move (i.e. the associated tuple has even length), call it odd otherwise. Propagate determinacy up the tree as follows:
if an even posion has a direct successor which is coloured red, then the position itself is determined in favour of Alice (since she can just move to the red node and force a win from there). If all the successors are coloured blue, then there is nothing she can do to win and the node itself is determined in favour of Bob. Likewise for odd nodes.
Now every node above the end positions must be determined in favour of one of the players, and this is true for the empty node (start of the game) as well- thus the game itself is determined.
We have thus answered Conway’s question- Sylver coinage is determined, although we proved this non-constructively so we still do not know what the winning strategy is. In the rest of the article we will try to extend the above ideas.
Gale-Stewart Theorem, and some Topology
Phrased differently, the proof of determinacy of decidable sets goes as follows: if the game is terminating and Alice does not have a winning strategy, then at every stage there is something Bob can do so that Alice cannot force a win; and since the game is terminating this must mean that it is a win for him. This idea can be used to study determinacy of semi-decidable sets, i.e. sets whose membership can be determined in a finite time but the membership of their complements might take infinite time to verify. A rather silly example of a Gale-Stewart game with a semi-decidable payoff set is the game where the two players build an infinite sequence, and player one wins if an even number is played at any stage (player two wins otherwise.) Of course, this is determined because player one simply has to play on her first move.
Theorem (Gale-Stewart, 1953) A Gale-Stewart game with a semi-decidable payoff set is determined.
Proof Since the payoff set is semi-decidable, Alice wins if and only if she manages to move to a red coloured node in finite time. If Alice has no winning strategy in , then we can build a strategy for Bob that avoids red nodes inductively as follows: if it is Alice’ s turn on a non-red node, she cannot move to a red node. Since none of the nodes Alice reaches are red, they must all have atleast one non-red direct successor, so Bob can move to that non-red node. Since the base case (root of the game-tree) is not red by assumption, Bob has a strategy that will never reach a red node in finite time, and thus the resulting play will be a win for Bob.
A notable feature of the above proof has been the role of quantifiers for the two players- when constructing a strategy for Bob, moves for Alice used universal quantification (because an intelligent player loses only if every possible move is bad), while moves for Bob used existential quantification (since he needs atleast one good move to win.) A game where Bob has a winning strategy thus encodes an infinite sentence starting with
This idea finds a lot of applicability in maths, especially in Model Theory where Ehrenfreucht-Fraisse games are used to build elementary equivalences between structures.
Aside: in real analysis, this also provides a neat way to think about continuity of a function at , in the form of a finite game of length two where Alice quotes an and Bob has to respond with a , and the payoff set is . If Bob has a winning strategy, then the function is continuous!
Exercise: show that finite games are determined, and hence that continuity/discontinuity of any real function can be determined.
Switching the roles of Alice and Bob in the proof of Gale-Stewart theorem, we can show that sets with semi-decidable complements are also determined. In fact, the semi-decidable subsets form a topology on : the Baire topology.
1. and are clearly semi-decidable (in fact decidable.)
2. If is a family of semi-decidable sets, and for a sequence the problem can be determined in time then the problem is determined in time . This corresponds to running all the Turing Machines in parallel, till one of them succeeds.
3. If and are semi-decidable sets such that the problem is solved in time , then the problem is solved in time . This corresponds to running the Turing Machines in sequence, starting one after the previous succeeds.
Remark: The connection between semi-decidability and topology of open sets is in fact deeper than that, in some sense a topology generalises the idea of semi-decidability. (See here.)
The Gale-Stewart theorem then says that games with open (and closed) payoff sets are determined. Generalization of this result involves climbing up the Borel heirarchy- the first layer is that of open and closed sets, and climbing up each layer involves taking closures of all previous levels under countable unions and intersections. Let us try going one level up- countable unions of semi-decidable sets are still semi-decidable, but countable intersections are not: the sets are all semi-decidable, but their intersection (a singleton set) is not. It is, however, determined:
Theorem If is a countable collection of open sets then is determined.
Since each is open, it comes with an associated colouring of the game tree (a node is red if Alice has a winning strategy from there, blue if Bob does). To win means to win every , to lose means to lose any one of them. We think from Bob’s perspective, colouring the nodes from which he has a definite winning strategy blue. An even node (Bob’s turn to move) is blue in if it is blue in some , because from that point he can pretend he is playing and win . If every direct successor of an odd node is blue in some (not necessarily the same one) then whatever move Alice makes, she will land on a blue node in some , hence Bob can pretend he is playing from that point and win the game.
Propagating this half-colouring, if the root node is blue then Bob has a winning strategy in . If it is uncoloured, then Alice has a strategy that keeps the game on uncoloured nodes. Now uncoloured nodes are red in every game, and all the s are open (semi-decidable) so by playing according to she wins any in a finite time . Thus as the play continues (for infinite moves), every time will have been passed so by playing with Alice will have won every single . Thus uncoloured nodes are in fact, red in
Note: The same proof also shows countable unions of closed sets are determined. The assumption that each individual game is open is crucial, since the fact that they all can be won in some finite time implies that Alice will have won all of them ‘by the end’. Why is the countability assumption important? Does the proof hold if we drop it?
A game with no winning strategy
Martin in 1975 provided the ‘ultimate result’ by showing that Borel sets are determined. At this stage one is tempted to assert that perhaps every game is determined- this suggestion is called the Axiom of Determinacy. It is, however, false within the realms of ZFC, and we can use Choice to construct a non-determined game.
Remember that a strategy (not necessarily winning) for Alice is a function from odd-length tuples to . For a strategy for Alice, call a sequence (play) -compatible if it is generated when Alice plays according to . Then is a winning strategy if and only if every -compatible sequence is in the payoff set, since otherwise there is some sequence of moves Bob can make that will win against . Likewise a strategy for Bob is a winning strategy if every -compatible sequence is outside the payoff set. Then to show there is a non-determined game, we will explicitly construct the payoff set such that no strategy for either of the players is a winning strategy.
Theorem There is a non-determined game.
Proof Observe that there are strategies and plays compatible with any strategy. Let be the set of all strategies (for either player.) Use the Axiom of Choice to well-order this set, and construct the payoff set by transfinite induction as follows:
For the least strategy , choose two distinct plays compatible with and add one to , the other to . Now any has predecessors. Suppose for each predecessor of we have added one compatible sequence to and one to . We haven’t exhausted all of the -compatible sequences so it is still possible to choose a new (distinct from all previously chosen) sequence and add it to , and another new compatible sequence to . If any sequences are left over in the end, add them to or randomly. Then clearly, no strategy is a winning strategy for the game corresponding to .
It is worth emphasising that the game still has a winner- just that it is impossible for either player to guarantee a win, since for every strategy Alice might play with, there is something Bob can do to win. But to know what this counter-strategy is, Bob has to know Alice’s strategy in the first place and this is not possible. A strategy can only depend on the moves played so far, and is a winning strategy only if it can win every game with just this information. Of course, if Alice tells Bob what strategy she is going to use, then Bob can ensure a victory (as Tim Gowers puts it, if you put all your cards on the table right at the beginning, then you put yourself at a big disadvantage in the game.)
This article barely scratches the surface of a rich and interesting theory of games that has deep ties with set theory. I just mentioned Martin’s glorious result in passing, and although outside the scope of this article, it is definitely worth looking at. Tim Gowers has a series of posts discussing this in detail. One might want to study the Axiom of Determinacy and its bizarre consequences. We also endowed the real line with a cool topology, and didn’t do a lot with it- there’s probably a lot happening with the topological properties of games. And of course, instead of studying the games for their own merit, we can use them to encode other things. Banach-Mazur games might be a good place to start looking. Lastly, if you are a constructivist and not happy with how I declared Conway’s question solved, chapter 18 of Winning Ways has a detailed discussion of possible strategies for Sylver Coinage.
Lastly, if you haven’t lost the game yet, you unfortunately just did ;)