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

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

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

Crossing Game Strategies

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

Senior Math Circles February 10, 2010 Game Theory II

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

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

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

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.

Game 0: One Pile, Last Chip Loses

Obliged Sums of Games

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

Definition 1 (Game). For us, a game will be any series of alternating moves between two players where one player must win.

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

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

GAME THEORY. Thomas S. Ferguson

On Variations of Nim and Chomp

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

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

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

Numan Sheikh FC College Lahore

GAMES AND STRATEGY BEGINNERS 12/03/2017

Alessandro Cincotti School of Information Science, Japan Advanced Institute of Science and Technology, Japan

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

SOME MORE DECREASE AND CONQUER ALGORITHMS

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

Another Form of Matrix Nim

Games, Triangulations, Theory

THE GAME CREATION OPERATOR

PRIMES STEP Plays Games

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

Game Simulation and Analysis

On Variants of Nim and Chomp

NIM Games: Handout 1

Sept. 26, 2012

Subtraction games with expandable subtraction sets

Analyzing ELLIE - the Story of a Combinatorial Game

Surreal Numbers and Games. February 2010

arxiv: v2 [cs.cc] 18 Mar 2013

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

A Winning Strategy for the Game of Antonim

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

Analysis of Don't Break the Ice

Legend. The Red Goal. The. Blue. Goal

ON SPLITTING UP PILES OF STONES

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

GAME THEORY. Contents. Thomas S. Ferguson University of California at Los Angeles. Introduction. References.

Solutions to Part I of Game Theory

Game, Set, and Match A Personal Journey

Final Exam, Math 6105

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

On Modular Extensions to Nim

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

Peeking at partizan misère quotients

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

Math 152: Applicable Mathematics and Computing

Narrow misère Dots-and-Boxes

Game Theory, Alive. Yuval Peres with contributions by David B. Wilson. September 27, Check for updates at

Copyright 2010 DigiPen Institute Of Technology and DigiPen (USA) Corporation. All rights reserved.

arxiv: v1 [math.ho] 17 Mar 2009

Mathematical Investigation of Games of "Take-Away"

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

Three-player impartial games

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

Game Playing Part 1 Minimax Search

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

Positive Triangle Game

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

The Galaxy. Christopher Gutierrez, Brenda Garcia, Katrina Nieh. August 18, 2012

Grade 7 & 8 Math Circles. Mathematical Games

Figure 1: The Game of Fifteen

EXPLORING TIC-TAC-TOE VARIANTS

game tree complete all possible moves

Game-playing AIs: Games and Adversarial Search I AIMA

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

Second Annual University of Oregon Programming Contest, 1998

IMOK Maclaurin Paper 2014

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

Games of No Strategy and Low-Grade Combinatorics

arxiv: v1 [cs.dm] 13 Feb 2015

Ultimately bipartite subtraction games

Chapter 1. Probability

Figure 1: A Checker-Stacks Position

Instability of Scoring Heuristic In games with value exchange, the heuristics are very bumpy Make smoothing assumptions search for "quiesence"

Lecture 33: How can computation Win games against you? Chess: Mechanical Turk

Advanced Automata Theory 4 Games

Game Theory Lecturer: Ji Liu Thanks for Jerry Zhu's slides

Nontraditional Positional Games: New methods and boards for playing Tic-Tac-Toe

New Toads and Frogs Results

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

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)

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

Z0Z. 0j0 ZPZ. 0J0 b c d

Fraser Stewart Department of Mathematics and Statistics, Xi An Jiaotong University, Xi An, Shaanxi, China

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

Binary Games. Keep this tetrahedron handy, we will use it when we play the game of Nim.

Game Theory Basics. Bernhard von Stengel

Figure 1. Mathematical knots.

Selected Game Examples

of Nebraska - Lincoln

Transcription:

K. Sutner D. Sleator* Great Theoretical Ideas In Computer Science CS 15-251 Spring 2014 Lecture 110 Feb 4, 2014 Carnegie Mellon University Tangent: Boromean Rings Mathematical Games I Challenge for next time: Generalize to n rings. Make one of paper and bring it to class. Plan The Beer Can Game Introduction to Impartial Combinatorial Games Players alternate placing beer cans on a circular table. Once placed a can cannot move. The first one who cannot put a can on the table loses. What s the winning strategy? A Take-Away Game Two Players: 1 and 2 A move consists of removing one, two, or three chips from the pile Players alternate moves, with Player 1 starting 21 chips Player that removes the last chip wins Which player would you rather be? 1

Try Small Examples! If there are 1, 2, or 3 only, player who moves next wins If there are 4 chips left, player who moves next must leave 1, 2 or 3 chips, and his opponent will win With 5, 6 or 7 chips left, the player who moves next can win by leaving 4 chips 21 chips 0, 4, 8, 12, 16, are target positions; if a player moves to that position, they can win the game Therefore, with 21 chips, Player 1 can win! What if the last player to move loses? If there is 1 chip, the player who moves next loses If there are 2,3, or 4 chips left, the player who moves next can win by leaving only 1 In this case, 1, 5, 9, 13, are a win for the second player Combinatorial Games A set of positions (position = state of the game) Two players (know the state) Rules specify for each player and for each position which moves to other positions are legal moves The players alternate moving A terminal position in one in which there are no moves The game ends when a player has no moves The game must end in a finite number of moves (No draws!) Normal Versus Misère Normal Play Rule: The last player to move wins Misère Play Rule: The last player to move loses A Terminal Position is one where the player has no moves. What is Omitted No randomness (This rules out Backgammon) No hidden state (This rules out Battleship) No draws (This rules out Chess) However, Go, Hex and many other games do fit. 2

