Skip to main content
OlympiadHQ

Browse · MathNet

Print

Rioplatense Mathematical Olympiad

Argentina counting and probability

Problem

Mati is playing with some magic boxes and a machine. Each box has a value inside. When opening a box Mati sees its value, adds the value of the box to his score and it is destroyed (if the box's value is negative, Mati loses points). By placing a magic box with value in the machine, this box is destroyed and we obtain two magic boxes with values and (it is not known which is which, but the new boxes can be distinguished from the others). At the beginning of the game, Mati has 0 points and one magic box whose value he knows to be 0.

a. Show that Mati can ensure reaching 1000 points or more.

b. Can Mati ensure reaching 1000000 points or more, without having less than -42 points at any time?
Solution
We say we multiply a box when we place it in the machine. We say we multiply a box 2 times if we multiply the box and then multiply each of the resulting boxes. Similarly, we say we multiply a box times if we do so times and then multiply each of the resulting boxes, obtaining a total of boxes.

a. We start by multiplying the box 5 times. Initially, we have a box with a value of 0. Then one with a value of 1 and one with a value of . Let's summarize this by counting how many we have for each value, that is, and . When we multiply once more, we get , and . Next , and . And then , and . By making the last multiplication, we keep each box along with the one that came out of the machine, we count how many pairs of each type we have, and we get , and .

We now open one box from each pair. By doing this, we will get at least points in the worst-case scenario. Since there is a pair that contains 5 and 3, we are sure that among the boxes we open, we will see a 5 or a 3. If we see a 5, we know that the value of the other box in its pair is 3. If we see a 3, we know that the value of the other box is 5 or 1. In any case, we have identified a box which has not been opened yet and whose value we know for sure is at least 1.

We multiply this box 10 times. The average value of the resulting 1024 boxes is the same as the original, so if we open all of them, we will sum at least 1024 points. As we previously subtracted at most 16 points, we end up with more than 1000 points.

b. We start as in part (a). Notice that when opening the first 16 boxes, we can end up with points, but we can pass through . Then we repeat this step by multiplying 5 times the box that we know has a value of at least 1. By opening the 16 boxes, we will get to a score of at least 0 points (1 more than before for each box). And we can pass through , which adds up to exceeding (since we could have started from ). We keep the box paired with the largest one we opened; this one has a value of at least 2. By repeating the multiplication 5 times with this box and opening one from each pair, we will obtain at least 16 points and will pass through in the worst case, which adds up to (considering the previous ). By doing it once more starting from the box with a value of at least 3, we will obtain at least 32 points and will pass through, in the worst case, , but initially, we had at least 16 points. We will no longer pass through numbers less than (starting from the fact that we are sure the initial box is at least 5, all boxes have non-negative values). In each step, we add at least 16 points (actually, more), so we will exceed 1000000 points in finite steps.
Final answer
Part (a): Yes. Part (b): Yes.

Techniques

Invariants / monovariantsGames / greedy algorithms