Browse · MathNet
PrintBaltic Way 2019
Baltic Way 2019 counting and probability
Problem
On a board the numbers are written. In a game two players and take turns alternately and starts. In each turn they have to erase two numbers and on the board. If a player can not take a turn, the player loses. Determine who has a winning strategy.
Solution
First we notice that for each odd number , , the numbers , where is the largest integer such that , form a string of length such that it is only possible to erase each number in the string if you also erase one of its neighbours. We now divide the numbers on the board into strings and count the lengths of these strings. It is not difficult to see that the numbers of strings of different lengths are
It is easy to see that a configuration with an even number of strings of each length is a losing position: Player pairs a string with one of the same length, and whenever makes a turn on one string, copy that turn using the paired string. This type of configuration we call a symmetric configuration.
Now if we have a winning configuration and add a symmetric configuration it is still a winning configuration: If is going to play starting from a winning configuration and we add a symmetric configuration , then starts by following her winning strategy on . Every time replies by changing a string in , continues using her winning strategy on , and every time replies by using a string in , continues by a symmetric move on . It is easy to see that this is a winning strategy.
Now we prove that the above configuration is a winning one, and hence that has a winning strategy. You can not make a turn on a string of length . Hence we just have to prove that the configuration with three strings of length , and is a winning strategy. First erase the two middle numbers in the string of length , and hence reduces it to two strings of lengths and , leaving a configuration with two strings of length and plus a symmetric configuration. Now player can either play on the string of length , leaving a string of length , or can play on the string on length leaving either: one string of length , one string of length , two strings of length and , two strings of length . This shows how replies:
Notice that can destroy a string of length or in one turn. The situation is essentially symmetric since you can only make one move on each string. Hence leaves a symmetric configuration to in all the cases, and hence has a winning strategy.
| length | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| number of strings | 125 | 62 | 32 | 15 | 8 | 4 | 2 | 1 | 1 |
Now if we have a winning configuration and add a symmetric configuration it is still a winning configuration: If is going to play starting from a winning configuration and we add a symmetric configuration , then starts by following her winning strategy on . Every time replies by changing a string in , continues using her winning strategy on , and every time replies by using a string in , continues by a symmetric move on . It is easy to see that this is a winning strategy.
Now we prove that the above configuration is a winning one, and hence that has a winning strategy. You can not make a turn on a string of length . Hence we just have to prove that the configuration with three strings of length , and is a winning strategy. First erase the two middle numbers in the string of length , and hence reduces it to two strings of lengths and , leaving a configuration with two strings of length and plus a symmetric configuration. Now player can either play on the string of length , leaving a string of length , or can play on the string on length leaving either: one string of length , one string of length , two strings of length and , two strings of length . This shows how replies:
| leaves | |||||
|---|---|---|---|---|---|
| leaves |
Final answer
A
Techniques
Games / greedy algorithmsInvariants / monovariants