Stat 155 Game theory, Yuva Peres Fa 2004 Lectures 4,5,6 In the ast ecture, we defined N and P positions for a combinatoria game. We wi now show more formay that each starting position in a combinatoria game ies in either N or P. Reca that the end position 0 of any game ies in P if the game is conducted under norma pay. Any position for which there is a move to a P -position ies in N. Any position where a moves ead to N positions ies in P. Writing this more formay, we define P 0 = {0} N i+1 = { positions x for which there is a move eading to P i } P i = { positions y such that each move eads to N i }, (1) for each i N. We set N = i 0 N i, P = i 0 P i. Consider a game where, for each starting position x, the game must end within B(x) < moves, no matter which moves the two payers mae. We chec by induction on B(x) that a positions ies in N P. If B(x) = 0, this is true, because P 0 P. Assume the inductive hypothesis for those positions x for which B(x) n, and consider any position z satisfying B(z) = n + 1. There are two cases to hande: the first is that each move from z eads to a position in N (that is, to a member of one of the previousy constructed sets N i ). Then z ies in one of the sets P i and thus in P. In the second case, there is a move from z to some P -position. This impies that z N. Thus, a initia positions ie in either N or P. The metereoogist question: reca this probem, from Lecture 2. By checing the derivative of g p (x), we see that f(x) = og x or f(x) = (1 x) 2 are such that g p (p) > g p (x) for x [0, 1] {p}. Last time, we stated a theorem on how to pay optimay the game of nim. We now present the proof. Proof of Bouton s Theorem We write n m to be the nim-sum of n, m N. This operation is the one described in the statement of the theorem. We write n and m in binary, and compute the vaue of the sum of the digits in each coumn moduo 2. The resut is the binary expression for the nim-sum 1
Lectures 4,5,6 2 n m. Another way of saying this is that the nim-sum of a coection of vaues (m 1, m 2,..., m ) is the sum of a the powers of two that occurred an odd number of times when we wrote each of the numbers m i as a sum of powers of two. Here is an exampe: m 1 = 13, m 2 = 9, m 3 = 3. In powers of two:
Lectures 4,5,6 3 m 1 = 2 3 + 2 2 + 2 0 m 2 = 2 3 + 2 0 m 3 = +2 1 + 2 0. In this case, the powers of two that appear an odd number of times are 2 0 = 1 and 2 1 = 2. this means that the nim-sum m 1 m 2 m 3 = 1 + 2 = 3. For the case where (m 1, m 2, m 3 ) = (5, 6, 15), we write, in purey binary notation, 5 0 1 0 1 6 0 1 1 0 15 1 1 1 1 1 1 0 0 maing the nim-sum 12 in this case. We define ˆP to be those positions with nim-sum zero, and ˆN to be a other positions. We caim that ˆP = P, and ˆN = N. To chec this caim, we need to show two things. Firsty, that 0 ˆP, and that, for a x ˆN, there exists a move from x eading to ˆP. Secondy, that for every y ˆP, a moves from y ead to ˆN. Note firsty that 0 ˆP is cear. Secondy, suppose that x = (m 1, m 2,..., m ) ˆN. Set s = m 1... m. Writing each m i in binary, note that there are an odd number of vaues of i {1,..., } for which the binary expression for m i has a 1 in the position of the eft-most one in the expression for s. Choose one such i. Note that m i s < m i, because m i s has no 1 in this eft-most position, and so is ess than any number whose binary expression does have a 1 there. So we can pay the move that removes from the i-th pie m i m i s chips, so that m i becomes m i s. The nim-sum of the resuting position (m 1,..., m i 1, m i s, m i+1,..., m ) is zero, so this new position ies in ˆP. We have checed the first of the two conditions which we require. To verify the second condition, we have to show that if y = (y 1,..., y ) ˆP, then any move from y eads to a position z ˆN. We write the y i in binary: y 1 = y (n) 1 y(n 1) 1... y (0) 1 = y = y (n) y(n 1)... y (0) = m j=0 m j=0 y (j) 1 2j y (j) 2j.
Lectures 4,5,6 4 A particuar exampe: 4 = 0100 = 2 2 6 = 0110 = 2 2 + 2 1 15 = 1111 = 2 3 + 2 2 + 2 1 + 2 0 13 = 1101 = 2 3 + 2 2 + 2 0. By assumption, y ˆP. This means that the nim-sum y (j) 1... y (j) = 0 for each j. In other means, that =1 y(j) is even for each j. Suppose that we remove chips from pie. We get a new position z = (z 1,..., z ) with z i = y i for i {1,..., }, i, and with z < y. (The case where z = 0 is permitted.) Consider the binary expressions for y and z : y = y (n) y (n 1)... y (0) z 1 = z (n) z (n 1)... z (0). We scan these two rows of zeros and ones unti we ocate the first instance of a disagreement between them. In the coumn where it occurs, the nim-sum of y and z is one. This means that the nim-sum of z = (z 1,..., z ) is aso equa to one in this coumn. Thus, z ˆN. We have checed the second condition that we needed, and so, the proof of the theorem is compete. Exampe: the game of rims. In this game, a starting position consists of a finite number of dots in the pane, and a finite number of continuous oops. Each oop must not intersect itsef, nor any of the other oops. Each oop must pass through at east one of the dots. It may pass through any number of them. A ega move for either of the two payers consists of drawing a new oop, so that the new picture woud be a ega starting position. The payers aim is to draw the ast ega oop. We can see that the game is identica to a variant of nim. For any given position, thin of the dots that have no oop going through them as being divided into different casses. Each cass consists of the set of dots that can be reached by a continuous path from a particuar dot, without crossing any oop. We may thin of each cass of dots as being a pie of chips, ie in nim. What then are the ega moves, expressed in these terms? Drawing a ega oop means removing at east one chip from a given pie, and then spitting the remaining chips in the pie into two separate pies. We can in fact spit in any way we ie, or eave the remaining chips in a singe pie. This means that the game of rims has some extra ega moves to those of him. However, it turns out that these extra mae no difference, and so that the sets N or P coincide for the two games. We now prove this. Thining of a position in rims as a finite number of pies, we write P nim and N nim for the P and N positions for the game of nim (so that these sets were found in Bouton s Theorem). We want to show that P = P nim, and that N = N nim (2)
Lectures 4,5,6 5 where here, P and N refer to the game of rims. What must we chec? Firsty, that 0 P, which is immediate. Secondy, that from any position in N nim, we may move to P nim by a move in rims. This is fine, because each nim move is ega in rims. Thirdy, that for any y P nim, any rims move taes us to a position in N nim. If the move does not invove breaing a pie, then it is a nim move, so this case is fine. We need then to consider a move where y is broen into two parts u and v whose sum satisfies u + v < y. Note that the nim-sum u v of u and v is at most than the ordinary sum u + v: this is because the nim-sum consists of the sum of the odd powers that appear in the expression for u + v as a sum of powers of two, that is, it invoves omitting from this expression certain powers of two. Thus, u v u + v < y. So the rims move in question amounted to repacing the pie of size y by one with a smaer number of chips, u v. Thus, the rims move has the same effect as a ega move in nim, so that, when it is appied to y P nim, it produces a position in N nim. This is what we had to chec, so we have finished proving (2).