What is the number of ways in which I can select 17 balls from an urn containing 30 balls?

I have an urn that contains 30 balls with 10 coloured white, 10 coloured black and the remaining coloured red. Each ball is numbered, from 1 to 10: that is I have red balls numbered 1 to 10, black balls numbered 1 to 10 and white balls numbered 1 to 10. In how many ways can I select 17 balls such that I select a minimum of 4 red balls, 4 black balls and 4 white balls?

I need the quickest method to find the above out. There are long methods of solving it where I find the number of scenarios that violate the condition, such as those scenarios with 3 red balls or no black balls; these I subtract from the total number of ways of choosing 17 balls from the urn.

But is there a quicker way to solve this question?

(EDIT: All balls are now numbered. Please accept my apologies.)

(I will say this: The above problem is not a home-work problem from school.)

• Now, take this with a grain of salt because I'm not an expert in combinatorics (thus this is but a comment and not an answer), but if you originally have $\binom{30}{17}$ and then you take out the $4$ red, black and white balls, then don't you simplify to $\binom{18}{5}$? Jun 21 '18 at 5:06
• @JosephEck No, it doesn't work See my comment on Tamojit Maiti's answer. Jun 21 '18 at 5:14
• Do you care which white balls you select, or only how many? It sounds like you want just the number of compositions of $17$ into three parts of at least $4$. Jun 21 '18 at 5:14
• @RossMillikan you’re right. Let me change the question a little. Jun 21 '18 at 5:21

There are 21 composition of 17:

$17 = 4+4+9 , 17 = 4+5+8, .... , 17=9+4+4$

However, some of have the same structure are equivalent and we may take 3 or 6 of them at a time:

$3 \binom{10}{4} \binom{10}{4} \binom{10}{9} + 3 \binom{10}{5} \binom{10}{5} \binom{10}{7} + 3 \binom{10}{6} \binom{10}{6} \binom{10}{5} + 6 \binom{10}{4} \binom{10}{5} \binom{10}{8} + 6 \binom{10}{4} \binom{10}{6} \binom{10}{7}$

You can select 4 red balls from 10 white balls in $10\choose4$ ways. Similarly, for white and black balls.

So, we can select 4 red, 4 black and 4 white balls in ${{10}\choose {4}}* {{10}\choose {4}}*{{10}\choose {4}}$ ways.

We now have $5$ balls to select, from $30-12=18$ balls. This can be done in $18\choose5$ ways.

The answer thus becomes ${{10}\choose {4}}* {{10}\choose {4}}*{{10}\choose {4}} *{{18\choose5}}$ ways.

• There's double counting here. Suppose you select 5 red balls $a,b,c,d,e.$ You are counting the case where the first $4$ balls selected are $a,,b,c,d$ and the fifth $e$ and also the case where there first four are $b,c,d,e$ and the fifth $a,$ and so on, so this case is counted $5$ times. Jun 21 '18 at 5:13
• But all balls are identical, right? Jun 21 '18 at 5:15
• If the balls are indistinguishable, then you shouldn't be counting things like $\binom{10}{4}$ at all. That only makes sense if we care which $4$ red balls we select. Jun 21 '18 at 5:23

If the balls are identical you want the number of compositions of $17$ from three parts with each part being at least $4$ and at most $10$. In this case you can subtract $3$ from each number and ask the number of strong compositions of $8$ from three parts of at most $7$ and we note that the upper limit is no problem. You can use stars and bars to put the eight stars in a row and choose two of the seven gaps to change colors. You have $7 \choose 2$ ways to pick the balls.

• For the updated question, see nbegginer's answer Jun 21 '18 at 13:44