Progressively Finite Games

Slides:



Advertisements
Similar presentations
ICAMP: Game Simulation and Analysis Analysis of the Game “Poison” Sarah Eichhorn University of California Irvine iCAMP Overview Meeting, 5/5/10.
Advertisements

Based on slides by Y. Peng University of Maryland
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Introduction to Combinatorial Game Acm Honored Class Weitao.
AE1APS Algorithmic Problem Solving John Drake.  Invariants – Chapter 2  River Crossing – Chapter 3  Logic Puzzles – Chapter 5  Matchstick Games -
The Wonderful World of Hackenbush Games And Their Relation to the Surreal Numbers.
Nim, nim.py and games.py Homework 4 Problem 4. The History of Nim Games Believed to have been created in China; unknown date of origin First actual recorded.
New Toads and Frogs Results By Jeff Erickson Presented by Nate Swanson.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
The Game of Nim on Graphs: NimG Gwendolyn Stockman Alan Frieze and Juan Vera.
Games Game 1 Each pair picks exactly one whole number The lowest unique positive integer wins Game 2: Nim Example: Player A picks 5, Player B picks 6,
The Game of Contorted Fractions. 2 Rules of the Game Typical position has a number of real numbers in boxes. The typical legal move is to alter just one.
CS5371 Theory of Computation
CSE115/ENGR160 Discrete Mathematics 02/07/12
The Game of Nim on Graphs: NimG By Gwendolyn Stockman With: Alan Frieze, and Juan Vera.
Using Reduction for the Game of NIM. At each turn, a player chooses one pile and removes some sticks. The player who takes the last stick wins. Problem:
Time for playing games Form pairs You will get a sheet of paper to play games with You will have 12 minutes to play the games and turn them in.
Graphs, relations and matrices
Adding and Subtracting Integers.
Games, Hats, and Codes Mira Bernstein Wellesley College SUMS 2005.
Induction and recursion
Great Theoretical Ideas in Computer Science.
Great Theoretical Ideas in Computer Science.
1/22/03Tucker, Applied Combinatorics, Section EDGE COUNTING TUCKER, APPLIED COMBINATORICS, SECTION 1.3, GROUP B Michael Duquette & Amanda Dargie.
A Storyteller’s Tale Many years ago, wandering storytellers travelled from village to village telling stories in exchange for food, shelter, and money.
Kim Moore, Program Manager Dr. Tonya Jeffery, Co-PI.
Discrete Mathematics CS 2610 March 26, 2009 Skip: structural induction generalized induction Skip section 4.5.
Copyright © Cengage Learning. All rights reserved.
Induction and recursion
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
A few leftover Decrease-and-conquer Algorithms
Part II - Sums of Games Consider a game called Boxing Match which was defined in a programming contest m.short.html.
Graph Theory Topics to be covered:
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
Surreal Number Tianruo Chen. Introduction In mathematics system, the surreal number system is an arithmetic continuum containing the real number as infinite.
Copyright © Cengage Learning. All rights reserved. CHAPTER 10 GRAPHS AND TREES.
(CSC 102) Lecture 29 Discrete Structures. Graphs.
Section 3.1: Proof Strategy Now that we have a fair amount of experience with proofs, we will start to prove more difficult theorems. Our experience so.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
Based on slides by Y. Peng University of Maryland
Mathematical Preliminaries
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
An Introduction to Game Theory Math 480: Mathematics Seminar Dr. Sylvester.
Winning Strategies of Games Played with Chips. I got a interesting game Now we show the game P 1 =4 P 2 =6 P 3 =8 Rule 1: Two players.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Combinatorics Ramsey theory.  a precocious British mathematician, philosopher and economist  a problem in mathematical logic: can one always find order.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
The Lovely Game of NIM. Version 1 - Classic NIM You will need seven objects, such as counters or blocks. It is a game for two players. Place the 7 counters.
Benjamin Casey C S 329 E Spring  Variants played since ancient times; resemblance to Chinese “Jianshizi” or “picking stones”  Current name and.
03/05/13 More Induction Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1 Artist: Frank.
Theory of Computational Complexity Probability and Computing Lee Minseon Iwama and Ito lab M1 1.
K 3 -Saturator By Roy Oursler. What is K 3 -Saturator K 3 -Saturator is a combinatorial game A combinatorial game is a two player game where both of the.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Content Game of Nim Impartial Games Sprague-Grundy theorem
Algebra 2 Properties of Real Numbers Lesson 1-2 Goals Goal To graph and order real numbers. To Identity properties of real numbers. Rubric Level 1 –
Trees.
Some more Decrease-and-conquer Algorithms
Introductory Game Theory
Great Theoretical Ideas in Computer Science
Applied Discrete Mathematics Week 13: Graphs
SCIT1003 Chapter 2: Sequential games - perfect information extensive form Prof. Tsang.
Based on slides by Y. Peng University of Maryland
Adding and Subtracting Integers.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Game Theory Day 2: More Simple Games.
Applied Discrete Mathematics Week 13: Graphs
Based on slides by Y. Peng University of Maryland
Presentation transcript:

