# How many words can be formed, given $4$ letters, and in each word there must be at least two letters are the same?

How many words can be formed, given $4(a,b,c,d)$ letters, and in each word from $4$ letters there must be at least two letters are the same? The position of the letter doesn't matter. The answer is $232,$ I don't know how to "attack" it.

• How long are the words? – almagest May 19 '16 at 20:16
• 4 letters, forgot the add this. – Planet_Earth May 19 '16 at 20:16
• What do you mean "position doesn't matter"? Is "abbc" and "abcb" equal? – Fred Yang May 19 '16 at 20:24
• There are $4^4$ possible words in total. There are $4!=24$ words with no repeats. Hence $256-24=232$ with at least one repeat. – almagest May 19 '16 at 20:25
• @almagest, give this as answer so I can mark it as best. – Planet_Earth May 19 '16 at 20:26

There are $4^4=256$ possible words in total. There are $4!=24$ words with no repeats. Hence $256−24=232$ with at least one repeat.