Ian Stewart. 8 Whitefield Close Westwood Heath Coventry CV4 8GY UK

Similar documents
Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015

Grade 7/8 Math Circles Game Theory October 27/28, 2015

Grade 6 Math Circles Combinatorial Games November 3/4, 2015

EXPLORING TIC-TAC-TOE VARIANTS

Combined Games. Block, Alexander Huang, Boao. icamp Summer Research Program University of California, Irvine Irvine, CA

On Variations of Nim and Chomp

mywbut.com Two agent games : alpha beta pruning

Legend. The Red Goal. The. Blue. Goal

PRIMES STEP Plays Games

Second Annual University of Oregon Programming Contest, 1998

ARTIFICIAL INTELLIGENCE (CS 370D)

On Variants of Nim and Chomp

Solutions to Part I of Game Theory

2 person perfect information

Game Theory and an Exploration of 3 x n Chomp! Boards. Senior Mathematics Project. Emily Bergman

4th Pui Ching Invitational Mathematics Competition. Final Event (Secondary 1)

STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40

CMPUT 396 Tic-Tac-Toe Game

Obliged Sums of Games

New Values for Top Entails

Impartial Combinatorial Games Berkeley Math Circle Intermediate II Ted Alper Evans Hall, room 740 Sept 1, 2015

37 Game Theory. Bebe b1 b2 b3. a Abe a a A Two-Person Zero-Sum Game

Contents. MA 327/ECO 327 Introduction to Game Theory Fall 2017 Notes. 1 Wednesday, August Friday, August Monday, August 28 6

Game, Set, and Match Carl W. Lee September 2016

Three-player impartial games

The tenure game. The tenure game. Winning strategies for the tenure game. Winning condition for the tenure game

a b c d e f g h 1 a b c d e f g h C A B B A C C X X C C X X C C A B B A C Diagram 1-2 Square names

Chess Handbook: Course One

The Hex game and its mathematical side

The first player, Fred, turns on the calculator, presses a digit key and then presses the

A Winning Strategy for the Game of Antonim

Sequential games. Moty Katzman. November 14, 2017

Tangent: Boromean Rings. The Beer Can Game. Plan. A Take-Away Game. Mathematical Games I. Introduction to Impartial Combinatorial Games

2359 (i.e. 11:59:00 pm) on 4/16/18 via Blackboard

MAS336 Computational Problem Solving. Problem 3: Eight Queens

Playing Games. Henry Z. Lo. June 23, We consider writing AI to play games with the following properties:

Plan. Related courses. A Take-Away Game. Mathematical Games , (21-801) - Mathematical Games Look for it in Spring 11

Game, Set, and Match Carl W. Lee September 2016

Adversary Search. Ref: Chapter 5

The Mathematics of Playing Tic Tac Toe

Advanced Microeconomics: Game Theory

Circular Nim Games. S. Heubach 1 M. Dufour 2. May 7, 2010 Math Colloquium, Cal Poly San Luis Obispo

PROBLEMS & INVESTIGATIONS. Introducing Add to 15 & 15-Tac-Toe

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

Game-playing AIs: Games and Adversarial Search I AIMA

Sept. 26, 2012

Senior Math Circles February 10, 2010 Game Theory II

On the Periodicity of Graph Games

Math 152: Applicable Mathematics and Computing

Gale s Vingt-et-en. Ng P.T. 1 and Tay T.S. 2. Department of Mathematics, National University of Singapore 2, Science Drive 2, Singapore (117543)

Math 152: Applicable Mathematics and Computing

CS 771 Artificial Intelligence. Adversarial Search

Figure 1: The Game of Fifteen

Norman Do. Department of Mathematics and Statistics, The University of Melbourne, VIC

Analysis of Don't Break the Ice

THE ASSOCIATION OF MATHEMATICS TEACHERS OF NEW JERSEY 2018 ANNUAL WINTER CONFERENCE FOSTERING GROWTH MINDSETS IN EVERY MATH CLASSROOM

Representing Square Numbers. Use materials to represent square numbers. A. Calculate the number of counters in this square array.

Grade 7 & 8 Math Circles. Mathematical Games

Wythoff s Game. Kimberly Hirschfeld-Cotton Oshkosh, Nebraska

Generalized Amazons is PSPACE Complete

