Basic rules. Two players: Blue and Red. Perfect information. Players move alternately. First player unable to move loses. The game must terminate.

Similar documents
Sowing Games JEFF ERICKSON

Gamesman: A Graphical Game Analysis System

One pile, two pile, three piles

Colored Hats and Logic Puzzles

15-251: Great Theoretical Ideas in Computer Science Anupam Gupta Notes on Combinatorial Games (draft!!) January 29, 2012

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

AN ANALYSIS OF A WAR-LIKE CARD GAME. Introduction

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

Math 319 Problem Set #3 Solution 21 February 2002

Playing with Numbers

NIM with Cash. Abstract. loses. This game has been well studied. For example, it is known that for NIM(1, 2, 3; n)

Chapter 31 out of 37 from Discrete Mathematics for Neophytes: Number Theory, Probability, Algorithms, and Other Stuff by J. M.


ON KOTZIG S NIM. Xin Lu Tan 1 Wharton Statistics Department, University of Pennsylvania, Philadelphia, Pennsylvania xtan@wharton.upenn.

Full and Complete Binary Trees

Ch. 13.2: Mathematical Expectation

Expected Value. 24 February Expected Value 24 February /19

8 Primes and Modular Arithmetic

Just the Factors, Ma am

A NOTE ON OFF-DIAGONAL SMALL ON-LINE RAMSEY NUMBERS FOR PATHS

How to Gamble If You Must

POLYNOMIAL FUNCTIONS

arxiv: v2 [math.ho] 4 Nov 2009

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

A Non-Linear Schema Theorem for Genetic Algorithms

CS 3719 (Theory of Computation and Algorithms) Lecture 4

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Regular Languages and Finite Automata

TAKE-AWAY GAMES. ALLEN J. SCHWENK California Institute of Technology, Pasadena, California INTRODUCTION

k, then n = p2α 1 1 pα k

Solutions for Practice problems on proofs

Current California Math Standards Balanced Equations

6.207/14.15: Networks Lecture 15: Repeated Games and Cooperation

Sequential lmove Games. Using Backward Induction (Rollback) to Find Equilibrium

Continued Fractions and the Euclidean Algorithm

Section 1.3 P 1 = 1 2. = P n = 1 P 3 = Continuing in this fashion, it should seem reasonable that, for any n = 1, 2, 3,..., =

REPEATED TRIALS. The probability of winning those k chosen times and losing the other times is then p k q n k.

Groups in Cryptography

The positive minimum degree game on sparse graphs

Backward Induction and Subgame Perfection

Notes on Complexity Theory Last updated: August, Lecture 1

Reading 13 : Finite State Automata and Regular Expressions

1. Prove that the empty set is a subset of every set.

Algebra 2 C Chapter 12 Probability and Statistics

Mathematical Induction

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Set Theory Basic Concepts and Definitions

Systems of Linear Equations

Probabilistic Strategies: Solutions

Section 6.1 Discrete Random variables Probability Distribution

MATH 289 PROBLEM SET 4: NUMBER THEORY

Solution to Exercise 2.2. Both m and n are divisible by d, som = dk and n = dk. Thus m ± n = dk ± dk = d(k ± k ),som + n and m n are divisible by d.

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

COUNTING SUBSETS OF A SET: COMBINATIONS

CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Chapter 11 Number Theory

Lecture 13 - Basic Number Theory.

Handout #1: Mathematical Reasoning

23. RATIONAL EXPONENTS

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

Probability and Expected Value

PYTHAGOREAN TRIPLES KEITH CONRAD

The sum of digits of polynomial values in arithmetic progressions

MATH Fundamental Mathematics IV

6.254 : Game Theory with Engineering Applications Lecture 2: Strategic Form Games

Optimization in ICT and Physical Systems

An inequality for the group chromatic number of a graph

Binary Adders: Half Adders and Full Adders

25 Integers: Addition and Subtraction

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Unified Lecture # 4 Vectors

Stanford Math Circle: Sunday, May 9, 2010 Square-Triangular Numbers, Pell s Equation, and Continued Fractions

Math 4310 Handout - Quotient Vector Spaces

The degree of a polynomial function is equal to the highest exponent found on the independent variables.

FEGYVERNEKI SÁNDOR, PROBABILITY THEORY AND MATHEmATICAL

Pigeonhole Principle Solutions

mod 10 = mod 10 = 49 mod 10 = 9.

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

3. Mathematical Induction

Permutation Groups. Tom Davis April 2, 2003

Just Visiting. Visiting. Just. Sell. Sell $20 $20. Buy. Buy $20 $20. Sell. Sell. Just Visiting. Visiting. Just

Estimating the Average Value of a Function

WORKED EXAMPLES 1 TOTAL PROBABILITY AND BAYES THEOREM

