July 8, 2010

Minipolymath2 project: IMO 2010 Q5

This post marks the official opening of the mini-polymath2 project to solve a problem from the 2010 IMO. I have selected the fifth question (which appears to be slightly more challenging than the sixth, for a change) as the problem to focus on:

Problem. In each of six boxes there is initially one coin. There are two types of operation allowed:

Type 1: Choose a nonempty box with . Remove one coin from and add two coins to .

Type 2: Choose a nonempty box with . Remove one coin from and exchange the contents of (possibly empty) boxes and .

Determine whether there is a finite sequence of such operations that results in boxes being empty and box containing exactly coins. (Note that .)

The comments to this post shall serve as the research thread for the project, in which participants are encouraged to post their thoughts and comments on the problem, even if (or especially if) they are only partially conclusive. Participants are also encouraged to visit the discussion thread for this project, and also to visit and work on the wiki page to organise the progress made so far.

All are welcome. Everyone (regardless of mathematical level) is welcome to participate. Even very simple or “obvious” comments, or comments that help clarify a previous observation, can be valuable.

No spoilers! It is inevitable that solutions to this problem will become available on the internet very shortly. If you are intending to participate in this project, I ask that you refrain from looking up these solutions, and that those of you have already seen a solution to the problem refrain from giving out spoilers, until at least one solution has already been obtained organically from the project.

Not a race. This is not intended to be a race between individuals; the purpose of the polymath experiment is to solve problems collaboratively rather than individually, by proceeding via a multitude of small observations and steps shared between all participants. If you find yourself tempted to work out the entire problem by yourself in isolation, I would request that you refrain from revealing any solutions you obtain in this manner until after the main project has reached at least one solution on its own.

Update the wiki. Once the number of comments here becomes too large to easily digest at once, participants are encouraged to work on the wiki page to summarise the progress made so far, to help others get up to speed on the status of the project.

Metacomments go in the discussion thread. Any non-research discussions regarding the project (e.g. organisational suggestions, or commentary on the current progress) should be made at the discussion thread.

Be polite and constructive, and make your comments as easy to understand as possible. Bear in mind that the mathematical level and background of participants may vary widely.

[…] collaboratively but have been intimidated by the difficulty of the problems, I recommend the Minipolymath2 project which has just started and involves an intriguing puzzle with coins and boxes. All ability levels […]

By the first rule we can say that a coin in B_6 is worth 1, a coin in B_5 is worth 2, …, a coin in B_1 is worth 32. By applying the second rule in certain situations the total worth of the boxes may go up (when B_(j+2) has four more coins than B_j). It seems plausible, then, that we might be able to get an arbitrarily high “total worth.”

