There are 2 identical white balls, 3 identical red coloured balls and 4 green balls of different shades. Find the number of ways in which the balls can be arranged so that no two balls of the same colour appear together.
My attempt at the solution : Total ways of arranging balls without restriction = $\frac{9!}{2!3!}$. Total ways in which balls can be arranged so that all same coloured balls are together = $6!$. Therefore, the number of ways so that at least one ball of same colour is separated = $\frac{9!}{2!3!}$ - $6!$.
Where have I gone wrong?
As @NL628 stated, the error you made is that you subtracted the number of ways in which all same coloured balls are together from the total number of permutations rather than the number of arrangements in which at least two balls of the same colour are together.
You correctly calculated the total number of arrangements.
To count arrangements in which at least two balls of the same colour are together, we can use the Inclusion-Exclusion Principle.
A pair of balls of the same colour are together: This can occur in two ways.
Two white balls are adjacent: We have eight objects to arrange: $G_1$, $G_2$, $G_3$, $G_4$, $R$, $R$, $R$, $WW$, where $G_k$ denotes the $k$th shade of green. We choose three of the eight positions for the red balls. The remaining five distinct objects can be placed in the remaining five positions in $5!$ orders. Hence, the number of such arrangements is
Two of the red balls are adjacent: We again have eight objects to arrange: $G_1$, $G_2$, $G_3$, $G_4$, $RR$, $R$, $W$, and $W$. We choose two of the eight positions for the two white balls. The remaining six distinct objects can be placed in the remaining six positions in $6!$ ways. Hence, the number of such arrangements is
Two pairs of balls of the same colour are together: This can also occur in two ways.
Two disjoint pairs of adjacent balls of the same colour: We have seven objects to arrange: $G_1$, $G_2$, $G_3$, $G_4$, $RR$, $R$, $WW$. Each of the objects are distinct, so they can be arranged in
ways.
Two overlapping pairs of adjacent balls of the same colour: We again have seven objects to arrange: $G_1$, $G_2$, $G_3$, $G_4$, $RRR$, $W$, $W$. We select two of the seven positions for the white balls, then place the remaining five objects in the remaining five positions in $5!$ ways. Hence, there are
such arrangements.
Three pairs of adjacent balls of the same colour: This means the two white balls are adjacent and the three red balls are adjacent. Hence, we have six objects to arrange: $G_1$, $G_2$, $G_3$, $G_4$, $RRR$, $WW$. Since they are distinct, they can be arranged in
ways.
By the Inclusion-Exclusion Principle, the number of arrangements in which there are at least two balls are of the same colour are adjacent is
If you subtract this quantity from the total number of arrangements, you will find the number of arrangements in which no two balls of the same colour are together.