Minimax Strategies. Minimax Strategies. Zero Sum Games. Why Zero Sum Games? An Example. An Example

TEACHER S GUIDE TO RUSH HOUR

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

GAME THEORY. Thomas S. Ferguson University of California at Los Angeles INTRODUCTION.

3 Some Integer Functions

MA4001 Engineering Mathematics 1 Lecture 10 Limits and Continuity

That s Not Fair! ASSESSMENT #HSMA20. Benchmark Grades: 9-12

Indices and Surds. The Laws on Indices. 1. Multiplication: Mgr. ubomíra Tomková

Worksheet for Teaching Module Probability (Lesson 1)

ELLIPTIC CURVES AND LENSTRA S FACTORIZATION ALGORITHM

The last three chapters introduced three major proof techniques: direct,

An inequality for the group chromatic number of a graph

Math Quizzes Winter 2009

0.8 Rational Expressions and Equations

TU e. Advanced Algorithms: experimentation project. The problem: load balancing with bounded look-ahead. Input: integer m 2: number of machines

Transcription:

Basic rules Two players: Blue and Red. Perfect information. Players move alternately. First player unable to move loses. The game must terminate.

Outcomes (assuming perfect play) Blue wins (whoever moves first): G > 0 Red wins (whoever moves first): G < 0 Mover loses: G = 0 Mover wins: G 0

Two elegant classes of games number game: always disadvantageous to move (so never G 0) impartial game: same moves always available to each player

Blue-Red Hackenbush prototypical number game: ground Blue-Red Hackenbush: A player removes one edge of his or her color. Any edges not connected to the ground are also removed. First person unable to move loses.

An example

A Hackenbush sum Let G be a Blue-Red Hackenbush position (or any game). Recall: Blue wins: G > 0 Red wins: G < 0 Mover loses: G = 0 G H G + H

A Hackenbush value value (to Blue): 3 1 3 2 3 sum: 2 (Blue is two moves ahead), G> 0 3 2 2 2 1 sum: 0 (mover loses), G= 0

1/2 G value =? clearly >0: Blue wins mover loses! x + x - 1 = 0, so x = 1/2 Blue is 1/2 move ahead in G.

Another position What about?

Another position What about? Clearly G < 0.

13/8 8x + 13 = 0 (mover loses!) x = -13/8

b and r How to compute the value v(g) of any Blue-Red Hackenbush position G? Let b be the largest value of any position to which Blue can move. Let r be the smallest value of any position to which Red can move. (We will always have b < r.)

The simplicity rule The Simplicity Rule. (a) If there is an integer n satisfying b < n < r, then v(g) is the closest such integer to 0. (b) Otherwise v(g) is the (unique) rational number x satisfying b < x < r whose denominator is the smallest possible power of 2.

The simplicity rule The Simplicity Rule. (a) If there is an integer n satisfying b < n < r, then v(g) is the closest such integer to 0. (b) Otherwise v(g) is the (unique) rational number x satisfying b < x < r whose denominator is the smallest possible power of 2. Moreover, v(g + H) = v(g) + v(h).

Some examples Examples. b r x 2 3 4 6 1 2 3 5 2 5 8 0 0 1 1 1 4 1 4 5 16 7 16 2 9 32 3 8 2 7 8 2 3 32 2 1 2

A Hackenbush computation value x 0 1/2 2 b = 1/2, r = 2, x = 1 1-1 = 0 (mover loses)

Value of Blue-Red strings 1 + 1. 0 1 1 0 1 = 2 + 1/4 + 1/8 + 1/32 = 2 13/32. - 1 1 0 1 1 1 = - ( 1/2 + 1/4 + 1/16 + 1/32 + 1/64) = - 55/64

Impartial Hackenbush Now suppose there are also black edges, which either player can remove. A game with all black edges is called an impartial (Hackenbush) game. At any stage of such a game, the two players always have the same available moves.

1 *1 Mover wins! Not a number game. Neither = 0, < 0, or > 0. Two outcomes of any impartial game: mover wins or mover loses.

n Denote by n (star n) the impartial game with one chain of length n. *5

A nice fact We can still assign a number with useful properties to an impartial game, based on the following fact. Fact. Given any (finite) impartial game G, there is a unique integer n 0 such that mover loses in the sum of G and n, i.e., G + n = 0.

The Sprague-Grundy number Fact. Given any (finite) impartial game G, there is a unique integer n 0 such that mover loses in the sum of G and n, i.e., G + n = 0.

The Sprague-Grundy number Fact. Given any (finite) impartial game G, there is a unique integer n 0 such that mover loses in the sum of G and n, i.e., G + n = 0. Denote this integer by N(G), the Sprague-Grundy number of G. NOTE: Mover loses (i.e., G = 0) if and only if N(G) = 0.

A simple example Mover loses (second player copies first player). N (*5) = 5 *5 + *5 = 0 *5 *5 In general, N( n) = n.

