basic rules - mit mathematics

58
Basic rules Two players: Blue and Red. Perfect information. Players move alternately. First player unable to move loses. The game must terminate. Mathematical Games – p. 1

Upload: others

Post on 12-Sep-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Basic rules - MIT Mathematics

Basic rules

Two players: Blue and Red.

Perfect information.

Players move alternately.

First player unable to move loses .

The game must terminate.

Mathematical Games – p. 1

Page 2: Basic rules - MIT Mathematics

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

Mathematical Games – p. 2

Page 3: Basic rules - MIT Mathematics

Two elegant classes of games

number game : always disadvantageous tomove (so never G‖0)

impartial game : same moves alwaysavailable to each player

Mathematical Games – p. 3

Page 4: Basic rules - MIT Mathematics

Blue-Red Hackenbush

ground

prototypical number game:

Blue-Red Hackenbush : A player removes oneedge of his or her color. Any edges notconnected to the ground are also removed. Firstperson unable to move loses.

Mathematical Games – p. 4

Page 5: Basic rules - MIT Mathematics

An example

Mathematical Games – p. 5

Page 6: Basic rules - MIT Mathematics

A Hackenbush sum

Let G be a Blue-Red Hackenbush position (orany game). Recall:

Blue wins: G > 0

Red wins: G < 0

Mover loses: G = 0

G + H

HG

Mathematical Games – p. 6

Page 7: Basic rules - MIT Mathematics

A Hackenbush value

sum: 0 (mover loses), G= 0

sum: 2 (Blue is two moves ahead), G> 0

−1−2−223

−3−2313value (to Blue):

Mathematical Games – p. 7

Page 8: Basic rules - MIT Mathematics

1/2

value = ?clearly >0: Blue wins

mover loses!

x + x - 1 = 0, so x = 1/2

G

Blue is 1/2 move ahead in G.

Mathematical Games – p. 8

Page 9: Basic rules - MIT Mathematics

Another position

What about

?

Mathematical Games – p. 9

Page 10: Basic rules - MIT Mathematics

Another position

What about

?

Clearly G < 0.

Mathematical Games – p. 9

Page 11: Basic rules - MIT Mathematics

−13/8

8x + 13 = 0 (mover loses!)

x = -13/8Mathematical Games – p. 10

Page 12: Basic rules - MIT Mathematics

b and r

How to compute the value v(G) of any Blue-RedHackenbush position G?

Let b be the largest value of any position to whichBlue can move. Let r be the smallest value of anyposition to which Red can move. (We will alwayshave b < r.)

Mathematical Games – p. 11

Page 13: Basic rules - MIT Mathematics

The simplicity rule

The Simplicity Rule. (a) If there is an integer nsatisfying b < n < r, then v(G) is the closestsuch integer to 0.

(b) Otherwise v(G) is the (unique) rationalnumber x satisfying b < x < r whosedenominator is the smallest possible power of 2.

Mathematical Games – p. 12

Page 14: Basic rules - MIT Mathematics

The simplicity rule

The Simplicity Rule. (a) If there is an integer nsatisfying b < n < r, then v(G) is the closestsuch integer to 0.

(b) Otherwise v(G) is the (unique) rationalnumber x satisfying b < x < r whosedenominator is the smallest possible power of 2.

Moreover, v(G + H) = v(G) + v(H).

Mathematical Games – p. 12

Page 15: Basic rules - MIT Mathematics

Some examples

Examples.

b r x

23

461

23

−5 25

80

0 1 1

2

1

4

5

16

9

32

1

4

7

16

3

8

−27

8−2 3

32−21

2

Mathematical Games – p. 13

Page 16: Basic rules - MIT Mathematics

A Hackenbush computation

0 1/2 2

b = 1/2, r = 2, x = 1

1 = 0 (mover loses)1 -

xvalue

Mathematical Games – p. 14

Page 17: Basic rules - MIT Mathematics

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

Mathematical Games – p. 15

Page 18: Basic rules - MIT Mathematics

Impartial Hackenbush

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

Mathematical Games – p. 16

Page 19: Basic rules - MIT Mathematics

∗1

*1

Mover wins! Not a number game.

Neither = 0, < 0, or > 0.

Two outcomes of any impartial game: moverwins or mover loses.

Mathematical Games – p. 17

