stony brooktucker/ams303-chapt10.docx · web viewthe play of game ends after a finite number of...

15
Ch10 Progressively finite games (directed graphs): i) a finite number of choices at each move; and ii) the play of game ends after a finite number of moves (unlike, say, chess) Winner of the game is the player who makes the last move (to a winning position)—ending the game. Example 1: Can take away 1,2,3,or 4 from a pile of 16 sticks. (edges directed left to right in graph of game) | | | | | | | | | | | | | | | |

Upload: others

Post on 16-Feb-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Ch10

Progressively finite games (directed graphs):

i) a finite number of choices at each move; and

ii) the play of game ends after a finite number of moves (unlike, say, chess)

Winner of the game is the player who makes the last move (to a winning position)—ending the game.

Example 1: Can take away 1,2,3,or 4 from a pile of 16 sticks. (edges directed left to right in graph of game)

| | | | | | | | | | | | | | | |

(play it)

| | | | | | | | | | | | | | | |

| | | | | | | | | | | | | | | |

| | | | | | | | | | | | | | | |

Example 2: Add 1 or 2 or 5 sticks until a square (4,9,16,25,36) or a value over 40 is reached.

s(x) = set of successors of vertex x.

Winning vertex/position x has no successors: s(x) =

Kernel K of a directed graph (game) has two properties

1. There is no edge joining any two vertices in K

Or- for

2. There is an edge from every vertex not in K to some vertex in K. Or- for

Example: Kernel in Example 1 consists of 0,5,10,15.

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 repeatedly to the kernel.

Key step- the winning vertices are in the kernel.

Level numbers l(x) defined as follows

l(x) = 0 s(x) = and L0 = { x | l(x) = 0 }

level k

l(x) = 1 xL0 and s(x) L0 level k-1

and L1 = L0 { x | l(x) = 1 }

l(x) = 2 xL1 and s(x) L1 level 2

and L2 = L1 { x | l(x) = 2 }

level 1

l(x)= k xLk-1 and s(x) Lk-1

and Lk = Lk-1 { x | l(x) = k } level 0

Theorem 2: Every progressively finite game has a unique winning strategy; that is, has a unique kernel.

Proof by induction on level number. Ki is kernel in Li.

K0 = L0. K1 = K0 {x | l(x)=1 & s(x)ÇK0 = Æ}

K2 = K1 {x | l(x)=2 & s(x)ÇK1 = Æ}

. . .

Kk =Kk-1 {x | l(x)=k & s(x)ÇKk-1 = Æ}

If you know the kernel at lower levels and you have no successor in the kernel, then your position must be in kernel

Grundy Function g(x) is defined to be the smallest non-negative integer different from the Grundy values of the successors of x.

g(x) = min {k ≥ 0: k ≠ g(y), for all y s(x)}

1 0 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0

g(x) =

Theorem 3: Every progressively finite game/graph has a unique Grundy function. The vertices x with g(x) = 0 form the kernel.

Proof: Build g(x) level-by-level.

g(x)=0 defines kernel. Check the conditions of a kernel:

1. There is no edge joining any two vertices in K.

Adjacent vertices must have different Grundy values.

2. There is an edge from every vertex not in K to some vertex in K

If g(x)≠0, then some successor of x must have g = 0.

In direct sum of graphs H1+ H2+ . . .+ Hm, vertex

(x1, x2, x3, . . . xm) has successor s( (x1, x2, x3, . . . xm)) =

We use a direct sum of graphs to play the game of Nim, where we take turns moving sticks from one of several piles.

| (error in Figure 10.4- book has 2 sticks, should be 1)

| |

| | |

| | | |

Here is an example of the direct sum of 2 copies of a simple graph. Direct sums are too messy to draw in general.

H

H + H

We now introduce the Digital Sum . For 2*12*15*8

2 = 0 0 1 0

12 = 1 1 0 0

15 = 1 1 1 1

8 = 1 0 0 0

1 0 0 1 = 9

Theorem

In a multi-pile Nim game, the Grundy value of any position is the digital sum of the Grundy values for each pile. To win, move to a position with digital sum = 0.

Proof: We verify the Theorem in the process of showing how to move according to this winning strategy.

Note that with unlimited take-away in each pile, the Grundy value of a pile is simply its size.

Play to win the following Nim game

| | 010 010| | 010 010

| | | 011 011

| | | | 100 -> 011 (remove 1 from row 4)

111 000

Move in a row with a 1 in the highest order position that has 1 in the digital sum. Here it is row 4. In that row, change the parity (1 to 0 or 0 to 1) of each position that has 1 in the digital sum (below the line).

Play to win the following Nim game

| | 010-->001 001 001 001 001| | | 011 011 011 011move010 010

| | | | 100 100 100-->001 001 001

| | | | | | 110 110move011 011 011-->010

011 000 101 000 001 000

Æ

x ∈K : s(x)

xÎK:s(x)

∩K =∅

ÇK=Æ

x ∉K : s(x)∩K ≠ ∅

xÏK:s(x)ÇK¹Æ