Combinatorics – Number of 8-Letter Words with Constraints

combinatorics-on-wordscontest-math

A new language is developed such that it has $5$ letters $A ,B, C ,D, E$ where
A, E are called vowels while B, C, D are called consonants . The language has the following rules :a letter cannot be repeated twice in a row (e.g the sequence $BB$ is not allowed) and a vowel cannot be repeated in a row (the sequence $AE$ or $EA$ of letters is not allowed) . Find the number of all possible eight letter words which begin with a consonants.

Background info:

This is a question that came up in the third round of the $2023$ Kenya mathematics Olympiad and the best student could only score $1$ of the possible ten marks in the question. I tried various methods but could only arrive at $20340$ as the solution by listing all possible permutations of consonants and vowels i.e (cvcvcvcv ,cccccccc and so on) and then counted the number of words for each case.I am unsure if this is even the correct answer.

Best Answer

Recurrence approach. Let $c(n)$ be the number of legal words such that the $n$-th letter is a consonant and let $v(n)$ be the number of legal words such that the $n$-th letter is a vowel. Then the following recurrences hold (why?): for any $n\geq 1$, $$\begin{cases} c(n+1)=2\cdot c(n)+3\cdot v(n)\\ v(n+1)=2\cdot c(n)+0\cdot v(n) \end{cases}$$ or in matrix form $$\left[\begin{matrix} c(n+1)\\v(n+1)\\ \end{matrix}\right]=\left[\begin{matrix} 2 & 3\\ 2 & 0\\ \end{matrix}\right]\left[\begin{matrix} c(n)\\v(n)\\ \end{matrix}\right].$$ In our case, starting with a consonant, we have that $c(1)=3$, $v(1)=0$ and therefore $$\begin{array}{r|cc} n&1&2&3&4&5&6&7&8\\ \hline c(n)&3&6&30&96&372&1320&4872&17664\\ \hline v(n)&0&6&12&60&192&744&2640&9744 \end{array}$$ Hence, the total number of 8 letter words is $c(8)+v(8)=17664+9744=\boxed{27408}$.

Related Question