Maths Olympiad Prep

Library / /10 of 17

Combinatorics Difficulty 7.6 National Olympiad, round 2 Prove it Balkan Mathematical Olympiad

A sequence of 2n+12n + 1 non-negative integers a1,a2,,a2n+1a_1, a_2, \dots, a_{2n+1} is given. There's also a sequence of 2n+12n + 1 consecutive cells enumerated from 11 to 2n+12n + 1 from left to right, such that initially the number aia_i is written on the ii-th cell, for i=1,2,,2n+1i = 1, 2, \dots, 2n + 1. Starting from this initial position, we repeat the following sequence of steps, as long as it's possible:
Step 1: Add up the numbers written on all the cells, denote the sum as ss.
Step 2: If ss is equal to 00 or if it is larger than the current number of cells, the process terminates. Otherwise, remove the ss-th cell, and shift all cells that are to the right of it one position to the left. Then go to Step 1.
Example: (1,0,1,2,0)(1,0,1,0)(1,1,0)(1,0)(0)(1, 0, 1, \underline{2}, 0) \to (1, \underline{0}, 1, 0) \to (1, \underline{1}, 0) \to (\underline{1}, 0) \to (0).
A sequence a1,a2,,a2n+1a_1, a_2, \dots, a_{2n+1} of non-negative integers is called balanced, if at the end of this process there's exactly one cell left, and it's the cell that was initially enumerated by (n+1)(n+1), i.e. the cell that was initially in the middle.
Find the total number of balanced sequences as a function of nn.

Solution

The answer is: CnCnC_n \cdot C_n, where Cn=(2nn)C_n = \binom{2n}{n} is the nn-th Catalan number.

We divide the proof into several steps. First, some terminology: the last (rightmost) nn cells will be called the back cells and the front (leftmost) nn cells will be called the front cells. The central, (n+1)(n+1)-st, cell will be called the middle cell.

Claim 1. All the back cells must be removed before any front cell is removed.
Proof. Assume for contradiction that this is not the case. Then there must be a point in time where a front cell is deleted and then immediately after a back cell is deleted. Let us say that the deleted front cell was at position ii. So all back cells have positions greater or equal to i+2i+2. After the cell is deleted all back cells have positions greater or equal to i+1i+1. But since we deleted cell ii, then the total sum is ii and this does not increase. So at the next step we delete a cell at position at most ii, a contradiction. \square

Claim 2. The middle cell must contain the number 00, i.e., an+1=0a_{n+1} = 0.
Proof. Consider the last step in the process where we have total of 22 cells. One of these is the middle cell, and by Claim 1 the other must be one of the front cells. I.e. we have (x,an+1)(x, a_{n+1}). On the next move, we remove xx, which means that x+an+1=1x + a_{n+1} = 1. So an+1=0a_{n+1} = 0 or an+1=1a_{n+1} = 1. But after that we cannot remove an+1a_{n+1}, which means that an+11a_{n+1} \neq 1. So an+1=0a_{n+1} = 0. \square

Now, let's define a self-destructing sequence to be one with no surviving cells at the end of the process. For example, (0,1,2)(0, 1, 2) is self-destructing because (0,1,2)(0,1)(1)()(0, 1, 2) \to (0, 1) \to (1) \to (). Let SnS_n be the set of self-destructing sequences of length nn. For example, S2={(0,1),(1,1)}S_2 = \{(0, 1), (1, 1)\}. It is clear that the front cells form a self-destructing sequence, i.e., (a1,a2,,an)Sn(a_1, a_2, \dots, a_n) \in S_n. The back cells also have certain self-destructing quality, which is made more precise in Claim 3 below.

Claim 3. Fix the front sequence φ=(a1,a2,,an)\varphi = (a_1, a_2, \dots, a_n). Let BφB_\varphi be the set of all possible back sequences of length nn that can be appended to φ\varphi (with a 00 between them) to get a balanced sequence. Then there is a bijection f:SnBφf: S_n \to B_\varphi.
Proof. Let c=n+1i=1naic = n + 1 - \sum_{i=1}^n a_i and consider a particular σ=(s1,s2,,sn)Sn\sigma = (s_1, s_2, \dots, s_n) \in S_n. Let \ell be the initial index of the last surviving cell in σ\sigma. Then f(σ)=(s1,s2,,s+c,s+1,,sn)f(\sigma) = (s_1, s_2, \dots, s_\ell + c, s_{\ell+1}, \dots, s_n) defines a bijection SnBφS_n \to B_\varphi.

Indeed we claim that the kk-th deleted cell in σ\sigma is the kk-th deleted cell in φ 0f(σ)\overline{\varphi\ 0f(\sigma)} for each k=1,,nk=1, \dots, n. Indeed after some deletions let SS be the total sum remaining in σ\sigma. Then the total sum remaining in φ 0f(σ)\overline{\varphi\ 0f(\sigma)} is i=1nai+0+S+c=S+n+1-\sum_{i=1}^n a_i + 0 + S + c = S + n + 1. So we delete next the cell in position SS in σ\sigma if and only if we delete the cell in position S+n+1S+n+1 in φ 0f(σ)\overline{\varphi\ 0f(\sigma)}.

So φ 0f(σ)\overline{\varphi\ 0f(\sigma)} is clearly a balanced sequence: we first eliminate all cells in the back, then the front. In the same manner it follows that every balanced sequence is of this form. \square

So far we have shown that the total number of balanced sequences is Sn2|S_n|^2. It remains to calculate the size Sn|S_n|.

Claim 4. Let Tn\mathcal{T}_n be the set of 2n2n-sequences consisting of nn zeros and nn ones such that in each initial segment the number of 11's does not surpass the number of 00's. Then Sn=Tn|S_n| = |\mathcal{T}_n|.
Proof. Let [n]={1,2,,n}[n] = \{1, 2, \dots, n\}, and let us also consider the set Fn\mathcal{F}_n of non-decreasing mappings f:[n][n]f: [n] \to [n] such that f(i)if(i) \le i for each i[n]i \in [n]. The claim will follow once we show that Sn=Fn|S_n| = |\mathcal{F}_n| and that Fn=Tn|\mathcal{F}_n| = |\mathcal{T}_n|.

In order to demonstrate that Sn=Fn|S_n| = |\mathcal{F}_n|, observe that there is an obvious bijective correspondence afa \mapsto f between the sets SnS_n and Fn\mathcal{F}_n. Indeed, reversing the self-destructing process for an nn-sequence a=(a1,a2,,an)Sna = (a_1, a_2, \dots, a_n) \in S_n, simply define f(i)f(i) to be the (partial) sum of the existing terms after the ii-th backward step.

As for Tn=Fn|\mathcal{T}_n| = |\mathcal{F}_n|, note the following bijective correspondence tft \mapsto f between the sets Tn\mathcal{T}_n and Fn\mathcal{F}_n. Let f(i)f(i) equal 1+#(i)1 + \#(i), where #(i)\#(i) is defined to be the total number of 11's appearing in tt before the ii-th zero.

Finally, it is a known fact that Bn|\mathcal{B}_n| is the nn-th Catalan number Cn=1n+1(2nn)C_n = \frac{1}{n+1} \binom{2n}{n}. (The essential idea of the textbook proof of this fact uses the so-called reflection principle of A. D. André.)

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.