On Variations of Nim and Chomp

Similar documents
On Variants of Nim and Chomp

PRIMES STEP Plays Games

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

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

arxiv: v1 [math.co] 17 May 2016

A Winning Strategy for the Game of Antonim

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

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

On Modular Extensions to Nim

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

Subtraction games with expandable subtraction sets

Another Form of Matrix Nim

Tutorial 1. (ii) There are finite many possible positions. (iii) The players take turns to make moves.

Peeking at partizan misère quotients

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

Figure 1. Mathematical knots.

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

Crossing Game Strategies

Three Pile Nim with Move Blocking. Arthur Holshouser. Harold Reiter.

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

Obliged Sums of Games

Ultimately bipartite subtraction games

GAMES AND STRATEGY BEGINNERS 12/03/2017

GEOGRAPHY PLAYED ON AN N-CYCLE TIMES A 4-CYCLE

Analyzing ELLIE - the Story of a Combinatorial Game

Eric Duchêne (Univ. Claude Bernard Lyon 1) Michel Rigo (University of Liège)

Alternator Coins. Mentor: Dr. Tanya Khovanova. PRIMES CONFERENCE, May 21, PRIMES CONFERENCE, May 21,

Jim and Nim. Japheth Wood New York Math Circle. August 6, 2011

NIM WITH A MODULAR MULLER TWIST. Hillevi Gavel Department of Mathematics and Physics, Mälardalen University, Västerås, Sweden

arxiv: v2 [cs.cc] 18 Mar 2013

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

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

Partizan Kayles and Misère Invertibility

Narrow misère Dots-and-Boxes

arxiv: v1 [cs.cc] 12 Dec 2017

Senior Math Circles February 10, 2010 Game Theory II

VARIATIONS ON NARROW DOTS-AND-BOXES AND DOTS-AND-TRIANGLES

THE GAME CREATION OPERATOR

Analysis of Don't Break the Ice

NIM Games: Handout 1

Tilings with T and Skew Tetrominoes

Three-player impartial games

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

ON SPLITTING UP PILES OF STONES

Games, Triangulations, Theory

EXPLORING TIC-TAC-TOE VARIANTS

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

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

GAME THEORY. Thomas S. Ferguson

1 In the Beginning the Numbers

TROMPING GAMES: TILING WITH TROMINOES. Saúl A. Blanco 1 Department of Mathematics, Cornell University, Ithaca, NY 14853, USA

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

arxiv: v1 [math.co] 24 Nov 2018

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

arxiv: v1 [math.co] 30 Jul 2015

Open Problems at the 2002 Dagstuhl Seminar on Algorithmic Combinatorial Game Theory

Received: 10/24/14, Revised: 12/8/14, Accepted: 4/11/15, Published: 5/8/15

Tile Number and Space-Efficient Knot Mosaics

Solutions to Part I of Game Theory

Graph Nim. PURE Insights. Breeann Flesch Western Oregon University,

CHECKMATE! A Brief Introduction to Game Theory. Dan Garcia UC Berkeley. The World. Kasparov

Formidable Fourteen Puzzle = 6. Boxing Match Example. Part II - Sums of Games. Sums of Games. Example Contd. Mathematical Games II Sums of Games

Constructions of Coverings of the Integers: Exploring an Erdős Problem

Chameleon Coins arxiv: v1 [math.ho] 23 Dec 2015

Mathematics. Programming

MATH 135 Algebra, Solutions to Assignment 7

1.6 Congruence Modulo m

NON-OVERLAPPING PERMUTATION PATTERNS. To Doron Zeilberger, for his Sixtieth Birthday

POSITIONS OF VALUE *2 IN GENERALIZED DOMINEERING AND CHESS

SOLUTIONS FOR PROBLEM SET 4

Some Chip Transfer Games Thomas S. Ferguson University of California, Los Angeles

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

arxiv: v1 [cs.dm] 13 Feb 2015

Two-Player Tower of Hanoi

Surreal Numbers and Games. February 2010

SOLITAIRE CLOBBER AS AN OPTIMIZATION PROBLEM ON WORDS

arxiv: v2 [math.gt] 21 Mar 2018

One-Dimensional Peg Solitaire, and Duotaire

Combinatorics in the group of parity alternating permutations

MATHEMATICS ON THE CHESSBOARD

Week 1. 1 What Is Combinatorics?

