Vous êtes sur la page 1sur 6

Stat155

Game Theory Lecture 2: Combinatorial Games

Peter Bartlett

August 30, 2016

Outline for today

Combinatorial games:

Positions, moves, terminal positions, impartial/partisan, progressively bounded, directed graphs. Progressively bounded impartial games.

The sets N and P. Theorem: Someone can win.

Examples

Subtraction

Chomp

 1 / 23 Example: Subtraction Game 15 chips Two players: I and II. Players alternate moves; Player I starts. At each move, the player can remove 1 or 2 chips. A player wins when they take the last chip (so that the other player cannot move). 3 / 23

2 / 23

Example: Subtraction Game

Does Player I have an advantage from having the ﬁrst move?

If both players play optimally, who will win?

What is an optimal strategy?

4 / 23

Example: Subtraction Game

Let x be the number of chips remaining. Suppose you move next. Can you guarantee a win?

Example: Subtraction Game

Write N as the set of positions where the Next player to move can guarantee a win, provided that they play optimally. Write P as the set of positions where the other player—the player that moved Previously—can guarantee a win, provided that they play optimally.

 For x = 0? 0 ∈ P. For x ∈ {1, 2}? 1, 2 ∈ N. For x = 3? 3 ∈ P. For x = 4? 4, 5 ∈ N. For x = 5? 6 ∈ P. For x = 6? 7, 8 ∈ N. For x ∈ {7, 8}? 15 ∈ P. For x = 15? Player II can always win.

What is Player II’s optimal strategy?

5 / 23

6 / 23

Deﬁnitions: Combinatorial games

Deﬁnitions: Combinatorial games

A combinatorial game has:

Two players, Player I and Player II.

A set of positions X .

For each player, a set of legal moves between positions, that is, a set

of ordered pairs, (current position, next position):

M I , M II X × X.

Players alternately choose moves; Player I goes ﬁrst from some starting position x 0 X.

Play continues until some player cannot move.

Normal play: the player that cannot move loses the game.

Mis`ere play: the player that cannot move wins the game.

Terminology:

An impartial game has the same set of legal moves for both players:

M

A

A

x

I = M II .

partisan game has diﬀerent sets of legal moves for the players.

terminal position for a player has no legal move to another position.

is terminal for player I

if there is no y X

with (x , y ) M I .

7 / 23

8 / 23

Deﬁnitions: Combinatorial games

A combinatorial game is progressively bounded if, for every starting

position x 0 X , there is ﬁnite bound on the number of moves before the game ends. (That is, if B(x ) denotes the maximum number of moves before the game ends, then B(x ) < .)

A strategy for a player is a function that assigns a legal move to each

non-terminal position.

If X NT is the set of non-terminal positions for Player I, then

S I : X NT for all x

A winning strategy for a player from position x :

guaranteed to result in a win for that player from that position.

X is a strategy for player I if, X NT , (x, S I (x )) M I .

Example: Subtraction Game

The subtraction game is an impartial combinatorial game:

Positions X = {0, 1, 2,

Moves

Terminal position: 0.

“Normal play”: the player who moves to 0 wins. i.e., the player in the terminal position loses.

Progressively bounded (from x X , there can be no more than x moves until the terminal position).

A winning strategy for any starting position x N:

, 15}.

= {(x , y ) X × X : y ∈ {x 1, x 2}}.

S(x) = 3 x/3 .

 9 / 23 10 / 23 Impartial combinatorial games as directed graphs Example: Subtraction Game Positions = nodes. What is the graph for the subtraction game? Moves = edges. Every edge from a node in P leads into N. Terminal positions = nodes without outgoing edges. There is an edge from a node in N to a node in P. “Normal play”: the player who moves to a terminal position wins. The winning strategy chooses one of these edges. 11 / 23 12 / 23

Impartial combinatorial games as directed graphs

What directed graphs correspond to progressively bounded games?

Acyclic graphs

where all paths from a node have bounded length.

What is B(x )?

Impartial combinatorial games and winning strategies

Theorem

In a progressively bounded impartial combinatorial game under normal play, X = N P. That is, from any initial position, one of the players has a winning strategy.

13 / 23

Impartial combinatorial games and winning strategies:

Proof

 14 / 23 Impartial combinatorial games and winning strategies: Proof Why did we need the progressively bounded condition? 16 / 23

Inductive hypothesis: All x with B (x ) n are in either N or P.

Base case: B(x ) = 0 only for terminal positions. But then x P. Inductive step: If B(x ) = n + 1, then every legal move leads to y with B(y ) n, so y N P. Then either

1 All of these y are in N, which implies x P, or

2 Some legal move leads to a y in P, which implies x N.

(Recall: B(x ) denotes the maximum number of moves before the game ends.)

Thus, every x is in N P.

From any initial position, one of the players has a winning strategy.

15 / 23

Key Ideas: Progressively bounded impartial games

Theorem: Every position is in N (positions where the next player has a winning strategy) or P (positions where the previous player has a winning strategy).

P: Contains terminal positions; every move leads to N.

N: Some move leads to P.

Example: Chomp

Chomp is an impartial combinatorial game:

Positions X = {non-empty subsets of chocolate block :

left-closed and below-closed}.

Moves

Terminal position: bottom left square (broccoli).

= {(x , y ) X × X : y = x chomp}.

“Normal play”: the player left with the broccoli loses.

 17 / 23 18 / 23 Example: Chomp Example: Chomp Chomp is progressively bounded (from x ∈ X , there can be no more than |x | − 1 moves until the terminal position). Theorem Hence, there is a winning strategy for one of the players. Every non-terminal rectangle is in N. Which player? 19 / 23 20 / 23

Example: Chomp

Why?

Because from a rectangle r X , there is a legal move (r , r ) M that we can always choose to skip, that is, for any move (r , s) M, we also have (r , s ) M .

(What is this r ?)

Why does this imply r N? There are two cases:

1 r P (which implies r N), and

2 r N. In this case, there is an s P with (r , s ) M . But then we know that (r , s) M, also implying r N.

21 / 23

Key Ideas: Progressively bounded impartial games

Theorem: Every position is in N (positions where the next player has a winning strategy) or P (positions where the previous player has a winning strategy).

P: Contains terminal positions; every move leads to N.

N: Some move leads to P.

23 / 23

Example: Chomp

This proof technique is called strategy stealing. (We’ll encounter it again.)

We showed that, from a non-terminal rectangle, there is a winning strategy for Player I.

But we didn’t construct a winning strategy.

In particular, we didn’t prove that r is a good or bad move. Examples:

1 For a 3 × 2 rectangle, r is a winning move. (Check!)

2 For a large-enough square (n × n rectangle with n > 2), r is not a winning move. (What is a winning move?)

22 / 23