GAMES AND STRATEGY BEGINNERS 12/03/2017

1, 2,, 10. Example game. Pieces and Board: This game is played on a 1 by 10 board. The initial position is an empty board.

The Sweet Learning Computer

Foundations of AI. 5. Board Games. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard and Luc De Raedt SA-1

game tree complete all possible moves

5.4 Imperfect, Real-Time Decisions

CPSC 217 Assignment 3 Due Date: Friday March 30, 2018 at 11:59pm

UNIT 13A AI: Games & Search Strategies. Announcements

Topics in Computer Mathematics. two or more players Uncertainty (regarding the other player(s) resources and strategies)

Chapter 4 Number Theory

Which Rectangular Chessboards Have a Bishop s Tour?

Staircase Rook Polynomials and Cayley s Game of Mousetrap

Analyzing ELLIE - the Story of a Combinatorial Game

CS103 Handout 25 Spring 2017 May 5, 2017 Problem Set 5

Gough, John , Doing it with dominoes, Australian primary mathematics classroom, vol. 7, no. 3, pp

Grade 7/8 Math Circles. February 14 th /15 th. Game Theory. If they both confess, they will both serve 5 hours of detention.

Chess Rules- The Ultimate Guide for Beginners

arxiv:cs/ v2 [cs.cc] 27 Jul 2001

ADVERSARIAL SEARCH. Chapter 5

Generalized Game Trees

1 In the Beginning the Numbers

CPS 570: Artificial Intelligence Two-player, zero-sum, perfect-information Games

Background. Game Theory and Nim. The Game of Nim. Game is Finite 1/27/2011

AI Approaches to Ultimate Tic-Tac-Toe

Artificial Intelligence Lecture 3

Figure 1: A Checker-Stacks Position

V. Adamchik Data Structures. Game Trees. Lecture 1. Apr. 05, Plan: 1. Introduction. 2. Game of NIM. 3. Minimax

5 Games For Building Logic

Restoring Fairness to Dukego

Table of Contents. Table of Contents 1

CSE 573 Problem Set 1. Answers on 10/17/08

UK JUNIOR MATHEMATICAL CHALLENGE. April 26th 2012

1. Introduction. We hope the Masterscorer gives you lots of pleasure! Benitos Special Sports. 2. Description of parts

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

OCTAGON 5 IN 1 GAME SET

Adversarial Search and Game Playing. Russell and Norvig: Chapter 5

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

Bad Fit Deals by AndrewsThomas

DELUXE 3 IN 1 GAME SET

On Drawn K-In-A-Row Games

Transcription:

Choosily Chomping Chocolate Ian Stewart 8 Whitefield Close Westwood Heath Coventry CV4 8GY UK

Just because a game has simple rules, that doesn't imply that there must be a simple strategy for winning it. Sometimes there is --- tic-tac-toe is a good example. But sometimes there isn't --- another childhood game, 'boxes', in which players take turns to fill in edges on a grid of dots and capture any square they complete, is a case in point. I call the first kind 'dream games' and the others 'nightmare games', for fairly obvious reasons. Games with very similar rules can be surprisingly different when it comes to their dream or nightmare status. And, of course, the nightmare games are often the most interesting, because you can play them without knowing in advance who ought to win --- or, in some cases, not knowing who ought to win but not knowing how they can do it. As an illustration of these surprising facts, I'm going to discuss two games based around chocolate bars. One, 'yucky choccy', is a dream game. The other, 'chomp', has very similar rules, but it's a nightmare game --- with the startling extra ingredient that with optimal play the first player should always win, but nobody knows how. I have no idea who invented yucky choccy: it was explained to me by Keith Austin, a British mathematician at Sheffield University. It takes place on an idealised chocolate bar, a rectangle divided into smaller squares. Players --- I'll name them 'Wun' and 'Too' after the order in which they play --- take turns to break off a lump of chocolate, which they must eat. Call this action a move in the game. The break must be a single straight line cutting all the way across the rectangle along the lines between the squares. The square in one corner contains a lump of soap, and the player who has to eat this square loses. The solid arrows in Fig.1 shows the moves in the game played with a 4x4 bar, and the shaded arrows show all the other moves that could have been made instead. Game tree for 4x4 yucky choccy. Arrows indicate legal moves: the piece removed is eaten. The square shown in black is the soapy one. Solid arrows indicate an actual game, shaded arrows alternative moves that could have been made instead.