CS 491 CAP Intro to Combinatorial Games. Jingbo Shang University of Illinois at Urbana-Champaign Nov 4, 2016

#A3 INTEGERS 17 (2017) A NEW CONSTRAINT ON PERFECT CUBOIDS. Thomas A. Plick

18.204: CHIP FIRING GAMES

QUIZ: Fill in the blank. Necessity is the Mother of.

New Toads and Frogs Results

arxiv: v2 [math.ho] 23 Aug 2018

RESTRICTED UNIVERSES OF PARTIZAN MISÈRE GAMES

Math 127: Equivalence Relations

Applications of Fermat s Little Theorem and Congruences

A Combinatorial Game Mathematical Strategy Planning Procedure for a Class of Chess Endgames

SMT 2014 Advanced Topics Test Solutions February 15, 2014

Sequential games. We may play the dating game as a sequential game. In this case, one player, say Connie, makes a choice before the other.

New Values for Top Entails

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

Non-overlapping permutation patterns

BMT 2018 Combinatorics Test Solutions March 18, 2018

Problem F. Chessboard Coloring

Tic-Tac-Toe on graphs

The Four Numbers Game

Transcription:

arxiv:1705.06774v1 [math.co] 18 May 2017 On Variations of Nim and Chomp June Ahn Benjamin Chen Richard Chen Ezra Erives Jeremy Fleming Michael Gerovitch Tejas Gopalakrishna Tanya Khovanova Neil Malur Nastia Polina Poonam Sahoo Abstract We study two variations of Nim and Chomp which we call Monotonic Nim and Diet Chomp. In Monotonic Nim the moves are the same as in Nim, but the positions are non-decreasing numbers as in Chomp. Diet-Chomp is a variation of Chomp, where the total number of squares removed is limited. 1 Introduction We study finite impartial games with two players where the same moves are available to both players. Players alternate moves. In a normal play, the person who does not have a move loses. In a misère play, the person who makes the last move loses. A P-position is a position from which the previous player wins, assuming perfect play. We can observe that all terminal positions are P-positions. An N-position is a position from which the next player wins given perfect play. When we play we want to end our move with a P-position and want to see an N-position before our move. Every impartial game is equivalent to a Nim heap of a certain size. Thus, every game can be assigned a non-negative integer, called a nimber, nimvalue, or a Grundy number. The game of Nim is played on several heaps of tokens. A move consists of taking some tokens from one of the heaps. The game of Chomp is played on a rectangular m by n chocolate bar with grid lines dividing the bar into mn squares. A move consists of chomping a 1

square out of the chocolate bar along with all the squares to the right and above. The player eats the chomped squares. Players alternate moves. The lower left square is poisoned and the player forced to eat it dies and loses. The game of Chomp is a misère game. The normal game is not interesting as the first player can just eat the whole bar and win. The game of Chomp is not completely solved [4], but the first player wins (in a non-trivial game when mn > 1). This can be proven by a strategystealing argument. Suppose that the second player has a winning strategy. Suppose that in the first move the first player takes only the top right square. By our assumption, the second player has a winning response to this. But such a response is a legal first move and the first player could have played it. We study two variations of Nim and Chomp which we call Monotonic Nim and Diet Chomp. Monotonic Nim. In this variation the players are restricted to eat only shapes that are 1 by k horizontal rectangles. Equivalently, this is a variation of Nim where the number of tokens in piles must be non-decreasing through the game. This can be viewed as a merger between Nim and Chomp where the moves are the same as in Nim and the positions are restricted to Young diagrams as in Chomp. Diet Chomp. In this variation of Chomp players are not allowed to eat too much chocolate in one move. That is, the number of squares that can be removed in one move is restricted by a parameter k. The players are allowed to make a move the same way as in the game of Chomp with a condition that they can only chomp away not more than k small chocolate squares at a time. When k is given, we call this variation k-diet Chomp. Unlike regular Chomp, the normal play becomes interesting here. We also discuss the combination of these two games, which can be called Diet Monotonic Nim. We also call it Slow Monotonic Nim, because Nim itself does not imply chocolate or eating. In k-slow Monotonic Nim the starting position is a sequence of non-decreasing positive integers (a 1, a 2,..., a n ). A player can subtract up to k from one of the numbers, given that the resulting sequence is non-decreasing. It is worth noting that the misère game for monotonic variations is equivalent to considering the last token in the last pile being poisonous. To start, we recapitulate known facts about subtraction games. 2

