TITLE: Combinatorics - letters forbidden sequence.
QUESTION [5 upvotes]: I am trying to solve a question. I have 15 pens, where 5 are colored in Red, 5 in Green, and 5 in Blue. How many combinations can I order these pens so that there is no sequence of 5 pens with the same color? For instance, the combination RRRRG GGGBB BBRGB is okay because there is no sequence of pens where 5 colors are after each other. The combination RRRRR ... would need to be excluded because 5 red pens are in a row.
My initial strategy was to count the total number of combinations to build with these pens and then subtract the total number of combinations where at least 5 colors are in sequence.
The total number of combinations:
$$\frac{15!}{(5!*5!*5!)} = 756756$$
The issue I am having is how to create all the combinations where 5 colored pens are in order. I have tried to do something like this:
Group the sequence RRRRR into one symbol. Now, calculate every combination with this RRRRR symbol and the other symbols.
$$\frac{11!}{5!*5!}=2772$$
The problem here is that if I multiplied this with 3 to get the combinations from every color, there would be many duplicated combinations.
Any help on how I could solve this is much apprecited.

REPLY [3 votes]: You are very close to the correct solution. The  metod of choice for solving such problems is the principle of inclusion and exclusion. Applying it to the problem and taking into account the symmetry between the colors one obtains:
$$
\binom30\frac{15!}{5!5!5!}-\binom31\frac{11!}{5!5!1!}+\binom32\frac{7!}{5!1!1!}-\binom33\frac{3!}{1!1!1!}=748560.
$$