This seems to imply that we cannot get arbitrarily high “total worth.” If I use the coin in then this box will never have another coin in it. If I have already used the coin in (or decide to “save” this coin for further use, then the same should apply to the coin in (I can only use it once). This seems to go on (I’m not sure exactly how it goes) to show that we can’t get an arbitrarily high “total worth.” Can we find a specific bound?

We can probably construct some sort of recursive formula for maximal # of coins in a given box. For example, we can use the coin in B_1 obtain B_2 with 3 coins, or use just boxes B_2,…,B_6 (i.e. a five-box variant of our problem) to get as many coins as possible in B_3 and then exchange B_2 and B_3.

Minor correction: one applies the Type 2 rule once and then Type 1 rule Y times.

It seems worthwhile to have a systematic notation for these sorts of moves, for instance Type 1 is and Type 2 is (bearing in mind, of course, that one is not allowed to have a negative number of coins).

Can we first get one thing out of the way and prove that is not “too large”, i.e. some value greater than or equal to it can be attained?

(This may not be much help in proving that the exact value can be attained, but it would overcome the most surprising-at-first-sight thing about the question, which is that we may be able to get so large a value starting with just 6 coins.)

Could the following approach work? Get a number larger than which I will call in one of the first
four cans then then exchange the contents of and till there are the right number of coins in . Note to do this we must also get the other boxes empty. That leaves the question of constructing an arbitrarily large number.

Yes, it looks like it is relatively easy to remove coins from the system, but difficult to add coins to the system. This suggests splitting the problem into two subproblems if one wants to solve the problem affirmatively:

Subproblem 1: Show that one can have arbitrarily many coins in the system.

Subproblem 2: Given that one can find a state with arbitrarily many coins, obtain a state in which the first five boxes are empty and the last box contains coins.

To solve the problem negatively, it does seem the best approach would be to give a negative answer to Subproblem 1 in a sufficiently quantitative fashion.

First thought on solving Subproblem 1 was to find a loop in the system; some set of operations that returns boxes 1..k to their initial position, but increases k+1. However, that seems impossible to me, given the nature of the operations. There is no way to increase a later box without decreasing an earlier one.

Is that obvious enough that we can state it as fact? And if so, is there any route left by which we could possibly create an arbitrary number of coins in the system?

I think I understood Michael’s first line: In the place where there are two arrows at the end, we go by [N-2,0,8] -> [N-3,8,0] -> [N-3,0,16] -> etc. Using the coin from the first box to effectively double the amount in the third box.

We can probably do even better with four boxes (something like 2^{2^N} maybe?).

I’ve started a section on the wiki for “World records” on how large one can get various boxes, and added the above.

I’ve also started a section on “advanced moves” that are compositions of the two basic moves. It does seem worthwhile to have some sort of library of useful moves, particularly those that grow the number of coins rapidly. I encourage others to add to these lists.

Polya says if you can’t answer a question, try to find an easier question you might(!) be able to answer. I don’t know what strategy to use if there are 6 boxes (with some initial number of coins in each box) and I want to maximize total worth. Maybe I can find out what strategy to use if there are only 3 boxes that start with A, B, and C, coins respectively.

Not sure if this helps yet, but at some point we might think about working backwards:
Let’s say there is a solution and it takes steps. Then the next-to-last step, , would either have to be:

(Rule 1) 1 coin in B5, in B6, and 0 elsewhere; or

(Rule 2) 1 coin in B4, in B5, and 0 elsewhere.

If it’s Rule 2, then the step before *that*, i.e. (M-2), would have to have been one of the two options above but shifted once to the left… so it’d be just like solving the same puzzle but with only 5 boxes.
So it seems unlikely that the last few steps of the solution could be using Rule 2 several times in a row; otherwise we could solve the puzzle with fewer boxes, which doesn’t look promising.

The “total worth” of the boxes remains unchanges by rule number one. It is less than doubled by rule number two. So, as the total worth of the desired result is so large, any way to get their would take an enormous number of steps. PS how do I do latex in here? [See http://polymathprojects.org/how-to-use-latex-in-comments/ – T.]

Whoops—actually, if the (M-1) step was , that’s not actually equivalent to solving the problem with just 5 boxes. Here we do have 1 coin in B6 to start with, so we couldn’t just solve this with the first 5 boxes alone and then use Rule 2 on B4—that would leave us with 1 coin in B5. My bad. So just to get to the state we’d have to have somehow used B6 previously.

Assuming that we want to make things as large as possible (i.e. no emptying the system), our natural best guess would be to use Rule 1 again, yielding
[0, 1, 2, 0, 0, 0]. From there we could use Rule 1 twice and then Rule 2 once to get [0, 0, 4, 0, 0, 0].

You make the choice to immediately use the leftmost 1 (which I think is a good choice). What can be said about the general situation [a, b, c, d]? What are the strategies or useful move sequences when we have four boxes?

Strategy for starting with [A, 0, 0, 0] for A not two small: Apply rule number 1 (a few times) to get [A-2, 1, 0, 12]. Apply rule number 2 (a few times) to get [A-3, 12, 0, 0]. Apply rule 1 to get [A-3, 1, 0, 2^12]. Apply rule 2 to get [A-4, 2^12, 0, 0]. Apply rule 1 to get [A-4, 1, 0, 2^(2^12)]. Continue. The final result is [0, 1, 0, 2^2^2^… 2^12], where there are A-2 twos in the tower.

So if you’re right, that means we can get [0, 1, 0, 2^2^2^2^4] starting with [2, 0, 0, 0] which is certainly possible here.
So now it just becomes a question of whether we can get exactly the desired number.

We start with [1, 1, 1, 1, 1, 1]. A D1 and three D2’s gives [0, 0, 7, 1, 1, 1], which we will write as [7, 1, 1, 1]. D3 (which corresponds to the original D5) gives [7, 1, 0, 3]. Use the lemma 7 times and we get [0, 1, 0, 2^2^2^2^2^2^2^3]. Then with a D2 and two D3s we get [0, 0, 0, 4 + 2^2^…2^3].

So instead of using the lemma 7 times, only use it 6 times. Then you have [1, 1, 0, 2^2^2^2^2^2^3]. Swap, and you get [1, 0, 2^2^2^2^2^2^3, 0] Swap again, and you get [0, 2^2^2^2^2^2^3, 0, 0]. Swap as many times as needed until you get (2010^2010^2010)/4, then push it to slot 6.

The only thing to check is that 2^2^2^2^2^2^2^3 is greater than 2010^2010^2010, which was checked above for 2^2^2^2^4.

If we want to try to prove that the task is not possible, it might be worthwhile to give a value to a coin in box i as something larger than , for example, . This way, move 1 decreases the value, and it becomes much harder to increase the value using move 2. It may then be possible to then show that, if the value is below some critical level, it will always remain below that critical level.

1. Define a partial ordering on the possible configurations comparing the number of coins box by box.

2. “S_k” and “D_k” are monotone with respect to this ordering, i.e. they map comparable configurations in comparable ones and preserve order.

3. Both “S_k” and “D_k” are bounded by the “maximal” operation “M_k” that decreases n_k by one and
for k<=4: sets n_{k+1} to n_{k+2} + 2 n_{k+1} + 2 and sets n_{k+2} to 0
for k=5: increases n_6 by 2.

Clearly, M_k followed by some instances of D_{k+1} majorizes both D_k and S_k. By descending induction on k, we see that D_{k+1} may be replaced by M_{k+1} in the former statement. Therefore, any combination of Ds and Ss is majorized by some combination of Ms.

4. Call the number of boxes N and the initial sum of numbers in them "Sigma". By ascending induction on N we will obtain an upper bound on the sum of numbers in the boxes in terms of N and Sigma, say f(N,Sigma).

A. f(2,Sigma) = 2 Sigma

B. One potentially obtains the greatest sum if all of Sigma is concentrated in the first box.

C. At some points in time, one will use M_1. By B, assume that, at this points, the numbers in boxes 3,4,… are zero (this is probably the crudest estimate in the argument!). Then, until the next use of M_1, the number in box 2 will rise at most to f(N-1, n_2).

D. Combining this with the definition of M_1, we have

f(N, Sigma) \leq f(N-1, 2+2*f(N-1, … +2*f(N-1, 2) … ),

with Sigma occurences of f(N-1, \cdot ). This gives a (horrible) explicit bound on f(6,6), which is the maximal sum obtainable in the problem.

There is a “soft” argument that shows that the number of possible coins is bounded, based ultimately on the fact that the lexicographical ordering in is a well-ordering. Jargon aside, it works like this:

suppose that there was an infinite sequence of moves. Then the number of coins in the first box can only decrease, and must therefore eventually be constant. Once it is constant, the number of coins in the second box can only decrease, and must therefore eventually be constant. Iterating this we see that eventually all boxes must stay constant, i.e. there are no more moves available. So an infinite sequence of moves cannot occur. By Konig’s lemma, this implies that the total number of possible move sequences is finite, and so the total number of coins available is bounded.

I wonder if there is an inductive way of setting an upper bound by showing that a function aN1 + bN2 + cN3 + dN4 + eN5 + fN6 always decreases assuming a maximum bound on each number N1, N2, N3, N4, N5, N6, here we pick the numbers a,b,c,d,e,f with each number much bigger than the following one

I think the answer to the problem is that we can get the desired number of coins in Box 6. It looks like we need a function that dominates the tower function in the Ackermann hierarchy. We just have to find the right recursion and prove that it works. Then the problem becomes more like a programming problem in trying to find functions that blow up quickly from small initial values.

Random note: A strategy might be to end up with more than enough coins and then remove coins until you have the right amount in Slot 6. But if you end up stuck in spot 6 with more than enough stuff in the slot but zeroes everywhere else you’re stuck, since you have no moves to reduce it.

You’re likewise stuck if you end up with piles in slots 5 and 6, unless 6 is missing the correct amount of coins by precisely 2^n (where there are n coins in 5).

Just a reminder: we are now generating quite a few new world records and useful-looking advanced moves, together with other strategies and partial results; if you have the time, please put them on the wiki

For 3 boxes (1,1,1) we can get to (0,0,7)
For 4 boxes (1,1,1,1) we can get to (0,0,0,28)
For 5 boxes (1,1,1,1,1) we can get to (1,0,0,0,28) using the right-hand-first rule
then A1 (0,2,0,0,28); A2 (0,1,2,0,28); B3 (0,1,1,28,0); A3?best (0,1,0,30,0); B2 (0,0,30,0,0)
Then A3 (0,0,29,2,0) A4 twice (0,0,29,0,4)
then repeats of (B3, followed by chunks of A4) take us to (0,0,0,0,4x[2^29])=(0,0,0,0,2^31)

These are based on an attempt to do a greedy right-first algorithm. It looks as though Terry may have done better than this (comment 40) – but I think the ideas for [1,1,1,1,1] might lead to a higher bound for the 6-case.

Could one look at the simpler problems with less boxes and the same rules? Then try to find a function that from all possible distributions and then obtain an upper bound? For instance if there is one box we are done, we just have the number of coins in the box. For two the best we can do is twice the first box plus the second box. For three I think the upper bound is exponential.

It is looking like some combination of the methods in Comment thread 13 and Comment thread 7 is going to work: it seems that the 13 thread has generated far more than coins in the system, and the 7 thread provides a way to cut the coins back down in size. I think we’re in the home stretch here…

If we evaluate a coin at box 1 as 64 and a coin at box 2 as 32 etc then rule one preserves the value and rule two at most doubles it. So we need to apply rule 2 at least {2010^{2010} times log_2 2010 – log_2 127. This varies by a rounding error. The point is we can only apply rule 2 in slots one through four
so the total number of coins in the history of all states of the problem must total more than this enormous number in the first four slots. Based on this I now think this can be used to prove that the desired number cannot be reached.

As others have observed, once you use the coin in box 1, it’s gone, and you are reduced to a 5-box problem.

So perhaps proceed by induction, adding a one-coin box to the left for each step of the induction?

Break it into three steps “Towers of Hanoi” style:

1) What do you do with boxes 2-5 before you use box 1?

2) Then what do you with box 1?

3) Then what do you do with boxes 2-5 after you use box 1?

(1) and (3) are a reduced problem on 5 boxes so maybe easier to analyze?

To get the biggest “bang for your buck” on step (2) — when you use that precious coin in box 1 — you want the contents of box 3 to be as large as possible and use your coin to pay for a swap. So I think an interesting question is how large you can make box 3 without using box 1… That is, how large can you make box 2 in the reduced “5-box problem”.

And similarly recursively. I think “how big can you make box 2 of the N-box case” is an interesting and relevant question…

If you’ve got enough stuff in box 6, it’s just a matter of littering a couple of coins in slots 3 and 4 to allow you to move the pile of coins from slot 6 to slot 4. Once you’ve done that, you can move as many coins as you like (since our target number is even) and then burn the rest away on idle shuffles.

I think it would be an interesting question to get some idea of what the largest number of coins one can have in the system is. The above argument gives something like , where I am using the Knuth arrow notation. For comparison, is about as discussed in comment thread 13.

What upper bounds are possible? It seems that the argument in Comment 16 is giving a bound that is something like , which is huge. Can we get a bound of tower-exponential type (only two s?)

I also think this is a collect solution. Perhaps the approach used in 31 can give a tower exponential type bound. The idea would be to show that there is an exponential bound on the sum of all coins that
occupy box 4 throughout the history of the problem and then this would give the desired tower exponential bound.

Another possibility for proving that we can’t get 2010^2010^2010 is a parity argument. Perhaps it’s impossible to get a number in that last bucket that is equivalent to 2010^2010^2010 mod q, for some q? This is a fleeting thought – so apologies if it’s patently wrong :).

