Let $n$ be a positive integer. We have $n$ boxes where each box contains a non-negative number of pebbles. In each move we are allowed to take two pebbles from a box we choose, throw away one of the pebbles and put the other pebble in another box we choose. An initial configuration of pebbles is called solvable if it is possible to reach a configuration with no empty box, in a finite (possibly zero) number of moves. Determine all initial configurations of pebbles which are not solvable, but become solvable when an additional pebble is added to a box, no matter which box is chosen.
Problem
Source: European Girls’ Mathematical Olympiad-2014 - DAY 2 - P5
Tags: floor function, combinatorics, EGMO, EGMO 2014, reachability, combinatorics solved
13.04.2014 20:21
Correct me if I'm wrong but this seems like a straight-forward problem. Let the box $i$ contain $a_i$ pebbles. I claim that the configuration is $solvable$ iff $S = \sum \left \lceil \dfrac{a_i}{2} \right \rceil \geq n$. Proof: Notice that after applying a move on the boxes $i,j$ we will have that $ a_i` = a_i-2$ and $a_j` = a_j+1$ and $a_k` = a_k$ for $k \not \in \{i,j\}$. So $S` = \sum \left \lceil \dfrac{a_x`}{2} \right \rceil = \sum \left \lceil \dfrac{a_x}{2} \right \rceil -1 + \left \lceil \dfrac{a_i+1}{2} \right \rceil - \left \lceil \dfrac{a_i}{2} \right \rceil \le S$. Indeed if the configuration is $solvable$ then after a finite number of moves we will have that $a_x` \geq 1$ so $S` = \sum \left \lceil \dfrac{a_x`}{2} \right \rceil \geq n$ but from earlier we have that $S \geq S` \geq n$. Suppose that in a box we have $a > 0$ pebbles, then it is easy to see that we can apply a move at most $\left \lfloor \dfrac{a-1}{2} \right \rfloor$ times to it so that it remains non-empty, so by considering the case $a=0$ we have that applying moves to a box one can make at most $\left \lceil \dfrac{a}{2} \right \rceil$ boxes be non-empty (including itself). So by considering all boxes, after a finite number of moves one can make at most $S = \sum \left \lceil \dfrac{a_i}{2} \right \rceil$ boxes be non-empty. So if $S = \sum \left \lceil \dfrac{a_i}{2} \right \rceil \geq n$ then we can get $n$ boxes to be non-empty so the configuration is $solvable$. $\square$ In our case we need $S = \sum \left \lceil \dfrac{a_i}{2} \right \rceil = n-1$ (because when we add a pebble to a box, $S$ can increase at most by $1$). By adding a pebble to box $k$ we get $\sum \left \lceil \dfrac{a_i`}{2} \right \rceil = n$ (it must be $solvable$) where $a_{k}` = a_{k}+1$ and $a_i` = a_i$ for $i\not = k$. By subtracting these two equations we get that $ \left \lceil \dfrac{a_k+1}{2} \right \rceil - \left \lceil \dfrac{a_k}{2} \right \rceil = 1$, from here $a_k$ must be even. And as $k$ can be any number from $1$ to $n$ we get that $a_i$ is even for all $i$, also $\sum \left \lceil \dfrac{a_i}{2} \right \rceil = \dfrac {\sum a_i}{2} = n-1$ or $\sum a_i = 2n-2$, so any configuration with each box having an even number of pebbles and their sum $2n-2$ satisfies our condition.
20.04.2014 04:53
i think it is wrong let n=3 and a1=4 , a2=a3=0. it is not solvable... the answer is only configurations with a1=0 and a2=a3=...=an=2
20.04.2014 07:07
It only needs to be solvable after adding 1 more pebble (500-310-111 or 410-211)
20.04.2014 09:43
sorry, you are right. i made a mistake
20.04.2014 17:28
First let us see which configurations are solvable. Say we have $a_i$ boxes with $i$ pebbles. We need to see how many pebbles the boxes of $a_1$, $a_2$, ... can "lend" to the boxes of $a_0$. It is easy to see that a box in $a_k$ can lend $\lfloor \frac{k-1}{2} \rfloor$ pebbles. Therefore $\sum_{k=1}^{\infty} a_k \lfloor \frac{k-1}{2} \rfloor \ge a_0$. This is enough for any configuration to be solvable. Now let's solve the problem. If in such an initial configuration we had $a_m \ge 1$ for an odd $m$, then adding a pebble to that box would leave the above sum unchanged, so it would still be unsolvable. Therefore the boxes all have an even number of pebbles. It is easy to see that, remembering that $a_m=0$ for all odd $m$: $\sum_{k=0}^{\infty} a_{2k}(k-1) = -1$ It is easy to see that both conditions together are enough for the configuration to be solvable after adding a pebble to any box. And so $\sum_{k=0}^{\infty} a_{2k}(2k) = 2 \left( \sum_{k=0}^{\infty} a_k - 1 \right) = 2(n-1)$ since we had $n$ boxes. So any such configuration must have an even number of pebbles in each box and must have $2n-2$ pebbles in total. It is easy to see all these configurations work since they verify the initial sum.
23.12.2018 21:41
Call an unsolvable position maximal if adding a stone to any pile causes it to be solvable. Lemma: For every solvable position, there is a sequence of steps that never donates to a nonempty box. Proof: Consider an arbitrary sequence of steps that terminates with a nonempty number of pebbles in each box, and let $i\to j$ be the last donation to a nonempty box in this sequence. Let the number of pebbles in box $i$ be $a_i$ just before this move. As we can only donate to empty boxes after this point, we consider the donating powers of each box: After box $j$ receives a pebble, it can donate to $\left\lfloor\tfrac{a_j}{2}\right\rfloor$ boxes before becoming empty. But if we instead donate $i\to \text{empty}$ and donate with the $a_j$ pebbles in $j$ separately, we can fill $1+\left\lfloor\tfrac{a_j-1}{2}\right\rfloor \geq \left\lfloor\tfrac{a_j}{2}\right\rfloor$ boxes, which is strictly better. We repeat this procedure of replacing moves into nonempty boxes to get our desired sequence. Lemma: A maximal position cannot have an odd number of pebbles in any box. Proof: By the previous lemma, this box $i$ cannot gain any pebbles, so it can only donate $\left\lfloor\tfrac{a_i-1}{2}\right\rfloor$ pebbles. This number doesn't change if we add a stone to $i,$ so the resulting configuration is unsolvable and hence the initial configuration is not maximal. Thus each maximal configuration has an even number of stones in every pile, and we don't donate to nonempty boxes. This is equivalent to a game where we first halve the number of stones in each box and the allowed moves are transferring stones to empty boxes. It then follows that the maximal configurations have $n-1$ total stones in this new game, so in the initial game there must be $2n-2$ stones. We thus conclude that all maximal configurations are those with $2n-2$ stones in total where each box has an even number of stones.
08.04.2019 15:47
Firstly, note that adding a stone to a box in an already solvable configuration doesn't make it unsolvable. Now, we have two lemmas: Lemma 1: A configuration is solvable iff it can be solved in such a manner such that at no point is a move made which involves transferring a stone from a box with 2 stones to an empty box. Proof: If part is obvious. If a configuration is solvable and a sequence of moves solving it involves a move of the nature we've described, we can simply remove that move from the sequence, and note that this is equivalent to performing the move, switching the labels of the two boxes involved in the move, and adding a stone to the non-empty box (which had one stone in it after the move). Lemma 2: A configuration is solvable iff it can be solved in such a manner such that at no point is a move made which involves transferring a stone to a non-empty box. Proof: If part is obvious. If a configuration is solvable and a sequence of moves solving it involves a move of the type described above, say, a transfer from B1 to B2, then check if a transfer is made from B2 to another box in any subsequent move. If not, the transfer from B1 to B2 was useless, and can be removed. If yes, then suppose the first such move involved a transfer from B2 to B3. If B3 = B1, then both these moves can be removed. If B3 is not B1, then remove the transfer from B1 to B2 and replace the transfer from B2 to B3 by one from B1 to B3. Note that this has the same net result as performing the original sequence of moves, and adding a stone to B2 after the transfer from B2 to B3. Let a box $a_i$ have $s_i$ stones. Let the boxes $a_1, ...., a_k$ be empty, and $a_m$ for $m > k$ be non-empty. Then, from the above two lemmas, a configuration is solvable iff the sum of $\lfloor \frac{s_i-1}{2} \rfloor$ over all non-empty boxes is $\ge k$, or equivalently, the sum of $\lfloor \frac{s_i-1}{2} \rfloor$ over all boxes (which we denote by $S$ from now on) is $\ge 0$. Note that a configuration satisfies the problems conditions iff $S = -1$, and all $s_i$ are even. Thus, only configurations with all boxes having an even number of stones and the sum of the number of stones equal to $2n - 2$ satisfy the problem condition.
30.11.2019 11:37
The answer is any configuration with $2n - 2$ stones as long as each box has an even number of stones. Lemma 01. If a box has $2n$ stones, it can be distributed to a maximal of $n$ boxes. Proof. We'll prove this by induction. The base case is pretty much trivial: Either you move it to the other box and you'll have 1 stone left or do nothing. Now suppose the statement is true for $n = k$. The case $n = k + 1$ can be simply done by using the algorithm to remove 2 stones from that box to a particular box, and then by induction hypothesis, the other $2k$ stones can be distributed in a maximal of $k$ boxes. Lemma 02. If a box has $2n - 1$ stones, it can be distributed to a maximal of $n$ boxes. Proof. Same as Lemma 01., except that the fact that in the base case you'll have no choice to do other than do nothing. Now, we'll set up claims to describe the initial configuration of the box. Lemma 03. There are no box with an odd number of stones. Proof. Suppose there exists such box. By the initial assumption, this distribution doesn't admit any solvable configuration. But by adding 1 stone to this particular box with an odd number of stone, by Lemma 01 and Lemma 02, this doesn't change anything of the maximum number of box these stones can be distributed to, contradicting our assumption. Therefore, we can write down the number of stones in every box as $2a_i$, for $i = 1, 2, \dots, n$. We have \[ \sum_{i = 1}^n a_i < n \]Since every box has an even number of stones, adding a stone to any boxes, will add the maximum number of boxes possibly covered by 1, and therefore \[ \sum_{i = 1}^n a_i + 1 \ge n \]Combining the two claims given, we have \[ \sum_{i = 1}^n a_i = n - 1 \]and therefore, the initial number of stones must be \[ \sum_{i = 1}^n 2a_i = 2(n - 1) \]
22.02.2020 05:07
Call a configuration barely unsolvable if it is unsolvable but adding a pebble anywhere makes it solvable. We claim that a config is barely unsolvable iff there are an even number of pebbles in every pile, and there are $2n-2$ overall. Suppose the config has $k$ empty piles and $n-k$ nonempty piles. Let $f(a)$ be the number of empty piles a pile with $a$ pebbles can donate to while itself staying positive. Note that $f(a) = \lfloor \tfrac{a-1}{2} \rfloor$. We will prove that the total number of pebbles must be $2n-2$ first. Claim 1: The total number of pebbles cannot be greater than or equal to $2n-1$. Proof: Let the config be $(0,\ldots,0,a_1,\ldots,a_{n-k})$, there are $k$ zeroes. Suppose $a_1+\cdots+a_{n-k} \ge 2n-1$. We claim the config is now solvable, i.e. $f(a_1)+\cdots+f(a_{n-k}) \ge k$. Indeed, \begin{align*} f(a_1)+\cdots + f(a_{n-k}) &\ge \left(\frac{a_1}{2}-1\right) + \cdots + \left(\frac{a_{n-k}}{2} - 1 \right) \\ &\ge \frac{2n-1}{2} - (n-k) =\\ &= k - \frac12. \end{align*}If $a_1+\cdots+a_{n-k} \ge 2n$, we immediately get the desired bound. But if $a_1+\cdots+a_{n-k} = 2n-1$, then we know that at least one of $a_i$ on the LHS is odd, so its $f(a_i) = (a_i-1)/2$, improving the estimate of $f(a_i) = a_i/2 -1$ by $1/2$. This proves the bound. $\square$ Claim 2: The total number of pebbles cannot be less than or equal to $2n-3$. Proof: Similar to above. $\square$ Therefore, the number of pebbles is $2n-2$. Now, simply note that if any pile was odd, we could add a pebble to it, and the config would still be unsolvable (since $f(2a-1)=f(2a)$). Therefore, the total number of pebbles is $2n-2$ and each pile has an even number.
06.07.2020 02:36
WOW this was hard to explain... does this even work? The answer is all initial configurations satisfying the following two conditions: (1) There are a total of $2n-2$ pebbles. (2) Each box contains an even number of pebbles. Call all such configurations "gray." Additionally, call a move a "plus move" if it increases the number of boxes containing at least one pebble. $\textbf{Claim: }$ All gray configurations are unsolvable. $\textbf{Proof: }$ If a two pebbles are in the same box, then regardless of whether or not we perform a move on these pebbles, at most one one empty box is filled by some number of them. Therefore, after any sequence of moves, at most $\frac{2n-2}{2}=n-1$ boxes can contain pebbles, so all gray configurations are unsolvable. $\blacksquare$ $\textbf{Claim: }$ Adding a pebble to any box in a gray configuration results in a solvable configuration. $\textbf{Proof: }$ Consider a gray configuration with an extra pebble in some box. Repeatedly perform plus moves until we cannot do so anymore. It is easy to check that this process leaves every box filled with at least one pebble, so we are done. $\blacksquare$ $\textbf{Claim: }$ Given any unsolvable configuration that is not gray, we can add a pebble to some box such that the resulting configuration is unsolvable. $\textbf{Proof: }$ We can always perform some number of plus moves to a configuration with more than $2n-2$ pebbles to reach the desired state, so all unsolvable configurations contain at most $2n-2$ pebbles. Consider some unsolvable configuration. If this configuration contains a box with an odd number of pebbles, the adding a pebble to this box keeps the configuration unsolvable. If all of the boxes contain an even number of pebbles, then there are at most $2n-4$ pebbles in total. Let the numbers of pebbles in the boxes be $2a_1,2a_2,\dots,2a_n,$ and suppose we add a pebble to the first box. By the argument we used in the proof of the first claim, the number of empty boxes that can be filled is at most $$\left\lceil\frac{2a_1+1}{2}\right\rceil+ \left\lceil\frac{2a_2}{2}\right\rceil+\left\lceil\frac{2a_3}{2}\right\rceil+\dots+\left\lceil\frac{2a_n}{2}\right\rceil\le n-1.$$Hence, adding the pebble kept the configuration unsolvable, as desired. $\blacksquare$ Having proved these three statements, we conclude that the only initial configurations which are not solvable, but become solvable when an additional pebble is added to any box, are gray.
08.07.2020 06:02
Hmmm this seemed fairly simple... hope I'm not missing something obvious :/ Let the number of pebbles in each box be $b_1, b_2, \dots, b_n.$ We claim the initial configuration must satisfy the conditions: $b_1, b_2, \dots b_n$ are even $b_1+b_2+\cdots + b_n = 2n-2.$ It is obvious the first condition must be satisfied, for if there existed odd $b_i,$ adding a pebble to $b_i$ would keep the configuration unsolvable. Let $m$ be the number of nonempty boxes (WLOG let such boxes be $b_1, b_2, \dots, b_m$). Evidently, since the initial configuration is unsolvable, the number of pebbles either moved or removed must not exceed $n-m-1.$ Moreover, since adding one pebble makes the configuration solvable, the number of pebbles either moved or removed in the initial condition must be exactly $n-m-1.$ Hence, $$\sum_{i=1}^m \frac{b_i-2}{2} = n-m-1,$$giving indeed that $b_1+b_2+\cdots + b_m = b_1+b_2+\cdots b_n = 2n-2.$ $\blacksquare$
24.08.2020 08:20
Let $a_1, a_2, \dots, a_n$ be the number of pebbles in each of the n boxes. The following conditions are sufficient: There are $2(n-1)$ in total (1) $a_1, \dots, a_n$ are all odd (2) Proof of (1) First, note that the maximum number of pebbles that can be moved from box i to any other box is $\left(\frac{a_i-1}{2} \right)$ for odd $a_i$, and $\left(\frac{a_i-2}{2}\right)$ for even $a_i.$ If a pebble is added to a box with an odd number of pebbles, the maximum number of pebbles you can move from that box will not change, since $\left(\frac{a_i-1}{2}\right) = \left(\frac{(a_i+1)-2}{2}\right).$ If you add a pebble to a box with an even number of pebbles, the maximum number of pebbles you can move from that box will increase by one, since $\left(\frac{(a_i+1)-1}{2}\right) = \left(\frac{a_i-2}{2}\right)+1.$ Now combining the two previous facts implies that the number of pebbles in each box has to be even. Proof of (2) We now prove that the total number of pebbles in the initial configuration must be $2n-2.$ Let $m$ be the number of empty boxes. Then, we must have $m-1 = \sum_{a_i>0} \left(\frac{a_i-2}{2}\right).$ The result follows.
28.09.2020 03:20
Clearly, donating to a nonempty box is suboptimal, because that donation could have gone to a nonempty box and there would then be less non-empty boxes to deal with, while still maximizing the total number of existing marbles. Under this assumption, we claim that: Claim: The number of pebbles in each box is even. Proof: Let boxes have $a_1 \to a_n$ pebbles each. Since we assume that boxes do not donate to nonempty boxes, each box has $\left\lfloor\tfrac{a_i - 1}{2}\right\rfloor$ pebbles to offer to nonempty boxes. If there is an $a_i$ that is odd, then adding one pebble to that box does not increase the total number of pebbles that can be offered to empty boxes, and thus the configuration would still be unsolvable. Claim: The total number of pebbles $a_1 + \ldots + a_n$ must be $2n - 2$. Proof: From the above claim we may assume all $a_i$ are even. Suppose that $k$ of the $n$ boxes are empty. Then, we may write\[k = 1 + \left(\sum_{a_i \geq 2} \frac{a_i - 2}{2}\right)\]and the result follows from rearranging. $\square$ Hence, the conditions necessary and sufficient for the problem are all $a_i$ even and $a_1 + \ldots + a_n = 2n - 2$. Remark: I hate this problem. It is utter garbage.
10.11.2020 20:20
$|0|0|10|0|2|0| \rightarrow |1|1|2|1|2|1|$ A case with $6$ boxes. Let the number of pebbles in each box be $p_1,p_2, \dots, p_n.$ Claim: A configuration is solvable if and only if $$Q = \sum \left\lceil\frac{p_i}{2} \right\rceil \ge n.$$ We prove this with induction on the number of stones. Let $\sum p_i = M.$ If $Q < n$ then the configuration is unsolvable. Suppose $Q \ge n$ and that there is an empty box (otherwise we are done). Then, we have $M > n-1$ so one box has at least $2$ stones. Then remove the two from that box, and place one in the empty one. The value of $Q$ will remain the same, so we are done. $\square$ From this we can find the answer of $2 \mid p_i$ and $\sum p_i = 2n-2.$ $\blacksquare$
10.01.2021 02:06
Not too hard. Let the first $k$ boxes contain positive pebbles, with box $i$ containing $a_{i} > 0$ pebbles while the last $n - k$ boxes contain no pebbles. I claim iff \[\sum_{i = 1}^{k} \left\lfloor\frac{a_{i} - 1}{2}\right\rfloor \geq n-k\]then this configuration is solvable. To prove the if direction, observe that if a box has $r$ pebbles, then we can take two pebbles, and move one over to an empty box a total of $\lfloor\frac{r-1}{2}\rfloor$ times such that the box still contains at least one pebble at the end. Thus, if this inequality was true, then from each box, we can make that number of moves to give every empty box at least one pebble while still having a positive number of pebbles in each original box, which makes it solvable. To prove the only if direction, let $T$ be the current amount of empty boxes, $S$ be the set of non-empty boxes, and \[M = \sum_{i \in S} \left\lfloor\frac{a_{i} - 1}{2}\right\rfloor - T\]Originally, $M$ is negative. Now, whenever we make a move, let's say we took two pebbles from box $i$ and put a pebble in box $j$. Taking two pebbles from box $i$ will decrease $\lfloor\frac{a_{i} - 1}{2}\rfloor$ by $1$. If $j$ isn't empty, then $\lfloor\frac{a_{j} - 1}{2}\rfloor$ can increase by at most $1$. If $j$ is empty, then $T$ decreases by $1$, $j$ gets added into $S$, and $\lfloor\frac{a_{j} - 1}{2}\rfloor = 0$. Thus, after each move, $M$ can not increase. Since after each move the total number of pebbles decreases, this process must terminate, so at the end of our process, when we can't make any moves, $M$ is negative, and since we can not make any moves the number of pebbles in each box is $0$ or $1$, so there exists empty boxes so this configuration is not solvable. Now, the configurations that are not solvable but when adding a pebble to any box will result in it being solvable are the following: We must have the number of pebbles even in each box, else $\sum_{i = 1}^{k}\lfloor\frac{a_{i} - 1}{2}\rfloor$ will remain the same when we place a pebble in a box with odd number of pebbles. Furthermore, we must have that sum is equal to $n - k - 1$, so increasing it by $1$ will result in it being solvable. This describes all such configurations.
05.03.2021 17:12
The answer is all configurations with $2n-2$ pebbles where each box contains an even number of pebbles. We will show that this works later. Call a box "sending" if at any moment we take pebbles out of it, and "receiving" if at any moment we put pebbles into it. We will show that it is never optimal to have a box that is both sending and receiving. Indeed, suppose a box $B$ received a pebble from $A$ and gave a pebble to $C$ (clearly if $A=C$ then we could have more pebbles in every box by not doing this procedure, so assume that they are distinct). Then $A$ lost 2 pebbles, $B$ lost one pebble, and $C$ gained one pebble. If instead we had moved a pebble from $A$ directly to $C$, each box would have at least as many pebbles in it, so such a move is not optimal. Now we see that if a box starts out with pebbles, there is no point in the box receiving more, so it either sends pebbles or does nothing at all. Also a box starting out without pebbles must be receiving (if possible). Further, we can observe that if a box contains $k$ pebbles in it, then it will be able to "send" at most $\lfloor (k-1)/2\rfloor$ marbles (this is in terms of the number of marbles which are placed, not removed). We will now characterize all solvable configurations. Suppose that there are $k$ boxes that contain pebbles, with $a_1,a_2,\ldots,a_k$ being the pebble count in each of these boxes. Then there are $n-k$ boxes which do not contain pebbles. We obviously require at least as many marbles which can be "sent" as there are empty boxes, which yields the inequality: $$\sum_{i=1}^k \left \lfloor \frac{a_i-1}{2}\right \rfloor \geq n-k.$$We can see that this is also sufficient for a configuration to be solvable, since we can simply "send" one marble to each empty box given that this inequality holds. Now consider a configuration which is not solvable, but becomes solvable when an additional pebble is added. We see that if any of the $a_i$ are odd, then adding one more pebble to that box will not change the number of pebbles which are "sendable", so the configuration will remain unsolvable. This all of the $a_i$ must be even in one of the desired configurations. Thus substitute $a_i=2b_i$. Then since the initial configuration is unsolvable we have: $$\sum_{i=1}^{k} \left \lfloor \frac{2b_i-1}{2} \right \rfloor < n-k \implies \left(\sum_{i=1}^k b_i\right)< n.$$However when we add one marble to a previously empty box, we will have $n-k-1$ empty boxes (this doesn't end up changing the number of "sendable" pebbles), so we require: $$\sum_{i=1}^{k} \left \lfloor \frac{2b_i-1}{2} \right \rfloor\geq n-k-1 \implies \left(\sum_{i=1}^k b_i\right)\geq n-1,$$which is enough to imply: $$\sum_{i=1}^k b_i=n-1$$which means that all working configurations have $2n-2$ pebbles, each box containing an even amount. To see that this is sufficient, note that if we add a pebble to any nonempty box, the number of "sendable" pebbles increases by one and becomes equal to however many empty boxes we had (this case is similar to the case where we add one marble to a previously empty box). Since we have shown that this inequality is both necessary and sufficient for solvability, we conclude that every configuration with $2n-2$ pebbles, each box containing an even number of them, is solvable. $\blacksquare$
19.08.2021 16:24
Call a configuration that becomes solve-able after adding one pebble a "purple" configuration. Define the score of a configuration as the minimum number of 0s that can be achieved after processing. Claim: The score of any configuration with $x_i$ in each box is \[\text{max }\left(\sum_{i=1}^n \lfloor\frac{x_i-1}{2}\rfloor,0\right)\]Proof: Casework. If $x_i=0$, this clearly decreases the score by 1. If $x_i=1,2$, they are neutral since they cannot contribute, so they contribute 0. If $x_i\geq 3$, they can clearly contribute exactly $\lfloor\frac{x_i-1}{2} \rfloor$ pebbles to remove other 0s. $\blacksquare$ Claim: Purple Configurations are those with all even terms and $\sum_{i=1}^n x_i = 2n-2$. Proof: Firstly, all $x_i=2y_i$ must be even (or else adding a pebble will not increase the score to 0). Next, we must have \[\sum_{i=1}^n \lfloor\frac{2y_i-1}{2}\rfloor =\sum_{i=1}^n (y_i-1)= -1\]Thus, $\sum_{i=1}^n y_i = n-1$ so we are done. $\blacksquare$
01.09.2021 01:36
Suppose we have $k$ non-empty boxes $B_1, B_2, \ldots, B_{k}$ and $n-k$ empty boxes $B_{k+1}, B_{k+2}, \ldots, B_n$. We claim an initial configuration is solvable if and only if $$|B_{1}| = 2a_1, |B_{2}| = 2a_2, \ldots, |B_{k}| = 2a_k$$for positive integers $a_1, a_2, \ldots, a_k$ such that $$\sum_{i=1}^{k} a_1 = n - 1.$$First, we deduce some properties of solvable and non-solvable configurations. If we can take $2$ pebbles from $B_i$ up $m$ times without adding any extra pebbles to $B_i$ or making $B_i$ empty, then we say $B_i$ has $m$ gifts. (In particular, if $|B_i| = j$, then $B_i$ has $\left \lfloor{\frac{j-1}{2}}\right \rfloor$ gifts.) Claim: Let $G$ be the total number of gifts across all boxes. If we add a pebble to an empty box, then $G$ decreases by $1$. If we add a pebble to a non-empty box, then $G$ either stays constant or decreases by $1$. Proof. Whenever we take $2$ pebbles from a box, the number of gifts it contains decreases by $1$. Now, $\bullet$ Suppose the extra pebble goes into an empty box $B_i$. Then, $B_i$ still contains $0$ gifts, so the value of $G$ decreases by $1$. $\bullet$ Suppose the extra pebble goes into a non-empty box $B_d$. Now, $B_d$ can gain at most $1$ gift, so the value of $G$ either stays constant or decreases by $1$, as desired. $\square$ Thus, if we start with $t$ gifts overall, then we can turn at most $t$ empty boxes into non-empty boxes. Thus, our initial configuration can contain at most $n - k - 1$ gifts, as it must be unsolvable. Now, consider the additional pebble we add to one of our $n$ boxes. If the additional pebble goes into a previously empty box, then our new configuration contains $n - k - 1$ empty boxes, and we still have at most $n - k - 1$ gifts. But this new configuration must be solvable, so we conclude the initial configuration must contain exactly $n - k - 1$ gifts. Now, assume the additional pebble goes into a previously non-empty box. Then, we still have $n - k$ empty boxes, and either $n - k - 1$ or $n - k$ gifts. But this new configuration has to be solvable, so we know it must contain $n - k$ gifts. This means adding a pebble to any of our initially non-empty boxes increases the number of gifts it contains by $1$. Hence, the values of $$|B_1|, |B_2|, \ldots, |B_k|$$all must be even, i.e. $$|B_{1}| = 2a_1, |B_{2}| = 2a_2, \ldots, |B_{k}| = 2a_k$$for positive integers $a_1, a_2, \ldots, a_k$. Now, in order for the total number of gifts contained within these $k$ boxes to be $n - k - 1$, we need $$\sum_{i = 1}^{k} \left \lfloor{\frac{|B_i| - 1}{2}}\right \rfloor = \sum_{i = 1}^{k} \left \lfloor{\frac{2a_i-1}{2}}\right \rfloor = \sum_{i = 1}^{k} (a_i - 1) = n - k - 1$$so $$\sum_{i = 1}^{k} a_i = (n - k - 1) + k = n-1.$$As a result, we have shown the answer we originally claimed is the only possible starting configuration, so it suffices to show our answer works. Notice that starting with $n - k - 1$ gifts makes the initial configuration unsolvable. We've previously shown adding an additional pebble to any of our $n$ boxes results in the total number of gifts across all boxes being greater than or equal to the number of empty boxes (in our new configuration). Now, gifting $1$ pebble to each of our empty boxes suffices, and we're done. $\blacksquare$ Remarks: I could've consolidated my answer to hold for all $k$, as the value of $$\sum_{i = 1}^{k} a_i$$only depends on $n$. Also, it took me $5$ minutes to solve this problem, but $1$ hour to complete this write-up. I guess I'm still trash at writing proofs, although this question does have a lot of cumbersome details.
07.03.2022 22:42
Let $a_1$, $a_2$, $\ldots$, $a_n$ be the number of pebbles in each box. Then, we claim that it is solvable if and only if $$\sum_{i=1}^n\left\lfloor\frac{a_i-1}2\right\rfloor\geq0.$$If this inequality is true, then we will show that it is solvable. Let $x$ be the sum of $\left\lfloor\frac{a_i-1}2\right\rfloor$ for all $a_i>0$, and let $y$ be the number of $a_i$ that are equal to $0$. Then, $x\geq y$. Since $\left\lfloor\frac{a_i-1}2\right\rfloor$ is the maximum number of times two pebbles can be taken, this means that we can take two pebbles from each of the boxes with at least $3$ pebbles and distribute the $x$ pebbles to the $y\leq x$ empty boxes. Now, we will show that this inequality is necessary. If there are two moves moving pebbles from box $a$ to box $b$, then moving pebbles from box $b$ to box $c$, it is the same as removing two pebbles from box $a$, removing one pebble from box $b$, and adding one pebble to box $c$. This means that it is better to move pebbles directly from box $a$ to box $c$. Therefore, if it is solvable, then each box $i$ such that $a_i>1$ can only have two pebbles removed $\left\lfloor\frac{a_i-1}2\right\rfloor$ times, so since $\left\lfloor\frac{0-1}2\right\rfloor=-1$, this means that we must have $$\sum_{a_i>0}\left\lfloor\frac{a_i-1}2\right\rfloor\geq\sum_{a_i=0}1,$$which is equivalent to $$\sum_{i=1}^n\left\lfloor\frac{a_i-1}2\right\rfloor\geq0.$$ Therefore, if an initial configuration of pebbles is not solvable but adding a pebble makes it solvable, then $a_i$ must be even for all $i$. Let $a_i=2b_i$. Then, $\sum_{i=1}^n(b_i-1)=-1$, so an initial configuration satisfies the conditions if and only if $\sum_{i=1}^nb_i=n-1$.
02.05.2023 23:20
Claim: A configuration is \emph{solvable} iff \[\sum_{i=1}^n \left\lceil\frac{a_i}{2}\right\rceil\ge n\] We will prove this by induction from the number of pebbles. Let \[\sum_{i=1}^n \left\lceil\frac{a_i}{2}\right\rceil=S\] If $S<n$ then we will prove that after every move it will still be. Let WLOG we make a move on $a_1$ and $a_2$. So $\left\lceil\frac{a_1}{2}\right\rceil$ becomes $\left\lceil\frac{a_1-2}{2}\right\rceil=\left\lceil\frac{a_1}{2}\right\rceil-1$ and $\left\lceil\frac{a_2}{2}\right\rceil$ becomes $\left\lceil\frac{a_2+1}{2}\right\rceil=\left\lceil\frac{a_2}{2}\right\rceil+\{0;1\}$. So the sum of the first two boxes doesn't increase so the whole sum doesn't. Now if we have $S\ge n$, then we can find an empty box (either we are done) and a box with at least $2$ marbles in it. Using the turn on those two boxes decreases the number of stones, but doesn't decrease $S$, so we are done by induction. Now we only need to see the obvios that if \[\sum_{i=1}^n \left\lceil\frac{a_i}{2}\right\rceil< n\] But we add a marble in any box, it increases it means that in each box there is an even amount of marbles. So the conditions for \emph{almost solvable} configuration are $\blacksquare $ $\sum_{i=1}^n a_i=2n-2$ $\blacksquare$ $a_i$ is even for every $i$
25.08.2023 16:44
Let the number of pebbles in each box be $a_1$, $a_2$, $\dots$, $a_n$. The idea is the following: Claim: Iff a pebble configuration is solvable, then \[ \sum_{i = 1}^n \left\lceil \frac{a_i}{2} \right\rceil \ge n. \] Proof. Induct on number of stones - note that if the LHS is less than $n$ then there is nothing to prove. Otherwise, the LHS is greater than or equal to $n$, and hence there must exist a box with two stones - use this to fill an empty box and induct downward, noting that the LHS is still greater than $n-1$. Now it is trivial to extract that our answer is that we have $2n-2$ stones and the number of stones in each box is even.
20.11.2023 05:06
Call such a configuration almost solvable. A configuration with $n$ boxes is almost solvable if and only if it contains $2n-2$ pebbles such that each box contains an even number of pebbles. If a box has $a$ pebbles, we can take pebbles from it $\left\lfloor{\frac{a - 1}{2}} \right\rfloor$ times in order to keep it nonempty. In order to reach a solvable configuration after adding one pebble, this expression must increase by one when we increase $a$ by one, so all the boxes must have an even number of pebbles. Now suppose there are $k$ nonempty boxes and $n-k$ empty boxes. In order to reach a solvable box, we must take pebbles from the $k$ boxes $n-k$ times, and each time we take $2$ pebbles, so in an almost solvable configuration we must be able to take pebbles $n-k-1$ times. Since all boxes have an even number of pebbles, after taking as many pebbles as possible, each box that was originally nonempty ends up with $2$ marbles. Thus, there must be $$2(n-k-1) + 2k = 2n-2$$marbles in total.
21.11.2023 00:15
First we look at how many pebbles each initially non-empty box can 'contribute', i.e. give to other boxes. For boxes which initially have an odd number of pebbles (say $2k-1$), it is clearly $k-1$ (after which only 1 is left inside). If the box initially had an even number of pebbles (say $2k$), it can contribute $k-1$, after which it is left with 2. If it uses up these 2 as well, it will have contributed $k$, but now it is empty and 2 pebbles need to be lost from some other box to make it non-empty. So its overall contribution would be $k-2$, which is worse. Therefore a box with $2k$ can contribute maximum $k-1$. (Call this ($\heartsuit$).) So an even number can contribute only as much as the odd number before it. Call the kind of configs we have to determine 'nice'. If there is a box with an odd number of pebbles in a nice config, then if we add a pebble to that box, essentially nothing changes because nothing more can be contributed to boxes outside it. So nice configs can only have boxes with an even number of pebbles. Therefore the total number of pebbles in a nice config must be even. Claim: $2n$ pebbles suffice for all boxes having even pebbles (without adding any pebbles). Proof: Let there be $x$ empty boxes and $n-x$ non-empty boxes. The amount of contribution you would get from the non-empty ones (which contain $2n$ in total) is $n - (n-x)$ (because of ($\heartsuit$), we take half and subtract one for each box, since all are even) This is equal to $x$, which is exactly enough. (Clearly anything $< 2n$ would not suffice if all are even, because then you would get $<x$. Call this observation ($\star$).) Therefore nice configs must have $<2n$ pebbles. Claim:Configs in which all boxes have even pebbles and there are $2n-2$ pebbles in total, are the only nice configs. Proof: Suppose you add a pebble to an even box in such a config. Then it would become odd. You might as well add one more pebble to that box, because that would not make a difference. Now you have $2n$ pebbles with an even number in each box, and we have shown that this is solvable. If you added a pebble to a config with all even boxes but less than $2n-2$ in total, you can again add a pebble to that box (which wouldn't make a difference) and end up with $<2n$ pebbles, all boxes even. But this is not solvable by ($\star$). Hence our claim is proven and we are done.
14.12.2023 21:50
I loved this problem. Is this below a kind of new (localish) solution? Replace the pebbles with nuts (because deez nuts). The answer is $2n-2$ nuts distributed over the boxes where each box has an even number of nuts. Call every such sequence that become solvable after adding one more pebble as deez. We analyze the deez sequences. Call the nut we add in later as the extra nut. Also, let $b_i \rightarrow b_j$ denote a move of removing two nuts from $b_i$ and adding one to $b_j$. Now let $\mathcal S$ denote the sequences of moves that solve the configuration after adding in the extra nut. Now among all the sequence of moves that solve the configuration, take the one with the minimal number of moves. Now let $b_i$, $b_j$ be two non-empty boxes. Note that the move $b_i\rightarrow b_j\rightarrow b_k$ does not make any sense as we could have just done $b_i\rightarrow b_k$ which contradicts the minimality. Therefore we make no moves that are from a non-empty box to a non-empty box. So our moves are always from non-empty boxes to empty boxes. $\textbf{CLAIM: }$ The deez does not have any box with odd number of nuts. $\textbf{PROOF: }$ FTSOC assume there was one, call it $C$. We add in the extra nut into $C$, which turns it into a box with even number of nuts. But then note that we can perform all the moves of $\mathcal S$ even before we add in the extra nut because before adding in the extra nut in $C$, we could perform $\left\lfloor \dfrac{|C|-1}{2} \right\rfloor = \left\lfloor \dfrac{(|C|+1)-1}{2} \right\rfloor$ moves which is the same before and after adding in extra nut. So the configuration is still not solvable, contradiction. $\square$ Note that in the deez sequence, there is at least one empty box with no nuts. Now we divide into cases. $\textbf{CASE 1: }$ There is only one empty box. $\textbf{SOLUTION: }$ Note that in this case, we must have that every box has $\le 2$ nuts in them, otherwise we are already done since we can remove two nuts from some box with $\ge 3$ nuts and add in one nut in the empty box which is a contradiction. Now note that all the non-empty boxes have $\ge 1$ nut in them. Now if some box had exactly $1$ nut, then it would contradict our initial claim. So all the boxes have $2$ nuts each and thus, we have a deez configuration that satisfies the solution set. $\textbf{CASE 2: }$ There are $\ge 2$ empty boxes. $\textbf{SOLUTION: }$ We add the extra nut into one of the empty boxes. Note that the deez has more empty boxes, but from the problem condition, we know that this configuration is now solvable. Let $B$ denote the empty box in which we put the extra nut. Now note that we neither make a move $b_i\rightarrow B$, nor make a move $B\rightarrow b_i$. So the moves in $\mathcal S$ can also be performed even before we added the extra nut. Thus we execute all the moves in $\mathcal S$ before we add in the extra nut, then finally add in the extra nut and analyze the condition. Note that this configuration is still not solvable until we add in the extra nut, but also that we exhausted all the available moves in $\mathcal S$. So after executing all these moves, we are left with a configuration that has only one empty box which is $B$. But then similarly as before, all the other boxes must have $\le 2$ nuts in them. Before adding in the extra nut, let there be $c$ boxes with $2$ nuts in them, and so, there are $n-c-1$ boxes with $1$ nut in them. Now note that all these boxes having $1$ nut in them must have received its nut from some other box (this is because removing two nuts from some box does not change its parity), since we had that there is no box with an odd number of nuts in the deez before we started. So in the initial configuration, there were a total of $2c+2(n-c-1) = 2n-2$ nuts. Finally since we had that there are no boxes with odd number of nuts, we are done.
18.12.2023 17:30
We claim that the answer is every configuration such that there are $2n-2$ pebbles, and each pile has an even number of stones. First we prove that this works. Consider grouping two pebbles together from each pile such that we have $n-1$ pairs. We can see that each of these pairs can be moved (or not moved) to be place in one pile. (we can either not move it or we can move it). Thus when we have $2n-2$ stones we cannot have the given. If we have $2n-1$ stones. Then we have one pile with an odd number of stones. Now take the $n-1$ pairs of stones and we can put these in all the $n-1$ piles that don't contain the other stone. \textbf{Claim: } There is no difference if we add one pebble to a box and there are an odd number of pebbles in it. We let there be $2n-1$ coins in the box. We pair them into $n-1$ pairs and one single coin that must stay in that box. If we add another coin then we stil must leave two coins so we still will have $n-1$ pairs in the box. We can see that since our construction works we are done. $\blacksquare$
29.12.2023 08:37
A very straightforward question
26.03.2024 18:56
Hope this isn't a fakesolve, but dude this problem is amazing! Denote $a_1, a_2, \dots, a_n$ by the numbers of pebbles in $n$ boxes. Then we'll claim that answer is all initial configurations satisfying $a_1 + a_2 + \dots + a_n = 2(n-1)$ and $2 \mid a_i$ for all $1 \le i \le n$. Claim 1: We may assume that at each moment, we don't operate on box that has exactly 2 pebbles. Proof. Assume box $A$ has 2 pebbles and assume that we operated $A$ and sent 1 pebble to $B$. Since at the end, all box has at least 1 pebbles, so there exists a box $C$ such that $C$ was operated and 1 one pebble moved from $C$ to $A$. We will just send 1 pebble from $C$ to $B$. This will change nothing. $\blacksquare$ Let $P$ be an arbitrary initial configuration satisfying the problem condition. Claim 2: Every box in $P$ contains even number of pebbles. Proof. Assume the contrary, some box in $P$ has $2k+1$ pebbles. Then if we add 1 pebble to that box, then that box has exactly $2k+2$ pebbles. By claim 1, we may assume that we operate on that box at most $k$ times. However, regardless adding 1 pebble to that box, we can operate exactly $k$ times, therefore we can reach a configuration that every box has at least 1 pebble, contradicting the fact that $P$ is an initial configuration satisfying the problem condition. $\blacksquare$ Now the rest is easy. Assume the total number of pebbles in $n$ boxes are less than $2(n-1)$. If some box has $2 \mid c$ pebbles, then by claim 1 and claim 2, we can operate on that box at most $\frac{c}{2} - 1$. Assume that there were exactly $k$ empty boxes. Since we added 1 pebble on some box, so the total number of operation we can do is $\frac{a_1 + a_2 + \dots + a_n}{2} - (n-k) + 1 < (n-1) - (n-k) + 1 = k$, a contradiction. Thus the total number of pebbles is at least $2(n-1)$. $\blacksquare$
08.07.2024 18:27
The answer is when there are $2n-2$ pebbles and that each box has an even number of pebbles. First we show that there mustn't be any boxes with an odd number of pebbles. Note that if we place the new pebble into the box with the odd number of pebbles, it becomes even. However, the number boxes the pebbles can fill in total is still the same, thus still making it not solvable. Now that we know each box has an even number of pebbles, we simply need to have enough such that we can always turn the case into one where $n-1$ boxes have a single pebble in them. This obviously needs $2(n-1)=2n-2$ pebbles. Any less and we would have $2$ empty boxes after moving all we can, and any more and the case would be solvable. Thus, we're done.
30.10.2024 05:46
straightforward but kinda strange to writeup
29.12.2024 02:05
Suppose $b_i$ is the number of pebbles inside box $i$. We claim our desired configurations can be classified as \[\boxed{\sum b_i = 2n-2 \text{ and } 2 \mid b_i ~ \forall ~ 1 \leq i \leq n}.\] Define the capacity of a configuration as $C(S) = \sum \left\lceil\frac{b_i}{2}-1\right\rceil$ and $E(S)$ as the number of empty slots. The main observation is that $C(S) - E(S)$ cannot increase, so if this quantity is initially negative, the configuration is not solvable. Conversely, this quantity being positive allows us to solve it by directly filling all empty slots. Thus, unsolvable configurations are equivalent to \[C(S) - E(S) = \sum_{i=1}^{n-E(S)} \left\lceil\frac{b_i}{2}-1\right\rceil - E(S) \leq -1\]\[\sum_{i=1}^{n-E(S)} \left\lceil\frac{b_i}{2}\right\rceil \leq (n-E(S)) + E(S) - 1 = n-1.\] In any configuration where we have at least one odd $b_i$, adding the pebble to that box would not affect $C(S) - E(S)$, and thus not change its solvability. But since all $b_i$ in our desired configurations are even, adding a pebble anywhere would bump up $C(S)$ by 1 while preserving or decreasing $E(S)$ by 1, making $C(S) - E(S)$ nonnegative. $\blacksquare$
06.01.2025 01:01
The answer is all configuration with $2n-2$ pebbles distributed in such way that every box contains an even number. Call a configuration special if it is not solvable but becomes solvable when a pebble is added to any box. Let $k$ denote the number of empty boxes and $p_i$ the number of pebbles in the box $i$ for $i=1,\cdots, n.$ Let $S=\displaystyle \sum_{i\in X} \lfloor \frac{p_i-1}{2} \rfloor $ where $X$ denotes the set of indices $i$ for which the box $i$ is non-empty. $S$ represents the number of possible moves. Claim : A configuration is special if and only if $S=k-1$ and $p_i$ is even for all $1\leq i \leq n.$ Note that a move decreases $k$ by at most one and that $S-k$ is non-inceasing over time. Thus, a configuration is solvable if and only if $S\geq k.$ Now, note that the configuration is not solvable implies that $S\leq k-1.$ And adding one pebble to an empty box makes it solvable implies $S\geq k-1$. Also adding a pebble to a non-empty box implies that $S$ must increase by at least $1$ when $p_i$ increases by at least one for each $i\in X.$ which is equivalent to $p_i$ being even. A configuration is special $\iff \begin{cases} p_i \text{ is even for all } i\in X \\ S=k-1 \end{cases} \\ \iff \begin{cases} p_i \text{ is even for all } 1\leq i \leq n \\ S= \displaystyle\sum_{i\in X} \frac{p_i-2}{2} = k-1 \end{cases} \iff \begin{cases} p_i \text{ is even for all } 1\leq i \leq n \\ \displaystyle \sum_{i\in X }p_i = 2(|X| +k-1) \end{cases} \iff \begin{cases} p_i \text{ is even for all } 1\leq i \leq n \\ \displaystyle \sum_{i=1 }^n p_i = 2(|X| +k-1) = 2(n-1). \end{cases} $