Combinatorics question regarding arranging $13$ balls in a line but with a condition that on neither of the sides have a blue ball. I have $13$ balls. $6$ red , $4$ blue , $3$ yellow. I want to arrange in a line such that the right side and the left side do not have blue balls. ( balls in the same color are not distinct ).
I tried to calculate the options without any terms or conditions which is 13! divided by $6!4!3!$. ( ! is factorial )
and then subtract the options that contain having blue ball on the right side and the left side which is : ($4$ choose $2$ for the blue balls on each side) multiply by ( $11!$ divided by $(6!2!3!)$ which are the remaining $11$ balls left).
but I'm not getting the right answer. What am I doing wrong in the process?
 A: You may find $\binom{11}4\binom96 = 27720\;$ the simplest solution.
[First place the blues in the $11$ permissible spaces for them, and (say) the reds next in the $9$ spaces now remaining. Yellows will automatically fill up the rest]
A: You write:

and then subtract the options that contain having blue ball on the right side and the left side

But what you need is to subtract off the number of arrangements that have a blue ball on the left or right side.
You multiply by $\binom{4}{2}$, I guess to pick which blue balls go on the side? But you don't need this factor since they're indistinguishable. As soon as you say B goes on the left side, all you need is to specify the other 12 balls.
Instead I would break it into 3 steps:

*

*Find the number of arrangements where B is on the left

*Find the number of arrangements where B is on the right

*Subtract the number of arrangements where B is on both sides, to avoid double counting

A: Blue balls are identical so 4c2 is not needed . The cases should be in the order
(i) Only blue on left and not on right
(total case where blue is on left - case where blue on both left and right)
(ii) Only blue on right and not on left
(total case where blue is on right - case where blue on both left and right)
(iii) Blue on both left and right .
Try calculating it
Hope this helped