This entire diagram constitutes the game tree. for 4x4 yucky choccy. As we'll shortly see, Too made a bad mistake and lost a game that should have been won. A winning strategy is a sequence of moves that forces a win, no matter what moves the opponent makes. The concept of a strategy involves not just one game, but all possible games. When you play chess, most of your planning centres on 'what if' questions. 'If I advance my pawn, what could his queen do then?' Tactics and strategy centre around what moves you or your opponent could make in future, not just the moves that they do make. There is a neat theory of strategies for 'finite' games --- ones that can't continue forever and in which draws are impossible. It relies on two simple principles: 1 A position is a winning one if you can make some move that places your opponent in a losing position. 2 A position is a losing one if every move that you can make places your opponent in a winning position. The logic here may seem circular, but it's not: it's recursive. The difference is that with recursive reasoning you have a place to start. To see how, I'll use the above two principles to find a winning strategy for 4x4 yucky choccy. The trick is to start from the end and work backwards, a process called 'pruning the game tree'. The single soapy piece is a losing position. I'll symbolise that fact by the diagram L * * * * * * * * * * * * * * * whose entries refer not to a chocolate bar, but to the the various positions marked in Fig.1. Here 'L' means 'losing position', * means 'don't know yet', and 'W' will mean 'winning position' once I've found some. In fact, are all winning positions, because you can break off all the white squares in one move to leave your opponent with the single-piece losing position. Equivalently, there are arrows in the game tree that lead from those positions directly to, and by principle 1 all such positions are winners. For similar reasons the same positions rotated through a right angle are also winners, so now we have pruned away all branches of the game tree that lead in one step to the single soapy square, which tells us the status of those positions: L W W W

What about? Well, the only moves you can make are or, and when you remove the all-white piece you leave a winning position for your opponent. Principle 2 now tells us that is a loser, so we can prune one more branch to get L W W W W L * * This in turn implies that, and so on are winners (break off a chunk to leave ) leading to L W W W W L W W W W * * W W * * working backwards in this manner you can eventually deduce the win/lose status of any position. The logic runs not in circles, but in interlocking spirals, climbing down the game tree from leaf to twig, from twig to branch, from branch to limb... Hence the 'pruning' image. We have to start from the end, though, which is a nuisance. What we really want to do, though, is chop down the entire game tree in one blow, George Washington fashion, to find the status of the opening position --- and if it's a winner, to find what move to play. For games with a small tree there's no difficulty: repeated pruning yields the status of all positions. In Fig.1 we can carry this out, to get L W W W W L W W W W L W W W W L So the 4x4 position, for instance, is a loser. If you try larger bars of chocolate, square or rectagular, you'll quickly find that the same pattern emerges: losers live along the diagonal line, all other bars are winners. Now the bars on that diagonal are the square ones: 1x1, 2x2, 3x3, 4x4. This suggests a simple strategy that should apply to bars of any size: squares are losers, rectangles are winners. Having noticed this apparent pattern, we can check its validity without working through the entire game tree by verifying properties 1 and 2. Here's the reasoning. Clearly any rectangle (winner) can always be converted to a square (loser) in one move. In contrast, whatever move you make starting with a square (loser), you cannot avoid leaving your opponent a rectangle (winner). Moreover, is square, and we know it is a losing position. All this is consistent with principles 1 and 2, so working backwards we deduce (recursively) that every square is a loser and every rectangle a winner. We now