Progressively Finite Games With Emphasis on the Game of Nim By Michael Duquette

Progressively Finite Games have the following characteristics _____________________________________ There are only two players There is a finite set of possible positions in every game The rules of the game specify for both players and each position which moves to other positions are legal moves Players alternate moving The game ends when a position is reached, called a terminal position, from which no other moves from the other player can be made The game ends in a finite number of moves no matter how it is played

Example 1: A Simple Take-Away Game Scenario: A set of thirteen objects are placed on a table. Two players must take turns removing 1, 2 or 3 objects from the pile. The winner is the player who removes the last object from the table. In order to visualize the set of possible moves to determine a winning strategy we can model the game using a directed graph. Let each vertex represent a possible position in the game and a directed edge connecting possible moves in the game. 12 10 11 9 8 7 6 4 5 3 2 1 13

Example 1: A Simple Take-Away Game Backward induction is a useful tool for determining the winning strategy and the various positions can be labeled using this technique. First we must define the positions to be labeled: P-positions: Are winning positions for the previous player N-Positions: Are losing positions for the next player

Example 1: A Simple Take-Away Game Label every terminal position a P-position. Label every position that can reach a labeled P-position in one move as an N-position. Find those positions whose only moves are to labeled N-positions and label them as P-positions. If you found no new P-positions the process is complete, otherwise return to step 2. 7 6 5 4 2 3 1 Terminal Position P N P

Kernel: By labeling all the winning positions as P-positions we were forming a subset of vertices known as a kernel. The kernel of any progressively finite game has the following properties: There is no edge joining any two vertices in the kernel. There is an edge from every non-kernel vertex to some kernel vertex. Ex. Kernel Vertices Non-Kernel Vertices

Theorem 1: If the graph of a progressively finite game has a kernel k, then a winning strategy for the first player is to move to a kernel vertex on every turn. However, if the starting vertex is in the kernel, then the second player can utilize this winning strategy. Theorem 2: Every progressively finite game has a unique winning strategy. That is, the graph of every progressively finite game has a unique kernel.

The Game of Nim _______________________________________________ A slightly more complex take-away game involving several piles of objects. Two players take turns removing any amount of objects from one of the piles. The winner is the person who removes the last object from the last remaining pile.

To construct a winning strategy for the game of Nim we will use a technique called Nim-Sum: The Nim-Sum of two non-negative integers is their addition in base 2. Base 2: Every integer can be written in a series of 1’s and 0’s in the form: Ex.

To take the Nim-Sum of two integers Convert them to base 2 Take their direct sum mod 2 Ex.

Nim-Sum is the only possible technique for winning at Nim Theorem 3: A position in Nim is a P-position or winning position if and only if the Nim-Sum of its components is zero; Note: Nim-Sum is associative and commutative so the order in which we take the Nim-Sum doesn’t matter.

Example 3: The Game of Nim There are 3 piles of objects with 5, 7 and 9 objects respectively. Part I: Compute the Nim-Sum to determine if the first or second player has the winning strategy. Answer: Since the Nim-Sum is not equal to 0, position (5,7,9) is not a winning position. Therefore, the first player can move to a winning position and formulate a winning strategy.

Example 3: The Game of Nim Part II: What is the initial move to ensure that the first player moves to a winning position? Answer: There is only one possible move. You must take away 7 objects from the 9 pile so that you will be left with 2.

Homework Question: For the following Nim game with four piles consisting of 2, 4, 4, and 6 objects find the moves that yield the positions with Nim-Sum equal to: (a) 1 (b) 2 (c) What is your initial move if you want to win the game?

Homework Answers Take 3 objects away from either 4 object pile. Take all of the objects from the six object pile Original Nim-Sum (c) Take away all four objects from one of the 4 object piles