Maths Olympiad Prep

Library / /69 of 94

Combinatorics Difficulty 6.6 National Olympiad Prove it Hong Kong

Let nn be a positive integer. Determine the number of sequences x1,x2,,x2n1,x2nx_1, x_2, \dots, x_{2n-1}, x_{2n}, with xi=1x_i = 1 or 1-1, and such that i=2k12mxi2\left|\sum_{i=2k-1}^{2m} x_i\right| \le 2 for all integers k,mk, m, with 1kmn1 \le k \le m \le n.

Solution

The answer is 23n2n2 \cdot 3^n - 2^n.
Let yj=x2j1+x2jy_j = x_{2j-1} + x_{2j} for j=1,2,,nj = 1, 2, \dots, n. Every desired sequence {xj}\{x_j\} corresponds to a sequence {yj}\{y_j\} such that yj=2,0,2y_j = -2, 0, 2 for each jj, and yk+yk+1++ym2|y_k + y_{k+1} + \dots + y_m| \le 2 for any 1kmn1 \le k \le m \le n. Suppose there are rr terms of {yj}\{y_j\} which are nonzero, say yi1,yi2,,yiry_{i_1}, y_{i_2}, \dots, y_{i_r} where i1<i2<<iri_1 < i_2 < \dots < i_r. Since
yi1+yi1+1++yi2=yi1+yi22, |y_{i_1} + y_{i_1+1} + \dots + y_{i_2}| = |y_{i_1} + y_{i_2}| \le 2,
we must have yi2=yi1y_{i_2} = -y_{i_1}. Similarly, yi3=yi2=yi1y_{i_3} = -y_{i_2} = y_{i_1}, and inductively yi2j1=yi1y_{i_{2j-1}} = y_{i_1} and yi2j=yi1y_{i_{2j}} = -y_{i_1} for any integer jj. In other words, the sequence {yj}\{y_j\} only depends on the indices i1,i2,,iri_1, i_2, \dots, i_r and the term yi1y_{i_1}.
Conversely, for any such sequence {yj}\{y_j\}, consider any 1kmn1 \le k \le m \le n. Let isi_s be the smallest index such that kisk \le i_s, and let iti_t be the largest index such that itmi_t \le m. Then
yk+yk+1++ym=yis+yis+1++yit=±(22+22+)=2,0,2. y_k + y_{k+1} + \dots + y_m = y_{i_s} + y_{i_{s+1}} + \dots + y_{i_t} = \pm(2 - 2 + 2 - 2 + \dots) = -2, 0, 2.
So the condition is satisfied.
Now, for each sequence {yj}\{y_j\} satisfying the condition, we can construct the sequence {xj}\{x_j\} as follows. For any index jj of the form iui_u, the terms x2j1x_{2j-1} and x2jx_{2j} are uniquely determined. Indeed, if yiu=±2y_{i_u} = \pm 2, then x2iu1=x2iu=±1x_{2i_u-1} = x_{2i_u} = \pm 1. For any other index jj, there are two choices for x2j1x_{2j-1} and x2jx_{2j}, since exactly one of them is 1 and the other is -1. Since there are (nr)\binom{n}{r} ways to choose the indices i1,i2,,iri_1, i_2, \dots, i_r and two ways to choose yi1y_{i_1} if r1r \ge 1, the total number of sequences is
(n0)2n+r=1n2(nr)2nr=2n+2r=1n(nnr)2nr=2n+2d=0n1(nd)2d \binom{n}{0}2^n + \sum_{r=1}^{n} 2\binom{n}{r} \cdot 2^{n-r} = 2^n + 2\sum_{r=1}^{n} \binom{n}{n-r} 2^{n-r} = 2^n + 2\sum_{d=0}^{n-1} \binom{n}{d} 2^d
using the change of variable d=nrd = n-r. By the binomial theorem, this is equal to
2n+2d=0n(nd)2d2n+1=2n+2(2+1)n2n+1=23n2n. 2^n + 2 \sum_{d=0}^{n} \binom{n}{d} 2^d - 2^{n+1} = 2^n + 2(2+1)^n - 2^{n+1} = 2 \cdot 3^n - 2^n.

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.