How many three-letter words have at least two letters the same?

2.7k Views Asked by At

I know that the answer is $1976$, from $26^3-26\cdot25\cdot24$

However, I had a different way of doing it, which is by saying that the the two letters that are the same have $26$ possibilities, and the remaining letter also has $26$ possibilities, and there are $3$ possible distinct positions of the letters, AAB, BAA, and ABA with A representing the two letters that are the same and B representing the third letter, which leads me to $26^2\cdot3=2028$

My question is, where am I going wrong with my reasoning?

2

There are 2 best solutions below

0
On BEST ANSWER

If the third letter is the same as the two letters that are the same, then there are not $3$ different orderings $AAB$, $ABA$, and $BAA$, but just one: $AAA$

So, for every such case (and clearly there are $26$ cases of $AAA$), you are counting thrice what should be counted just once. Hence, you overcount by $26 \cdot 2 = 52$, which is exactly the difference between $2028$ and $1976$

0
On

You're overcounting words in which all three letters are the same. You count each of these words thrice -- once in the AAB position, once in the ABA, once in the BAA (if A=B, these positions all give the same word!)

To use your method, you need to subtract $2 \cdot 26$ -- $26$ words which are three letters the same, and $2$ because you counted them thrice and you want to count them only once. This gives you $2028 - 2 \cdot 26 = 1976$, matching the answer from the first method.