There are 4 ways of picking 3 different colours out of a possible 4: BGR, BGY, BRY and GRY, where the initial letters of the colours have been used. Each of these can be picked in 6 different ways, because there are 6 possible permutations for three different objects. There are 12 balls in all and if they were all different colours there would be 12! permutations, where 12! means 12*11*10*...*2*1. However, there are 5 red balls, 4 green, 2 blue and one yellow. We need to divide 12! by 5!*4!*2! because we lose all but one of the permutations of the multiplicity of all but the yellow ball. When we do the division we get 83,160 permutations, because we don't distinguish between two balls of the same colour.

For the next step we work out probabilities and the apply them to 83,160 permutations.

Let's start with BGR. The probability of selecting the balls in this order is 2/12*4/11*5/10, and there are 6 permutations of these colours: BGR, BRG, GBR, GRB, RBG and RGB. No matter what order the same probability applies. So the overall probability is 6 times the individual probability for each permutation.

When we work out the overall probability for the colours BGY we get 6*2/12*4/11*1/10=2/55.

For the remaining colour combinations we have the probabilities: BRY 1/22; GRY 1/11.

Now we add up all the probabilities: 2/11+2/55+1/22+1/11=39/110. We multiply this by 83,160 to find how many ways this is equivalent to, and we get 39/110*83160=29,484 out of the possible 83,160.