Numerical answer
A string of length is formed using the letters , , such that it begins with , no two adjacent letters are the same, and all three letters occur at least once. The number of such strings is ______.
Show answer and solution
Answer: 62
Strings of length starting with with no two adjacent letters equal: each of the remaining positions has exactly choices (any letter except the previous one), giving strings. Now remove those in which a letter is missing. The letter is present at the start, so the missing letter is or . If is missing, the string must alternate , which is exactly string. Likewise if is missing, only works. These two cases cannot overlap, because a string using only cannot satisfy the adjacency rule. Therefore the required count is . A computer enumeration of all strings confirms .
Saved on this device. Sign in or create a free account to keep it on every device.