Case 1: No white balls are chosen.
Suppose for each choice we line up the balls in a row left to right
with the blue ones, if any, on the far left, the red ones, if any,
in the middle, and the green ones, if any, on the far right. Here's
a sample:
oooooooooooooooooooooooooooooo
Now suppose we insert three "dividers" or "indicators" B, G, and R,
with the B on the far left, before the blue balls, the R just before the
red balls, and the G just before the green balls, like this for the
particular situation above:
BoooooooooooooRoooooooooGoooooooo
All the balls between the B and the R, if any, are blue.
All the balls between the R and the G, if any, are red.
All the balls to the right of the G, if any, are green.
That's a row of 33 things. Notice that while the B is always on
the far left, the R and G can be inserted in any of the remaining
32 places. So the number of choices in case 1 is 32C2=496
To illustrate some extreme choices, in case you aren't sure:
All blue:
BooooooooooooooooooooooooooooooRG
All red:
BRooooooooooooooooooooooooooooooG
All green:
BRGoooooooooooooooooooooooooooooo
Some blue, some red, no green:
BooooooRooooooooooooooooooooooooG
Some red, some, green, no blue:
BRooooooooooooGoooooooooooooooooo
Some blue, some green, no red:
BoooooooooRGooooooooooooooooooooo
So the number of choices for case 1 is 32C2=496,
the number of way to pick two places for the
R and the G among the 32, with R left of G
Case 2: There is one white ball.
we place the 1 white ball left of the B,
oBoooooooooooooRoooooooooGooooooo
then the reasoning is exactly the same with only
31C2=465 places to insert the R and G.
Case 3: There are two white balls.
we place the 2 white balls left of the B,
ooBooooooooooooRoooooooooGooooooo
then the reasoning is exactly the same with only
30C2=435 places to insert the R and G.
Grand total: 32C2+31C2+30C2 = 496+465+435 = 1396
Edwin