A word of length $n$ is an ordered sequence $x_1x_2\ldots x_n$ where $x_i$ is a letter from the set $\{ a,b,c \}$. Denote by $A_n$ the set of words of length $n$ which do not contain any block $x_ix_{i+1}, i=1,2,\ldots ,n-1,$ of the form $aa$ or $bb$ and by $B_n$ the set of words of length $n$ in which none of the subsequences $x_ix_{i+1}x_{i+2}, i=1,2,\ldots n-2,$ contains all the letters $a,b,c$. Prove that $|B_{n+1}|=3|A_n|$. Vasile Pop
Problem
Source: Romanian TST 1998
Tags: function, symmetry, combinatorics proposed, combinatorics
24.04.2011 00:33
Let $a_n$ the set of words of length $n$ such that it contains blocks of the form $aa$ , $bb$. Similarly, we define $b_n$ for the words who contain blocks with $\{a,b,c\}$ (in any permutation). Now, we just have to prove that $|b_{n+1}|=3|a_n|$. To do that, we are going to construct a function between the 2 sets. First let´s take an element $X$ of $a_n$ , and take the first block of $aa$ or $bb$ locking from left to right. We´re going to change that block acording to the next rule: if we have a block $aa$ we erase it and we write any element of the subset $\{abc,bca,cab\}$; if we have a block $bb$ we erase it and we write any element of the subset $\{acb,cba,bac\}$. The new word belong to $b_{n+1}$. Analogously, we take an element of $b_{n+1}$ and do the same, just taking the first block of $\{a,b,c\}$ (in any permutation). At the end, we obtain a word of $a_n$. The function defined before allow us to see easily the identity that we want to prove. I hope I explain myself
22.12.2012 18:23
Wew, strange that this problem also appeared as IMC 2003/2005 shortlist (i dont remember)
23.12.2012 04:41
No tricky bijections needed, one can just count. Let $\alpha_x(n)$ be the number of words in $A_n$ that end in an $x$. By symmetry, $\alpha_b = \alpha_a$, so we'll just use $\alpha_a$ and $\alpha_c$. We have: \begin{align*} \alpha_a(1) & = 1 \\ \alpha_c(1) & = 1 \\ \alpha_a(n+1) & = \alpha_a(n) + \alpha_c(n) \qquad\mbox{(we can append a after b or c)} \\ \alpha_c(n+1) & = 2\alpha_a(n) + \alpha_c(n) \qquad\mbox{(we can append c after any character)} \\ \end{align*}Similarly, let $\beta_{xy}(n)$ be the number of words in $B_n$ that end in $xy$. By symmetry, all $\beta_{xx}$ are equal, and all $\beta_{xy}$ for $x\not=y$ are equal, so we'll just use $\beta_{aa}$ and $\beta_{ab}$. We have: \begin{align*} \beta_{aa}(2) & = 1 \\ \beta_{ab}(2) & = 1 \\ \beta_{aa}(n+1) & = \beta_{aa}(n) + 2\beta_{ab}(n) \qquad\mbox{(we can get aa by appending a after aa, ba, or ca)} \\ \beta_{ab}(n+1) & = \beta_{aa}(n) + \beta_{ab}(n) \qquad\mbox{(we can get ab by appending b after aa or ba)} \\ \end{align*}Now obviously $\forall n\geq 1: \beta_{aa}(n+1)=\alpha_c(n) \land \beta_{ab}(n+1)=\alpha_a(n)$. To conclude the proof, $|A_n|=2\alpha_a(n) + \alpha_b(n)$ and $|B_{n+1}|=6\beta_{ab}(n+1)+3\beta_{aa}(n+1)$.