I think a way of doing this is given in comment 34: if is the number we’re aiming for, then from one can get by two type 1 moves. Furthermore, one can get if one can get for any . And one can get for a massive by using the compound-compound move .

Our solution relies on the fact that is even. Do we have a way of putting coins in the sixth box (with all other boxes empty?)

Regarding upper bounds, I think I can prove by induction on the number of boxes that B2 is always at most 3, and (when B1=1) B_2 is at most 1. Indeed, if we never touch B1, then we are effectively in the 5 box scenario, and B2 can never increase beyond 1. If we ever do touch B1, then just before we do so, by the induction hypothesis, either B2=1 (and so B3 is at most 1), or B2=0 (and so B3 is at most 3). Applying either Rule 1 or Rule 2 to B1 we conclude that B2 becomes at most 3, while B1 gets sent to zero. Any further moves can only serve to decrease B2.

Because of this, we can only apply Rule 1 or Rule 2 to B2 at most 3 times. This should help in giving a good upper bound on how many coins one can generate with six boxes.

It’s interesting to see that we did need all 6 boxes, at least by the given approaches of [n, 0, 0] -> [0, 0, 2^n] and [A, n, 0, 0] -> [A-1, 0, 0, 2^2^n].
If I understood the notation correctly, we can get up to something like and so we need A=6.
So with 6 boxes, we could get A=7 which was enough… but with only 5 boxes, we’d be stuck at A=3 which would be have been too small. Good to know!

