Arranging colored balls in a line. 2 balls from 5 distinct colors are collected.


*

*In how many ways can the balls be arranged?

*In how many ways can the balls be arranged so that no two balls of the same color are next to one another?


The first is easy.  If I have 10 spots and 10 balls, then I have 10 choices in the first place, 9 in the second, and so on.  This yields $10!$ ways.
The second is somewhat of a curve ball.  I suppose that the answer would be $10! - N $, where $N$ is the number of arrangements with at least one pair of balls next to one another.  I'm not sure how to approach finding $N$ and would like some help.
Thanks

Consider a smaller case, two balls of two colours Red and Blue, we'll denote a red ball with $r$ and a blue ball with $b$. The options are $rrbb, rbrb, rbbr$ and then the same again with $r$ and $b$ flipped round. That means there are 6 ways. You are right, there are 4! ways to arrange the balls, but we have to account for how we could swap the blue balls, and how we could swap the red balls; if we interchange two blue balls, we still have the same arrangement. How many ways are there to arrange each set of coloured balls?
For the second question, if we only have four balls then we have 4 choices for the first ball, but if this is red we have to have a blue ball next (so two choices), this then forces the third ball to be red (so one choice) and the final ball has to be blue (no choice). So we have $4*2*1$ ways to arrange them, and again we account for the fact that we could arrange the blue balls in two ways, and the red balls in two ways, giving us only 2 options - $rbrb, brbr$. With this logic, I believe that the answer to the second part is 12,600 but the formula is for you to work out (I'm not 100% sure of this, the complication is that you have a defined start point, this would be simpler if the colour balls were in a loop).