see that Too's first move in Fig.1 was a mistake. And we see that yucky choccy is a dream game no matter what size the bar is. In principle the same procedure applies to any finite game. The opening position is the 'root' of the game tree. At the other extreme are the tips of the outermost twigs, which terminate at positions where one or other player has won. Since we know the win/lose status of these terminal positions, we can work backwards along the branches of the game tree using principles 1 and 2, labelling positions 'win' or 'lose' as we proceed. The first time, we determine the status of all positions that are one move away from the end of the game. The next time, we determine the status of all positions that are two moves away from the end of the game, and so on. Since, by assumption, the game tree is finite, eventually we reach the root of the tree --- the opening position. If this gets the label 'win' then Wun has a winning strategy; if not, Too has. We can even say, again in principle, what the winning strategy is. If the opening position is 'win' then Wun should always move to a position labelled 'lose' --- which Too will then face. Because this is a losing position, any move Too makes presents Wun with a 'win' position. So Wun can repeat the same strategy until the game ends. Similarly, if the opening position is labelled 'lose', then Too has a winning strategy --- with the same description. So in finite, drawless games, working backwards through the game tree in principle decides the status of all positions, including the opening one. I say 'in principle' because the calculations become intractable if the game tree is large. And even simple games can have huge game trees, because the game tree involves all possible positions and all possible lines of play. This opens the door to nightmare games. We now contrast yucky choccy with a game whose rules are almost the same, but where pruning the game tree rapidly becomes impossible --- and where pruning is possible, it does not reveal any pattern that could lead to a simple strategic recipe. That game is chomp, invented many years ago by David Gale (U of California at Berkeley) and described in his marvellous new book on recreational mathematics, Tracking the Automatic Ant (Springer-Verlag, New York). Gale describes chomp using a rectangular array of cookies, but I'll stick to chocolate. (It is best played with an array of buttons or the like.) Chomp is just like yucky choccy, with the sole difference that a legitimate move consists of removing a rectangular chunk of chocolate, as in Fig.2. Typical move in chomp.

Specifically, a player chooses a component square and then removes all squares in that row and column, together with all squares to the right of and below these. There is a neat proof that for any size of bar (Fig.3a) other than 1x1, chomp is a win for Wun. Suppose, to the contrary, that Too has a winning strategy. Wun then proceeds by removing the lower right square (Fig.3b). This cannot leave Too facing a losing position, since we are assuming the opening position is a loser for Wun. So Too can play a winning move, something like Fig.3c, to leave Wun facing a loser. But then Wun could have played Fig.3d, leaving Too facing the same loser. This contradicts the assumption that Too has a winning strategy, so that assumption must be false. Therefore Wun has a winning strategy. (a) (b) (c) (d) (a) Chomp bar ready for strategy stealing. (b) If Wun does this... (c)... and Too makes a supposed winning move... (d)...then Wun could have played Too's move in the first place. Proofs of this kind are called 'stategy stealing'. If Wun can make a 'dummy' move, pretend to be the second player, and win by following what ought to be a winning strategy for Too, then Too could not have had such a strategy to begin with --- implying that Wun must have a winning strategy. The irony of this method of proof, when it works, is that it offers no clue to what Wun's winning strategy should be! For chomp, detailed winning strategies are unknown, except in a few simple cases. In the 2xn (or nx2) case, Wun can always ensure that Too faces a position that is a rectangle minus a single corner square (Fig.4a). In the nxn case, Wun removes everything except an L-shaped edge (Fig.4b), and after that copies whatever move Too makes, but reflected in the diagonal. A few other small cases are known: for example in 3x5 chomp the sole winning move for Wun is Fig.4c.

'The' winning move need not be unique: in the 6x13 game there are two different winning moves. (a) (b) (c) Winning moves in (a) 2xn chomp. (b) nxn chomp. (c) 3x5 chomp. Other information about chomp positions can be found in Winning Ways by Elwyn R. Berlekamp, John H. Conway, and Richard K. Guy (Academic Press, New York 1982), page 598. Chomp can also be played with an infinite chocolate bar --- in which case, paradoxically, it remains a finite game because after finitely many moves only a finite portion of bar remains. But there is a change: Too can sometimes win. This happens, for example, with the 2x bar. Fig.5 shows that whatever Wun does, Too can choose a reply that leads to Fig.4a, which we already know is a loser. (a) going on forever Too Wun (b) going on forever Wun going on forever (c) going on forever Too cuts here How Too wins 2x chomp. (a) Start. (b) One type of possible play for Wun and its reply. (c) The other type of possible play for Wun and its reply.

Strictly speaking, I should be more careful here. By ' ' I really mean the set of positive integers in their usual order, which set theorists symbolise as ω ('omega') and refer to as 'the first infinite ordinal'. There are many other infinite ordinals, but their properties are too technical to describe here: see Gale's book for further details. Chomp can be played on doubly infinite arrays of ordinals, or in three or more dimensions: on the whole, little is known about winning strategies for these generalisations.