I think the ideas at 40 might be combined with the ideas for the 5 case.
What is the highest n for which we can get from [1,1,1,1,1,1] to [0,1,n,?,?,?] ?
Greedy right-first algorithm looks at the 6th position rather than the third, and gets to [0,0,n,0,0,0] with a large n.

[n,0,0] goes to [n-1,2,0];[n-1,0,4];[n-2,4,0] … [0,2^n,0]; [0,0,2*2^n] so f(n)=2*2^n (n>0)
There is a reason for writing it this way.

[n,0,0,0] goes to [n-1,2,0,0] to [n-1,0,2^2,0] to [n-2,2^2,0,0] to [n-2,0,2^2^2,0] and (using ^ for an up-arrow cos I’m still getting LaTex sorted out) this looks like:
[n,0,0,0] goes to [0,2^^n,0,0] goes to [0,0,2^(2^^n),0] goes to [0,0,0,2*2^(2^^n)]
so that in the 4-place-case f(n) = 2*2^(2^^n)
And i think there are associated patterns for [a,b,c,d] etc

Similarly the five place case gives – if my arrow notation is correct f(n)=2*2^(2^^(2^^^n))
Six places is f(n) = 2*2^(2^^(2^^^(2^^^^n)))

Now we can take [2,0,0,0,0,0] to [1,1,1,1,1,2] which gives a greater value than [1,1,1,1,1,1]

