This question already has an answer here:
- Number of possible permutations of n1 1's, n2 2's, n3 3's, n4 4's such that no two adjacent elements are same? 2 answers
- Permutation with no adjacent elements. 1 answer
- In how many ways can $3$ red, $3$ blue, and $3$ green balls be arranged so that no two balls of the same colour are consecutive (up to symmetry)? 3 answers
The problem involves arranging balls of different color in a line such that no two balls of the same color are adjacent to each other. Eventually I would like to find a generalization of having $m$ different colors of balls and $n$ balls of each color, where each ball besides color are indistinguishable. But for now I will start with $3$ colors, red blue and yellow, and having $3$ of each color.
If we had an infinite number of each ball, then i know the answer would be $3(2^8)$ but this is including arrangements where we might only have red and blue balls alternating and not have any yellows.
One thought was to consider "grouping" the colors in its $3!$ permutations and finding the number of arrangements of the groups. But this wouldn't consider arrangements such as $RYRYBYBRB$
I feel like recurrence may be needed for a generalization but without being able to find this simple case I don't know if I can use it. Searching other questions of this sort doesn't help me either as it isn't this type of restriction.
Brute forcing it is one option but it seems like a mess even for this smaller case, so it would only be good for smaller cases.
Any help would be greatly appreciated