How many words can we build using exactly 5 A's, 5 B's and 5 C's if the first 5 letters cannot be A's, the second 5 letters cannot be B's and the third 5 letters cannot be C's?
Can anyone help me? I have been trying many ways of doing this, all to no avail.
This is a good exercise in the Inclusion-Exclusion principle. I'll give you a hint.
Let's try to count in a generic way the number of strings with 1A, 1B, 1C if the first letter is not A, and the second is not B and the third is not C.
You need
xxx - Axx - xBx + ABx - xxC + AxC + xBC - ABCNote that strings with 2 unknowns like
Axxhave 2! choices, with onex-- only 1!, so we get$$3! - 2! - 2! + 1! - 2! + 1! + 1! -1 = 6-2-2+1-2+1+1-1=2,$$
which is obviously correct (in our simple case, they are
BCAandCAB).Can you extend this to your case? Try with 2 letters first, it will be simpler to extend to 3 and then to 5 then.