Page 20: Basic rules - MIT Mathematics

∗n

Denote by ∗n (star n) the impartial game withone chain of length n.

*5Mathematical Games – p. 18

Page 21: Basic rules - MIT Mathematics

A nice fact

We can still assign a number with usefulproperties to an impartial game, based on thefollowing fact.

Fact. Given any (finite) impartial game G, there isa unique integer n ≥ 0 such that mover loses inthe sum of G and ∗n, i.e.,

G + ∗n = 0.

Mathematical Games – p. 19

Page 22: Basic rules - MIT Mathematics

The Sprague-Grundy number

Fact. Given any (finite) impartial game G, thereis a unique integer n ≥ 0 such that mover losesin the sum of G and ∗n, i.e.,

G + ∗n = 0.

Mathematical Games – p. 20

Page 23: Basic rules - MIT Mathematics

The Sprague-Grundy number

Fact. Given any (finite) impartial game G, thereis a unique integer n ≥ 0 such that mover losesin the sum of G and ∗n, i.e.,

G + ∗n = 0.

Denote this integer by N(G), the Sprague-Grundynumber of G.

NOTE: Mover loses (i.e., G = 0) if and only ifN(G) = 0.

Mathematical Games – p. 20

Page 24: Basic rules - MIT Mathematics

A simple example

N (*5) = 5

*5 *5

Mover loses (second player copiesfirst player).

*5 + *5 = 0

In general, N(∗n) = n.

Mathematical Games – p. 21

Page 25: Basic rules - MIT Mathematics

Nim addition

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

Mathematical Games – p. 22

Page 26: Basic rules - MIT Mathematics

Nim addition

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

Example. 13 ⊕ 11 ⊕ 7 ⊕ 4 = 5

8 4 2 113 = 1 1 0 111 = 1 0 1 17 = 1 1 14 = 1 0 05 = 0 1 0 1

Mathematical Games – p. 22

Page 27: Basic rules - MIT Mathematics

The Nim-Sum Theorem

Nim-sum Theorem. Let G and H be impartialgames. Then

N(G + H) = N(G) ⊕ N(H).

Mathematical Games – p. 23

Page 28: Basic rules - MIT Mathematics

Nim

Nim : sum of ∗n’s.

Mathematical Games – p. 24

Page 29: Basic rules - MIT Mathematics

Nim

Nim : sum of ∗n’s.

Last Year at Marienbad :

*1 + *3 + *5 + *7

Mathematical Games – p. 24

Page 30: Basic rules - MIT Mathematics

∗1 + ∗3 + ∗5 + ∗7

*1 + *3 + *5 + *7

4 2 11 = 13 = 1 15 = 1 0 17 = 1 1 10 = 0 0 0,

so mover loses!

Mathematical Games – p. 25

Page 31: Basic rules - MIT Mathematics

A Nim example

How to play Nim :

G = ∗23 + ∗18 + ∗13 + ∗7 + ∗5

23 = 1011118 = 10010

7 = 111 5 = 101

113 = 1 10 0111 = 7

Mathematical Games – p. 26

Page 32: Basic rules - MIT Mathematics

A Nim example

How to play Nim :

G = ∗23 + ∗18 + ∗13 + ∗7 + ∗5

23 = 1011118 = 10010

7 = 111 5 = 101

113 = 1 10 0111 = 7

Only winning move is to change ∗13 to ∗7.

Mathematical Games – p. 26

Page 33: Basic rules - MIT Mathematics

The minimal excludant

How to compute N(G) in general : If S is a setof nonnegative integers, let mex(S) (theminimal excludant of S) be the leastnonnegative integer not in S.

mex{0, 1, 2, 5, 6, 8} = 3

mex{4, 7, 8, 12} = 0.

Mathematical Games – p. 27

Page 34: Basic rules - MIT Mathematics

The Mex Rule

Mex Rule (analogue of Simplicity Rule). Let S bethe set of all Sprague-Grundy numbers ofpositions that can be reached in one move fromthe impartial game G. Then

N(G) = mex(S).

Mathematical Games – p. 28

Page 35: Basic rules - MIT Mathematics

A mex example

Can move to 4, 1 ⊕ 3 = 2, and 2 ⊕ 2 = 0. Thus

N(G) = mex{0, 2, 4} = 1.

Mathematical Games – p. 29