So I reckon we have a bound of 2*2^(2^^(2^^^(2^^^^2))) and I think that exploring the patterns for [a], [a,b], [a,b,c] etc might give an exact maximum.

If we generalize this to n boxes each one with one coin in it and the same rules and let f(n) be the maximum number of coins that we can get in the last box. What does f(n) look like? Is it primitive recursive?

I think not, because we can take [1,1,1,1,1, … 1] to [0,3,1,1,1, … 1] and this gives a greater max value in the last place than
[0,3,0,0,0, … 0] for which see 47, which gives a result which I believe is not primitive recursive (subject to checking).

I reckon we have:
[1,1,1,1,1] to [1,1,0,0,7] to [1,0,2,0,7] to [1,0,1,0,14] to [1,0,0,14,0] (pull the 14 left rather than increasing it to 28)
to [0,2,0,14,0] to [0,1,14,0,0] to [0,1,0,2^14,0] to [0,0,2^14,0,0]
to [0,0,0,2^(2^14),0]
to [0,0,0,0,2*2^(2^14)]

[1,1,1,1,1,1] goes to [1,0,0,2^14,0,0]
(nb the 7 is special at the tail – doesn’t quite fit the pattern)
(note 2^14 = 2^(2*7) which brings out the roles of 2 and 7 separately
and 2*2^(2^(2*7)) – two multiplications by 2, two powers
– the powers in between the multiplications in a chiastic structure)

[1,0,0,2^(2*7),0,0] goes to [0,2,0,2^(2*7),0,0]
The 2 in the second place is the source of two operations of the highest kind which appear in the answer.
The zeros at the end give space to repeat the power and multiplication operation in reverse.
This goes to [0,1,2^(2*7),0,0,0]
Which goes to [0,1,0,2^^(2^(2*7)),0,0]
Which goes to [0,0,2^^(2^(2*7)),0,0,0]
Which goes to [0,0,2^^(2^^(2^(2*7)),0,0]

Every extra place to the left adds an extra level of Knuth up-arrows to the maximum outcome of [n,0,0 … ,0] provided that n is at least 2 – this is the function of the second type of move (see 47 above).

BUT with [1,?,?, … ?] there can be advantages in using the first type of move more often, and the numbers in the left-hand places may not create the full value.

This creates constraints on how useful conserved quantities might be computed.

[…] The format of the last year’s mini-polymath project seemed to work well, so I am inclined to simply repeat that format without much modification this time around, in order to collect a consistent set of data about these projects. Thus, the project will start at a pre-arranged time and date, with plenty of advance notice, and be run simultaneously on three different sites: a “research thread” over at the polymath blog for the problem solving process, a “discussion thread” over at this blog for any meta-discussion about the project, and a wiki page at the polymath wiki to record the progress already made at the research thread. (Incidentally, there is a current discussion at the wiki about the logo for that site; please feel free to chip in your opinion on the various proposed icons.) The project will follow the usual polymath rules (as summarised for instance in the 2010 mini-polymath thread). […]