Let $x_1,\ldots,x_n$ be a sequence with each term equal to $0$ or $1$. Form a triangle as follows: its first row is $x_1,\ldots,x_n$ and if a row if $a_1, a_2, \ldots, a_m$, then the next row is $a_1 + a_2, a_2 + a_3, \ldots, a_{m-1} + a_m$ where the addition is performed modulo $2$ (so $1+1=0$). For example, starting from $1$, $0$, $1$, $0$, the second row is $1$, $1$, $1$, the third one is $0$, $0$ and the fourth one is $0$. A sequence is called good it is the same as the sequence formed by taking the last element of each row, starting from the last row (so in the above example, the sequence is $1010$ and the corresponding sequence from last terms is $0010$ and they are not equal in this case). How many possibilities are there for the sequence formed by taking the first element of each row, starting from the last row, which arise from a good sequence?
Problem
Source: Bulgaria EGMO TST 2019 Day 2 Problem 1
Tags: combinatorics, counting, abstract algebra
31.01.2024 23:55
Answer: $2^{\lceil n/2 \rceil}$. Throughout addition is mod $2$. Observe that if $a$, $b$, $c$ are in an equilateral triangle of side length $1$, with $c$ below $a$ and $b$, then $c=a+b$ but then $a=b+c$ and $b=a+c$. So we may use the following tricky observational change of POV by @Marinchoo - rotating the triangle $120^{\circ}$ clockwise and doing the operation starting from the entries of the top row does not change anything! Now we want the left and right side to be identical and by symmetry this holds if and only if the top row is symmetric with respect to its midpoint.
17.06.2024 04:34
Wow, this was unsolved for over an year! I'm not surprised it's just one dumb trick which trivializes the problem. We claim that the answer is $2^{\lceil \frac{n}{2} \rceil}$ - all possible sequences are simply the palindromic binary sequences of length $n$. Just to make all the details clear we shall proceed via induction. We shift the entries to form an isosceles right angle triangle (since then its easier to speak about left-right-up-down entries). For example, the triangle for the given example $1$ , $0$ , $1$ , $0$ would look like, \begin{align*} & 1 0 1 0\\ & 1 1 1\\ & 0 0\\ & 0 \end{align*}Now, we perform the following transformation. Simply rotate the given triangle by an angle of $90^\circ$ to obtain a new right angle triangle. We claim that the rule for obtaining new rows from the starting row, in this new triangle is exactly the same as of the previous triangle. This is quite easy to see due to the property of $\pmod{2}$ that $a-b \equiv a+b \pmod{2}$ for any two integers $a$ and $b$. For example, the newly obtained triangle for the previous triangle would be, \begin{align*} & 0 0 1 1 \\ & 0 1 0\\ & 1 1 \\ & 0 \end{align*}Since previously two adjacent entries $a_1$ and $a_2$ created $b$ in the new row, now after the rotation, $b$ and $a_1$ create $a_2$. But, \[b+a_1 \equiv (a_1+a_2)+a_1 \equiv a_2\]which proves the claim. Now, we are in a position to induct. We first look at the base case of $n=2$, we have 4 cases. \begin{align*} & 1 1 \ \ \ \ \ \ \ \ \ \ 0 0 \ \ \ \ \ \ \ \ \ \ 1 0 \ \ \ \ \ \ \ \ \ \ 0 1 \\ & 0 \ \ \ \ \ \ \ \ \ \ \ 0 \ \ \ \ \ \ \ \ \ \ \ \ \ 1 \ \ \ \ \ \ \ \ \ \ \ 1 \end{align*}Here, it is clear that in the cases where the first row is a palindrome, the list of the left-most entries of each row (from top-to-bottom) is the same as the list of right-most entries of each row (from top-to-bottom), and vice versa. Now, to induct we deal with the two directions separately. First, say the topmost row is a palindromic sequence, then, observe that the second row must also be a palindrome. This is because, if the first row is a palindrome, $x_i \equiv x_{(n+1)-i}$. Then, \[x_i+x_{i+1} \equiv x_{(n+1)-i} + x_{n-i}\]So the next row is also a palindrome (the only case where such a matching does not exist is when $n$ is even, for the middle pair but then since $n-1$ is even and this pair adds to the middle entry of the next row we are fine). Thus, the second row is a palindrome as well. Applying the inductive hypothesis, it follows that the list of the left-most entries of each row (from top-to-bottom) is the same as the list of right-most entries of each row (from top-to-bottom) in the second to last rows, and it trivially follows that the list of the left-most entries of each row (from top-to-bottom) is the same as the list of right-most entries of each row (from top-to-bottom) for the entire triangle since the first and last entries of the first row are the same (according to our assumption that the first row is a palindrome). Thus, one direction is proved. The other direction is also basically the same. Say the list of the left-most entries of each row (from top-to-bottom) is the same as the list of right-most entries of each row (from top-to-bottom) in this triangle. Thus, the list of the left-most entries of each row (from top-to-bottom) is the same as the list of right-most entries of each row (from top-to-bottom) of the bottom $n-1$ rows is the same. By the Inductive Hypothesis, it follows that the second row is a palindrome. Now, since we have that the first and last entries of the first row are the same, recovering the first row from the second row yields a palindrome. To see exactly why, say we have $x_i = x_{(n+1)-i}$ for some positive integer $i$. Then, say the $n-1$ row has entries $y_1,y_2,\dots, y_{n-1}$ with $y_i = y_{n-i}$ for all $i$. Then, \[x_{i+1}= y_i - x_i = y_{n-i}+y_{(n+1)-i} = x_{(n+1)-i-1}\]which proves the desired result. Thus, the first row must indeed be a palindrome, finishing the other direction as well. Thus, he sequence formed by taking the first element of each row, starting from the last row, which arise from a good sequence must always be a palindrome of length $n$, whose number is quite clearly the desired quantity.
17.06.2024 07:26
Seems to be the same as Romania TST 2013/5/3