There are 17 marbles, so the chance of picking a red one is 8/17 and a green one is 9/17.
As each marble is picked the probability changes as the total number of marbles is reduced and the number of individual colours is reduced.
The chances of the first one being red is 8/17, the second being red is 7/16, the third green is 9/15, 4th green 8/14, 5th green 7/13. Multiply these probabilities together: 8/17*7/16*9/15*8/14*7/13=42/1105. But we have to multiply this by the number of ways of arranging the 5 marbles=120/(2*6)=10 (120 ways of arranging 5 different objects, 2 ways of arranging 2 and 6 ways of arranging 3). That gives us 420/1105=38.01%.
10 ways of picking the marbles:
RRGGG, RGRGG, RGGRG, RGGGR, GRRGG, GRGRG, GRGGR, GGRRG, GGRGR, GGGRR.
Let's suppose that the order was GRGRG. Is the probability the same as RRGGG?
9/17*8/16*8/15*7/14*7/13=42/1105, which is the same as RRGGG and all the other possibilities, so it is valid to multiply by 10 to get the overall probability.