Browse · MathNet
PrintIMO Team Selection Test 1
Netherlands counting and probability
Problem
Player Zero and player One play a game on an -board (). The columns of this -board are numbered by powers of two, so we have column 1, column 2, column 4 through column . Alternately, players put their own number (i.e. Zero a 0 and One a 1) in one of the empty squares. Player Zero starts. When the board is full, the game ends and a (reverse binary) number is created in each row by adding the values of the boxes with a 1 in them. So if , then a row with 0101 contains the number .
a) For which natural numbers can player One always ensure that at least one of the rows is divisible by 4?
b) And for which natural numbers can player One always ensure that at least one of the rows is divisible by 3?
a) For which natural numbers can player One always ensure that at least one of the rows is divisible by 4?
b) And for which natural numbers can player One always ensure that at least one of the rows is divisible by 3?
Solution
a) Note first that if , the unique box gets 0 because player Zero starts, so in this case it is possible. We will now prove that for all other Zero can prevent One from winning. Since for all , only the first two columns determine who wins. If there is a row with two zeros at the beginning, then player One wins and otherwise player Zero wins. We are going to prove that for all Zero can prevent One from winning. We say "Zero blocks One" when Zero puts his 0 next to a 1 in the first two boxes of a row. We call the first two columns the left area; the whole board except for the first two columns precisely the right area. If is odd, Zero first puts a 0 in the right area. There are then an even number of squares left in both the right area and the left area. Zero now plays so that this property is preserved after every move of his, and in addition, the neighbouring square of every empty square in the left region is also empty. (So in each row, the first two squares are both empty or both occupied.) So every time One puts a 1 in one of the areas, there is at least 1 more empty square in that area and Zero plays a 0 in that same area. For the left area, Zero does this by blocking the 1 One just played each time. If is even, Zero puts a 0 in the left area first. There are now an odd number of squares on the left and an even number of squares on the right. If One plays a 1 on the right, Zero also plays a 0 on the right. If One plays a 1 on the left in a new row, Zero immediately blocks it. If One on the left plays a 1 in the row where there was already a 0, Zero starts a new row on the left if it can by playing a 0 in the left area so that the square next to it (in the left area) is still empty. If there is no new row, all rows on the left are filled with 01 or 10 and Zero plays on the right.
b) Zero can only ensure that no row is divisible by 3 if . Note first that modulo 3 the columns are numbered as 1, 2, 1, 2, .... If is even, there are an even number of squares and One has the last turn; however, if is odd, there are an odd number of squares and Zero has the last turn. If , both the 1 and the 2 occur an even number of times per row. Now One has the following tactic: mirror player Zero. If Zero puts a zero in a row with value 1, then One puts a 1 in a square in the same row that also has value 1. If Zero puts a zero in a row with value 2, then One puts a 1 in a square with value 2 in that same row. Since there are an even number of 1s and 2s in each row, One can always keep doing this. Now, at the end, boxes with value 1 have the number 1 and boxes with value 2 that got the number 1 from One. So the sum of each row is . If , there are squares of value 1 and squares of value 2. One wants to make a row so that exactly squares of value 1 contain a 1 and exactly squares of value 2. However, if One can't mirror, One puts a 1 in any square of value 1. Only when this is also no longer possible does he put a 1 in a square of value 2. Since there are exactly squares per row of value 2, One can use this tactic to ensure that in each row exactly squares of value 2 get the number 1. In addition, this tactic ensures that there is at least one row with zeros on squares of value 1 (and thus with the number 1). For this row, the sum is equal to . If , there are squares of value 1 and squares of value 2. One starts by putting a 1 in any square of value 2 in one of the rows where Zero has not placed his first square. Then One applies the copy technique to this particular row. So if Zero places outside it, One does the same and if Zero places inside it, One does the same and puts its 1 on a square of the same value. Since there are now an odd number of empty squares outside this row, One may have to put a square in the special row when Zero did not do so the turn before. Before this move, there are squares left with value 2 and with value 1. By applying the copy tactic again after this move (and the fact that Zero has the last move), One can make sure that both One and Zero choose squares with value 2 and squares with value 1. Now the special row has exactly squares with value 1 and with value 2, making the sum and One wins. If , there are squares with value 1 and squares with value 2. Then Zero can prevent One from winning. This time, it is precisely Zero who applies the copying tactic from his second turn. However, if there are no more squares with the same value in the same row, Zero chooses the square in the same row with the other value. Because in this case One has the last turn, this tactic allows Zero to ensure that both occupy exactly squares in each row and that Zero occupies at least squares with value 1 and squares with value 2 in the row. This means that the sum in each row is either or . So in this case, Zero can always prevent One from winning.
b) Zero can only ensure that no row is divisible by 3 if . Note first that modulo 3 the columns are numbered as 1, 2, 1, 2, .... If is even, there are an even number of squares and One has the last turn; however, if is odd, there are an odd number of squares and Zero has the last turn. If , both the 1 and the 2 occur an even number of times per row. Now One has the following tactic: mirror player Zero. If Zero puts a zero in a row with value 1, then One puts a 1 in a square in the same row that also has value 1. If Zero puts a zero in a row with value 2, then One puts a 1 in a square with value 2 in that same row. Since there are an even number of 1s and 2s in each row, One can always keep doing this. Now, at the end, boxes with value 1 have the number 1 and boxes with value 2 that got the number 1 from One. So the sum of each row is . If , there are squares of value 1 and squares of value 2. One wants to make a row so that exactly squares of value 1 contain a 1 and exactly squares of value 2. However, if One can't mirror, One puts a 1 in any square of value 1. Only when this is also no longer possible does he put a 1 in a square of value 2. Since there are exactly squares per row of value 2, One can use this tactic to ensure that in each row exactly squares of value 2 get the number 1. In addition, this tactic ensures that there is at least one row with zeros on squares of value 1 (and thus with the number 1). For this row, the sum is equal to . If , there are squares of value 1 and squares of value 2. One starts by putting a 1 in any square of value 2 in one of the rows where Zero has not placed his first square. Then One applies the copy technique to this particular row. So if Zero places outside it, One does the same and if Zero places inside it, One does the same and puts its 1 on a square of the same value. Since there are now an odd number of empty squares outside this row, One may have to put a square in the special row when Zero did not do so the turn before. Before this move, there are squares left with value 2 and with value 1. By applying the copy tactic again after this move (and the fact that Zero has the last move), One can make sure that both One and Zero choose squares with value 2 and squares with value 1. Now the special row has exactly squares with value 1 and with value 2, making the sum and One wins. If , there are squares with value 1 and squares with value 2. Then Zero can prevent One from winning. This time, it is precisely Zero who applies the copying tactic from his second turn. However, if there are no more squares with the same value in the same row, Zero chooses the square in the same row with the other value. Because in this case One has the last turn, this tactic allows Zero to ensure that both occupy exactly squares in each row and that Zero occupies at least squares with value 1 and squares with value 2 in the row. This means that the sum in each row is either or . So in this case, Zero can always prevent One from winning.
Final answer
a) n = 1. b) All n not congruent to 2 modulo 4; equivalently, n ≡ 0, 1, or 3 (mod 4).
Techniques
Games / greedy algorithmsInvariants / monovariantsOther