Page 36: Basic rules - MIT Mathematics

A mex example

Can move to 4, 1 ⊕ 3 = 2, and 2 ⊕ 2 = 0. Thus

N(G) = mex{0, 2, 4} = 1.

mover loses!

Mathematical Games – p. 29

Page 37: Basic rules - MIT Mathematics

The infinite

.

.

.

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

Mathematical Games – p. 30

Page 38: Basic rules - MIT Mathematics

The infinite

.

.

.

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

Mathematical Games – p. 30

Page 39: Basic rules - MIT Mathematics

Even more infinite

.

.

.

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

Mathematical Games – p. 31

Page 40: Basic rules - MIT Mathematics

ω + 1 versus −ω

.

.

.

.

.

.

Blue takes the isolated edge to win.

Mathematical Games – p. 32

Page 41: Basic rules - MIT Mathematics

Ordinal games

Similarly, every ordinal number is the value of agame.

Mathematical Games – p. 33

Page 42: Basic rules - MIT Mathematics

ω − 1

.

.

.

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

Mathematical Games – p. 34

Page 43: Basic rules - MIT Mathematics

A big field

Can extend ordinal numbers to an abeliangroup N .

Mathematical Games – p. 35

Page 44: Basic rules - MIT Mathematics

A big field

Can extend ordinal numbers to an abeliangroup N .

Conway defined the product of G · H of any twogames. This turns N into a field. We can extendthis to a real closed field, each element of whichis a number game . . . .

Mathematical Games – p. 35

Page 45: Basic rules - MIT Mathematics

The field I

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

Mathematical Games – p. 36

Page 46: Basic rules - MIT Mathematics

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 F2.

Mathematical Games – p. 36

Page 47: Basic rules - MIT Mathematics

Mixed games

Mathematical Games – p. 37

Page 48: Basic rules - MIT Mathematics

Mixed games

Much more complicated!

Mathematical Games – p. 37

Page 49: Basic rules - MIT Mathematics

Up

Not a Hackenbush game.

0

*1up

Outcome?

Mathematical Games – p. 38

Page 50: Basic rules - MIT Mathematics

Up

Not a Hackenbush game.

0

*1up

Outcome?

Blue wins, so ↑> 0.

Mathematical Games – p. 38

Page 51: Basic rules - MIT Mathematics

↑ is very tiny

up −1/ω

..

.

Red wins, so 0 <↑< 1/ω. In fact, for any numbergame G > 0, we have 0 <↑< G.

Mathematical Games – p. 39

Page 52: Basic rules - MIT Mathematics

Caveat

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

Mathematical Games – p. 40

Page 53: Basic rules - MIT Mathematics

Mathematical Games – p. 41

Page 54: Basic rules - MIT Mathematics

References

1. E. R. Berlekamp, The Dots and Boxes Game,A K Peters, Natick, Massachusetts, 2000.The classic children’s game Dots and Boxesis actually quite sophisticated and uses manydeep aspects of the theory of impartialgames.

2. E. R. Berlekamp, J. H. Conway, and R. K.Guy, Winning Ways, Academic Press, NewYork, 1982. The Bible of the theory ofmathematical games, with many generalprinciples and interesting examples.

Mathematical Games – p. 42

Page 55: Basic rules - MIT Mathematics

3. E. R. Berlekamp and D. Wolfe, MathematicalGo, 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 ofmathematical games.

Mathematical Games – p. 43

Page 56: Basic rules - MIT Mathematics

5. D. E. Knuth, Surreal Numbers,Addison-Wesley, Reading, MA, 1974. Anexposition of the numerical aspects ofConway’s theory of mathematical games andthe resulting theory of infinitesimal and infinitenumbers, in the form of a two-persondialogue.

Mathematical Games – p. 44

Page 57: Basic rules - MIT Mathematics

6. R. J. Nowakowski, ed., Games of No Chance,MSRI Publications 29, Cambridge UniversityPress, New York/Cambridge, 1996. Manyarticles on mathematical games, includingsome applications to “real” games such aschess and Go. There are two sequels.

Mathematical Games – p. 45

Page 58: Basic rules - MIT Mathematics

How can I get these slides?

Slides available at:

www-math.mit.edu/ ∼rstan/transparencies/games.pdf

Mathematical Games – p. 46