2 Nim, Slow Nim and Extended Nim In the game of Nim there are several piles of tokens. The players are allowed to take any number of tokens from a single pile. This game started combinatorial game theory, see [3, 2, 1]. The solution to Nim is well known. Suppose A = (a 1, a 2,..., a n ), is a position in this game. Let us denote the XOR operation as. Then the following theorem is true. Theorem 1. For normal play Nim, the Grundy value of a position (a 1, a 2,..., a n ) is a 1 a 2 a n. The P-positions correspond to Grundy value zero. Corollary 2. A P-position in normal play Nim satisfies: a 1 a 2 a n = 0. Similarly, the P-positions for misère play are known [2]: Theorem 3. For the misère play if max a i > 1, a P-position satisfies: a 1 a 2 a n = 0, otherwise: a 1 a 2 a n = 1. A subtraction game, denoted Subtraction(S), is played with heaps of tokens. A move is defined by choosing a heap and removing any number of tokens, such that this number is in set S. The subtraction games are well-studied [2, 1], and we restrict ourselves to the case when S is equal to [k], where the latter denotes the range of integers from 1 to k inclusive. We call this set of games Slow Nim. For a particular k we call the game k-slow Nim. The Grundy values and P-positions for this game are known. Theorem 4. For k-slow Nim normal play, the Grundy value for a position (a 1, a 2,..., a n ) is (a 1 (mod k + 1)) (a 2 (mod k + 1)) (a n (mod k + 1)). 3

Therefore the P-positions are such that (a 1 (mod k + 1)) (a 2 (mod k + 1)) (a n (mod k + 1)) = 0. Theorem 5. The P-positions in misère k-slow Nim considered modulo k + 1 are: If there is a pile that is more than 1, then XOR is zero. If every pile is zero or one, then there is an odd number of ones. (XOR is 1) In the next variation we want to allow the players to put tokens back into a pile. It seems that such a game is not finite, as an infinite loop might be created. To avoid that, we put a limit on the number of tokens that can be put back. We call this game Extended Nim. Similarly, Extended k-slow Nim is like k-slow Nim where, in addition, the players are allowed to put up to k tokens back into any one of the piles, given that the total number of tokens that are put back is limited by k. Theorem 6. The extended games have the same P-positions as the nonextended equivalents and the same Grundy values. Proof. Consider a position A. Let S be the set of all positions to which we can move from A in a regular game and S be the positions to which we can move from A in the extended version. As we add moves: S S. Consider the sets of Grundy values G for S and G for S with respect to the nonextended game. On one hand, G G. On the other hand, G(A) / G. The latter is due to the fact that a new position A to which we can move from A in the extended game have the Grundy value different from A due to the fact that there is a move from A to A in the non-extended game. It follows that mex(g) = mex(g ), and by definition the Grundy value of A in the extended version is G(A). It follows that P-positions are the same in both games. 3 Monotonic Games To move from Nim to Chomp, we consider games where a position A = (a 1, a 2,..., a n ) is allowed only if the sequence is non-decreasing a i a i+1, for 1 i < n. 4

Monotonic Nim is a monotonic game where you can take any number of tokens from one pile, given that the resulting sequence is non-decreasing. If, in addition, we put a limit of k on the total number of tokens that can be taken we get a game that we call Monotonic k-slow Nim. As in any monotonic game the only positions that are allowed are sequences of non-decreasing positive integers (a 1, a 2,..., a n ). A player can subtract any number of tokens between 1 and k inclusive from one pile, given that the resulting sequence is non-decreasing. Suppose we have a position A = (a 1, a 2,..., a 2k ) with an even number of piles. We map it a position B = (b 1, b 2,..., b k ), where b i = a 2i a 2i 1. For a position with an odd number of piles we first extend it to a position with an even number of piles, by adding a zero pile in front. We call the position B the difference position. Theorem 7. A position A is a P-position in a Monotonic game if and only if the corresponding difference position is a P-position in the corresponding extended game. Proof. In the monotonic game, we can take any number of tokens between 1 and a 2i a 2i 1 inclusive from pile 2i. This is equivalent to taking any number of tokens between 1 and b i inclusive from pile i in the corresponding difference game. In addition, in the monotonic game, we can take any number of tokens between 1 and a 2i 1 a 2i 2 from pile 2i 1. This is equivalent to adding some tokens to the i-th pile in the differences position. Notice that the number of tokens we can add has constraints. In any case, the total number of tokens we can add is limited by k i=1 a i. We can say that the monotonic game is equivalent to playing the extended Nim with additional constraints on the difference position. In any case, we added some extra moves to the corresponding game that do not allow to move from a P-position to a P-position. That means the set of P-positions on the difference game exactly corresponds to the P-positions in the Monotonic game. Notice that the theorem works for both normal and misère plays. 5

