[Math] Five-letter words from A-Z with constraints

combinationscombinatoricsdiscrete mathematics

Find the number of five-letter words that use letters from the alphabet $\{A, B, . . . , Z\}$ in which every sequence of three consecutive letters includes three different letters.

First, what does the sentence "in which every sequence of three consecutive letters includes three different letters" mean?

Second, how can I solve this question?

Best Answer

"in which every sequence of three consecutive letters includes three different letters" means, that in word $a_1a_2a_3a_4a_5$ we have:

  • $a_1, a_2$ and $a_3$ are three different characters
  • $a_2, a_3$ and $a_4$ are three different characters
  • $a_3, a_4$ and $a_5$ are three different characters

For example words XDMNG, PRSTP ABCAW are ok (these satisfies all three conditions), but words ABACD, XYZYA, UMBGB, ABWWX are not ok.

HINT

  • $a_1$ can be chosen in any way
  • $a_2$ is different from $a_1$
  • $a_3$ is different from $a_1$ and $a_2$
  • $a_4$ is different from $a_2$ and $a_3$
  • $a_5$ is different from $a_3$ and $a_4$