Nim addition Nim addition. Define m n by writing m and n in binary, adding without carrying (mod 2 addition in each column), and reading result in binary.

Nim addition Nim addition. Define m n by writing m and n in binary, adding without carrying (mod 2 addition in each column), and reading result in binary. Example. 13 11 7 4 = 5 8 4 2 1 13 = 1 1 0 1 11 = 1 0 1 1 7 = 1 1 1 4 = 1 0 0 5 = 0 1 0 1

The Nim-Sum Theorem Nim-sum Theorem. Let G and H be impartial games. Then N(G + H) = N(G) N(H).

Nim Nim: sum of n s.

Nim Nim: sum of n s. Last Year at Marienbad: *1 + *3 + *5 + *7

1 + 3 + 5 + 7 *1 + *3 + *5 + *7 so mover loses! 4 2 1 1 = 1 3 = 1 1 5 = 1 0 1 7 = 1 1 1 0 = 0 0 0,

A Nim example How to play Nim: G = 23 + 18 + 13 + 7 + 5 23 = 10111 18 = 10010 13 = 110 1 0111 = 7 7 = 111 5 = 101

A Nim example How to play Nim: G = 23 + 18 + 13 + 7 + 5 23 = 10111 18 = 10010 13 = 110 1 0111 = 7 7 = 111 5 = 101 Only winning move is to change 13 to 7.

The minimal excludant How to compute N(G) in general: If S is a set of nonnegative integers, let mex(s) (the minimal excludant of S) be the least nonnegative integer not in S. mex{0, 1, 2, 5, 6, 8} = 3 mex{4, 7, 8, 12} = 0.

The Mex Rule Mex Rule (analogue of Simplicity Rule). Let S be the set of all Sprague-Grundy numbers of positions that can be reached in one move from the impartial game G. Then N(G) = mex(s).

A mex example Can move to 4, 1 3 = 2, and 2 2 = 0. Thus N(G) = mex{0, 2, 4} = 1.

A mex example Can move to 4, 1 3 = 2, and 2 2 = 0. Thus N(G) = mex{0, 2, 4} = 1. mover loses!

The infinite... Clearly v(g) > n for all n, i.e., G is infinite. Say v(g) = ω.

The infinite... Clearly v(g) > n for all n, i.e., G is infinite. Say v(g) = ω. (Still ends in finitely many moves.)

Even more infinite... Clearly G ω > 0, so G is more infinite than ω. Call v(g) = ω + 1.

ω + 1 versus ω...... Blue takes the isolated edge to win.

Ordinal games Similarly, every ordinal number is the value of a game.

ω 1... We can do more! v(g) = ω 1.

A big field Can extend ordinal numbers to an abelian group N.

A big field Can extend ordinal numbers to an abelian group N. Conway defined the product of G H of any two games. This turns N into a field. We can extend this to a real closed field, each element of which is a number game...

The field I The product G H turns the set { 0, 1, 2,... } into a field I! Since n + n = 0, char(i) = 2.

The field I The product G H turns the set { 0, 1, 2,... } into a field I! Since n + n = 0, char(i) = 2. In fact, I is the quadratic closure of F 2.

Mixed games

Mixed games Much more complicated!

Up Not a Hackenbush game. 0 up Outcome? *1

Up Not a Hackenbush game. 0 up Outcome? *1 Blue wins, so > 0.

is very tiny... up 1/ω Red wins, so 0 < < 1/ω. In fact, for any number game G > 0, we have 0 < < G.

Caveat Caveat. is not a number game. Red can move to 1, where it is not disadvantageous to move.

References 1. E. R. Berlekamp, The Dots and Boxes Game, A K Peters, Natick, Massachusetts, 2000. The classic children s game Dots and Boxes is actually quite sophisticated and uses many deep aspects of the theory of impartial games. 2. E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways, Academic Press, New York, 1982. The Bible of the theory of mathematical games, with many general principles and interesting examples.

3. E. R. Berlekamp and D. Wolfe, Mathematical Go, A K Peters, Wellesley, MA, 1994. Applications of the theory to the game of Go. 4. J. H. Conway, On Numbers and Games, Academic Press, London/New York, 1976. The first development of a unified theory of mathematical games.

5. D. E. Knuth, Surreal Numbers, Addison-Wesley, Reading, MA, 1974. An exposition of the numerical aspects of Conway s theory of mathematical games and the resulting theory of infinitesimal and infinite numbers, in the form of a two-person dialogue.

6. R. J. Nowakowski, ed., Games of No Chance, MSRI Publications 29, Cambridge University Press, New York/Cambridge, 1996. Many articles on mathematical games, including some applications to real games such as chess and Go. There are two sequels.

How can I get these slides? Slides available at: www-math.mit.edu/ rstan/transparencies/games.pdf