Suppose that A is a set of 8 (distinct) symbols and consider strings (i.e. sequences) over A.
How can I calculate the number of strings of length 5 which at least one symbol occurs two or more times. I started by calculating the total number of strings of length 5 by doing $8^5$ ( since we have 8 choices for each number) and then I subtracted the amount of strings of length 5 that do not have any repetition ($ 8\times 7\times 6\times 5 \times 4$) and I got the wrong answer. I think this is because my logic is wrong. Can someone help me?