Stat 155 HW 1 Solution
Fall 2016
1
Subtraction game
Consider a subtraction game in which a player can remove from 0 to 4 chips, but removing 0 chips is only
allowed if the previous player removed at least 1 chip. We can model this game as the following chip-and-cup
game:
There is a pile of n ≥ 0 chips and a cup that can hold either 0 or 1 chip. A legal move is to either remove
from 1 to 4 chips from the pile, placing one of them in the cup if it is empty, or to remove a chip from the cup.
(a) Show that the game is progressively bounded.[1pt]
Observe that two consecutive legal moves decrease the total number of chips by at least 1. Therefore,
if the initial position of the chip-and-cup game has n chips, then the game will terminate in at most
2n moves.
(b) Find the sets N and P.[3pt]
Claim: Write (a, b) for a position where the pile has a chips and the cup has b chips. N = {(n, 1) :
n ∈ N0 } and P = {(n, 0) : n ∈ N0 }.
Proof:
(i) It is trivial that the terminal position (0, 0) ∈ P .[1pt]
(ii) for any m ∈ N, each legal move from (m, 0) leads to placing a chip in the cup since it is empty. In
other words, each legal move from {(n, 0) : n ∈ N0 } leads to a position in {(n, 1) : n ∈ N0 }.[1pt]
(iii) for any m ∈ N, there is a legal move from (m, 1) to (m, 0). By removing a chip in the cup, the
next player can move from (m, 1) to (m, 0). In other words, there is a legal move from (m, 1) to
a position in {(n, 0) : n ∈ N0 }.[1pt]
(c) Describe the winning strategy.[1pt]
The second player always has a winning strategy. The winning strategy is always removing a chip in
the cup.
2
Pocket Nim
Consider a game of Nim in which the players have some number of chips in their pockets. A legal move
is either one of the usual legal moves of Nim, or involves moving some positive number of chips from the
player’s pocket on to one of the piles. (Notice that no chip is ever returned to a pocket.)
(a) Show that the game is progressively bounded.[1pt]
Assume that initially the first player has m chips in the pocket, the second player has n chips in the
pocket, and there are k chips on the Nim pile. The first player can move some positive number of chips
from his/her pocket onto one of the piles at most m times and likewise the second player can move
some positive number of chips from his/her pocket onto one of the piles at most n times. Players can
1
remove some positive number of chips from the Nim piles at most m + n + k times. Therefore, the
game will terminate in at most k + 2(m + n) moves.
(b) Find the sets N and P.[3pt]
Claim: We denote a position in the game by (n1 , n2 , . . . , nk , m1 , m2 ), meaning that there are k
Nim piles of chips, that the first has n1 chips in it, the second has n2 , and so on, and that the
first player has m1 chips in his pocket
L and
L theLsecond player has m2 chips in his pocket. N =
k+2
{(n1 , n2 , . L
. . , nk ,L
m1 , mL
: n1 n2 · · · nk > 0, k ∈ N} and P = {(n1 , n2 , . . . , nk , m1 , m2 ) ∈
2 ) ∈ N0
Nk+2
: n1 n2 · · · nk = 0, k ∈ N}.
0
Proof:
(i) It is trivial that the terminal position (0, 0, . . . , 0) ∈ P .[1pt]
L L
L
(ii) For (n1 , n2 , . . . , nk , m1 , m2 ) with Nim-sum n1 n2 · · · nk = 0, suppose that a player reduces
some positive number of chips from pile l or add some positive number of chips from a pocket
onto pile l, leaving n0l 6= nl . This must result in some bit in the binary representation of nl , say
the jth, changing either from 1 to 0 or from 0 to 1. The number of 1’s in the jth column was
even, so afterLthe L
move L
it becomes odd. This leads to a position (n01 , n02 , . . . , n0k , m01 , m02 ) with
0
0
Nim-sum n1 n2 · · · n0k 6= 0.[1pt]
L L
L
(iii) For (n1 , n2 , . . . , nk , m1 , m2 ) with n1 n2 · · · nk > 0, then thereL
is a legal
L move
L from
(n1 , n2 , . . . , nk , m1 , m2 ) to a position (n01 , n02 , . . . , n0k , m1 , m2 ) with n01 n02 · · · n0k = 0, using
the winning strategy of the original game of Nim. (as described in the proof of (b) on p19)[1pt]
(c) Describe the winning strategy.[1pt]
If the starting position is in N , then the first player has a winning strategy, otherwise, the second
player does. The winning strategy is removing a suitable number of chips from one of the nim piles,
as described in the proof of (b) on p19.
Note: The proof shows that the sets N and P don’t depend on m1 and m2 , and don’t depend on whether
we are talking about Player I or Player II’s perspective. It is worth noting that this partisan game has an
analysis that’s just the same as the N and P analysis that we did for impartial games.
3
Partisan games
Karlin and Peres, Exercise 1.2.3, p22: Prove Theorem 1.2.2: In any progressively bounded combinatorial
game with no ties allowed, one of the players has a winning strategy which depends only upon the current
state of the game.
Recall that B(x, i) denote the maximum number of moves to complete the game from state (x, i). We
prove by induction on n, that all positions x with max{B(x, 1), B(x, 2)} ≤ n are in either N1 or P1 and in
either N2 or P2 . Certainly, for all x such that max{B(x, 1), B(x, 2)} = 0, we have that x ∈ P1 and x ∈ P2 .
Now consider any position z for which max{B(z, 1), B(z, 2)} = n + 1. Then every move from z leads to a
position w with max{B(w, 1), B(w, 2)} ≤ n. There are two cases:
Case 1: Each move from z leads to a position in N1 . Then z ∈ P2 .
Case 2: There is a move from z to a position w ∈
/ N1 . Since max{B(w, 1), B(w, 2)} ≤ n, the inductive
hypothesis implies that w ∈ P1 . Thus, z ∈ N2 .
Likewise,
Case 1: Each move from z leads to a position in N2 . Then z ∈ P1 .
Case 2: There is a move from z to a position w ∈
/ N2 . Since max{B(w, 1), B(w, 2)} ≤ n, the inductive
hypothesis implies that w ∈ P2 . Thus, z ∈ N1 .
2
Hence, all positions lie in N1
S
P1 as well as in N2
S
P2 .
• If the starting position is in N1 and player 1 makes the first move, then the player 1 has a winning
strategy.
• If the starting position is in P1 and player 1 makes the first move, then the player 2 has a winning
strategy.
• If the starting position is in N2 and player 2 makes the first move, then the player 2 has a winning
strategy.
• If the starting position is in P2 and player 2 makes the first move, then the player 1 has a winning
strategy.
3
© Copyright 2026 Paperzz