2-Diet Chomp Normal Play Now we move to Chomp for health-conscious players. Namely, we study a variation of Chomp where a player makes a Chomp move that is limited to one or two chocolate squares. The positions in our game are A = (a 1, a 2,..., a n ), so that the sequence is non-decreasing: a i a i+1, where 1 i < n. We can assume that a 0 = 0. In one move we are allowed to: subtract 1 from a i if a i > a i 1. subtract 2 from a i if a i > a i 1 + 1. subtract 1 from a i and a i+1 if a i+1 = a i > a i 1. For 2-Diet Chomp, the P-positions depend on the total number of tokens. Lemma 8. The P-positions are such that the total number of tokens ( n ) a i is divisible by 3. Proof. The terminal position, (0), is a P-position. P-positions differ by multiples of 3, therefore there is no move from a P-position to a P-position. What is left to show is that all N-positions have a move to a P-position. Suppose ( n ) a i 1 mod 3. You can always remove one square, so it i=1 moves to a P-position. If ( n ) a i 2 mod 3, removing two squares moves i=1 it to a P-position, except there could be a position such that there is no valid move that removes two squares. The only positions for which it is not allowed to remove two squares are perfect stairs positions: (1, 2,..., n). However, the total number of tokens in such a position is a triangular number; and it is widely known that triangular numbers do not have remainder 2 modulo 3. That means we can always move from an N-position to a P-position. Interestingly, in this case the game is equivalent to playing 2-Slow Nim on one pile. i=1 6

2-Diet Chomp Misère play This game is more difficult than the normal play. We can explicitly describe P-positions for narrow rectangles. Lemma 9. For rectangles 1 by n, the P-positions are 3k + 1. For rectangles 2 by n the P-positions are (a, a + 3k + 1). Here k 0. Proof. For 1 by n rectangles, the game is equivalent to 2-Slow Nim on one pile, misère play. For 2 by n rectangles, (a 1, a 2 ) is a P-position if and only if a 2 a 1 1 (mod 3). Notice that we cannot have a move that changes both values from a P-position. By subtracting 1 or 2 from each coordinate we change the difference modulo 3. That means every move from a P-position goes to an N-position. On the other hand, from an N-position (a, a + 3k + 2), we can move to (a, a + 3k + 1), which is a P-position. From an N-position (a, a + 3k), we can move to (a 1, a + 3k), which is a P-position. Additionally, if a = 0, (0, 3k + 1) is a P-position. For 3 by n rectangles, the situation is more complicated. We wrote a program and observed that P-positions are periodic with period 12. That is, position (a 1, a 2, a 3 ) is the same type as (a 1 + 12, a 2 + 12, a 3 + 12). Figure 1 shows P-positions for values a 1 ranging from 0 to 11 inclusive. The left bottom corner corresponds to (a 1, a 1, a 1 ) and P-positions are black. We can make the following observation from this pictures: Each row eventually becomes periodic with period either 3 or 1. Each diagonal going NE becomes periodic with period either 2 or 1. If we remove the left bottom corner, a few bottom rows and a few top NE diagonals, the pictures would look the same, and the P-positions correspond to values a 1 + a 3 a 2 1 (mod 3). 4 Acknowledgments This project was part of the PRIMES STEP program. We are thankful to the program for allowing us the opportunity to conduct this research. 7

Table 1: P-positions for 2-Diet Chomp with 3 rows and a 1 ranging from 0 to 11 References [1] M. H. Albert, R. J. Nowakowski, and D. Wolfe, Lessons in Play, A. K. Peters, Wellesley MA, 2007. [2] Elwyn R. Berlekamp, John H. Conway, and Richard K. Guy, Winning Ways for Your Mathematical Plays, A. K. Peters, Natick MA, 2001. [3] Charles Bouton, Nim, a game with a complete mathematical theory, The Annals of Mathematics, 3(14):35 39, 1901. [4] Doron Zeilberger, Three-Rowed CHOMP, Adv. Applied Math. 26 (2001) 168 179. 8