Impartial Versus Partizan A combinatorial game is impartial if the same set of moves is available to both players in any position. Example: the takeaway game. A combinatorial game is partizan if the move sets may differ for the two players. Example: chess*. * Make chess a combinatorial by awarding a draw to black. Impartial Versus Partizan In this class we'll study impartial games. Partizan games will not be discussed (except on this slide) They have a deep and beautiful theory too! See Winning Ways by Berelekamp, Guy and Conway And Surreal Numbers by Knuth Conway developed an alternative definition of numbers based on the theory of partizan games. See On Numbers and Games. P-Positions and N-Positions For impartial normal games P-Position: Positions that are winning for the Previous player (the player who just moved) (Sometimes called LOSING positions) 0, 4, 8, 12, 16, are P-positions; if a player moves to that position, they can win the game N-Position: Positions that are winning for the Next player (the player who is about to move) (Sometimes called WINNING positions) 21 chips 21 chips is an N-position What s a P-Position? Positions that are winning for the Previous player (the player who just moved) That means: For any move that N makes There exists a move for P such that For any move that N makes There exists a move for P such that There exists a move for P such that There are no possible moves for N P-positions and N-positions can be defined recursively by the following: (1) All terminal positions are P- positions (normal winning rule) (2) A position where all moves give N-positions is an P-position (3) A position where at least 1 move gives a P-position is an N-position. 3

Theorem: Every position in any combinatorial game is game either a P or an N position. Proof: Immediate from the labeling algorithm on the previous slide, and the fact that the game must end. (It s induction.) Chomp! Two-player game, where each move consists of taking a square and removing it and all squares to the right and above. BUT -- You cannot move to (1,1) Show That This is a P-position Show That This is an N-position N-Positions! P-position! Let s Play! I m player 1 No matter what you do, I can mirror it! 4

Theorem: A square starting position of Chomp is an N-position (Player 1 can win) Mirroring is an extremely important strategy in combinatorial games! Proof: The winning strategy for player 1 is to chomp on (2,2), leaving only an L shaped position Then, for any move that Player 2 takes, Player 1 can simply mirror it on the flip side of the L Theorem: Every rectangle of area>1 is a N-position Proof: Consider this position: This is either a P or an N-position. If it s a P-position, then the original rectangle was N. If it s an N-position, then there exists a move from it to a P-position X. But by the geometry of the situation, X is also available as a move from the starting rectangle. It follows that the original rectangle is an N-position. QED Notice that this is a non-constructive proof. We ve shown that there exists a winning move from a rectangle, but we have not found the move. x y z The Game of Nim Two players take turns moving Winner is the last player to remove chips A move consists of selecting a pile and removing one or more chips from it. (In one move, you cannot remove chips from more than one pile.) Analyzing Simple Positions One-Pile Nim x y z We use (x,y,z) to denote this position (0,0,0) is a: P-position What happens in positions of the form (x,0,0)? (with x>0) The first player can just take the entire pile, so (x,0,0) is an N-position 5

Two-Pile Nim P-positions are those for which the two piles have an equal number of chips. If it is the opponent s turn to move from such a position, he must change to a position in which the two piles have different number of chips. From a position with an unequal number of chips, you can easily go to one with an equal number of chips (perhaps the terminal position). (Mirroring again.) Nim-Sum The nim-sum of two non-negative integers is their addition without carry in base 2. We will use to denote the nim-sum 2 3 = 5 3 = 7 4 = (10) 2 (11) 2 = (01) 2 = 1 (101) 2 (011) 2 = (110) 2 = 6 (111) 2 (100) 2 = (011) 2 = 3 is associative: (a b) c = a (b c) is commutative: a b = b a For any non-negative integer x, Cancellation Property Holds If x y = x z x x = 0 Then x x y = x x z So y = z Bouton s Theorem: A position (x,y,z) in Nim is a P-position if and only if x y z = 0 Proof: Let Z denote the set of Nim positions with nim-sum zero Let NZ denote the set of Nim positions with non-zero nim-sum We prove the theorem by proving that Z and NZ satisfy the three conditions of P-positions and N-positions (1) All terminal positions are in Z The only terminal position is (0,0,0) (2) From each position in NZ, there is a move to a position in Z 001010001 100010111 111010000 001010001 100010111 101000110 010010110 000000000 Look at leftmost column with an odd # of 1s Rig any of the numbers with a 1 in that column so that everything adds up to zero 6

(3) Every move from a position in Z is to a position in NZ If (x,y,z) is in Z, and x is changed to xʹ x, then we cannot have x y z = 0 = xʹ y z Because then x = xʹ QED Study Bee Combinatorial games Impartial versus Partizan Normal Versus Misère P-positions versus N-positions Mirroring Chomp Nim Nim-sum Bouton s Theorem 7