HMMT-Nov 2017 guts, Problem 4

Alec wishes to construct a string of 6 letters using the letters A, C, G, and N, such that: \begin{itemize} The first three letters are pairwise distinct, and so are the last three letters; The first, second, fourth, and fifth letters are pairwise distinct. \end{itemize} In how many ways can he construct the string?

Solution: There are $4 !=24$ ways to decide the first, second, fourth, and fifth letters because these letters can be selected sequentially without replacement from the four possible letters. Once these four letters are selected, there are 2 ways to select the third letter because two distinct letters have already been selected for the first and second letters, leaving two possibilities. The same analysis applies to the sixth letter. Thus, there are $24 \cdot 2^{2}=96$ total ways to construct the string. $\fbox{96}$.

Answer: 96