# Homework Help: Probability Problem

1. Nov 6, 2013

### Mentallic

Ok, considering I managed to accidentally press enter and submit this thread before even writing the title, this has to do with probability.

Mod note: I added a title... Not very informative, but it's a title.

1. The problem statement, all variables and given/known data
I have 3 buckets of tennis balls, and each bucket has red, green and blue balls . If I pick out 4 balls from random buckets, what is the probability that I'll have at least 2 red balls and 1 green ball?

3. The attempt at a solution
I'm so terrible at probability that it's not even funny... So this is my crude guess:

The probability of picking a red, then red, then green is 1/3^3, but we can pick these colours in any order, and there are 3C2 ways of picking them, but we also pick out a 4th ball, so there are 4C3 ways of arranging the 3 balls we need to pick out. So my guess is that we have a probability of

$$P = \frac{3C2\cdot4C3}{3^3} = \frac{12}{27}$$

I'd be amazed if this were correct though, so if any of you may, please let me know where I've gone wrong.

Last edited by a moderator: Nov 6, 2013
2. Nov 7, 2013

### Ibix

The problem isn't very clearly stated. Is that a direct quote? I'm interpreting it as:

You have a bucket with red balls, a bucket with green balls and a bucket with blue balls. There are four or more balls in each bucket. You draw four balls, choosing a bucket at random each time. What is the probability that you have at least two red balls and at least one green ball?

Am I right?

Probability problems like this are all about counting. The question is just: how many ways are there to pick four balls that include two reds and a green, divided by the number of ways to pick four balls.

Ignoring ordering, what are the combinations of colours that include rrg? Can you calculate the number of orderings for each one?

3. Nov 7, 2013

### Dick

You could either have 2 red, 1 green and 1 blue or 3 red, 1 green and no blue. Those are the only possibilities and they are mutually exclusive. Can you count the probability for each separately?

4. Nov 7, 2013

### Mentallic

Yes, that's the correct interpretation. It isn't a homework problem, but rather an analogy of my actual problem.

I'm not exactly sure what you mean in the bolded section. Are you asking how many possible ways we can have rrg out of the 4 balls we pick up, but while ignoring order? I'm not exactly sure...

We could also have 2 red and 2 green. Essentially we need RRG but the last can be either of RGB.

So for 3R and 1G, we have a 1/3^4 chance of getting those exact colours in a specific order, but since we don't need order, we can arrange those in 4C3 ways, so we have P=4/81 for that case.
For 2R, 2G, we again have a 1/3^4 chance of getting those colours, with 4C2 ways of ordering them, so P=6/81=2/27.
Finally, 2R, 1G, 1B, umm... the number of ways to order this case is beyond me.

5. Nov 7, 2013

### Ibix

Paint a 1 on one of your red balls and a 2 on the other. How many ways are there to order them now? Erase the 1 and the 2. Look at any sequence - how many identical copies of it must there be?

Write out all the sequences if it helps - there aren't many.

6. Nov 7, 2013

### Mentallic

So essentially we would have 4 unique balls, which can be arranged in 4! ways, but because of the two identical red balls we have twice as many sequences as we should since in all of the unique 4! arrangements, half of them are the 1 and 2 red balls swapped around. Right?

While trying to figure out a system to draw them without missing any or running into duplicates, I realized that if I fix G (or B) and rotate the remaining two reds and B, there are only 3C2 ways of arranging those in their 3 remaining positions, and then if I move G to each of the other 4 positions, I end up with 4C1 * 3C2 = 4*3 = 12 ways. This also adds up to $\frac{4!}{2}$ so I'm feeling confident about it :)

Ok so altogether I now have

$$P=\frac{4+6+12}{81}=\frac{22}{81}$$

Does that seem right?

7. Nov 7, 2013

### Staff: Mentor

Right (all of it)

8. Nov 7, 2013

### Mentallic

Thanks everyone

9. Nov 7, 2013

### Ray Vickson

The way you stated it originally "... at least 2 red and 1 green ball..." could correctly be interpreted as saying 2 or 3 red and exactly 1 green---taking the 'at least' to apply only to the nearest color; had you said "at least 2 red and at least 1 green" that would have made it clearer, if that is what you meant.

Anyway, in either interpretation you can use the trinomial distribution:
1) >= 2 red, exactly 1 green and maybe 1 blue. Counting colors only, and not their order this is the event {rrgb,rrrg}, and the answer is P(rrgb)+P(rrrg).
$$P(rrgb) = {4 \choose 2,1,1} (1/3)^4 = \frac{4!}{2!\,1!1!} \frac{1}{3^4}\\ P(rrrg) = {4 \choose 3,1,0}(1/3)^4 = \frac{4!}{3!\,1!\,0!} \frac{1}{3^4}.$$
2) >= 2 red, >= 1 green --> {rrgb,rrrg,rrgg}
You can figure out the probabilities here, again using the trinomial distribution.

10. Nov 7, 2013

### Mentallic

It is, and yes, I should have been more clear.

Thanks, I read about the generalized multinomial distribution and it seems pretty useful!

However, figuring out the remaining unordered sequences RRGB, RRRG, RRGG was pretty easy since 3 colours were already fixed and there was only a 4th spot available, but if I have many more spots, the number of sequences I have will grow at an n! rate. Of course there will a pattern to take advantage of, but that's a lot of applications to the multinomial distribution. Is there a more elegant approach?

11. Nov 8, 2013

### Ray Vickson

What is inelegant about the multinomial? Of course, sometimes it is easier to figure out things like the probability of at least one of something by looking at the complement = zero of that thing, but in this problem that does not happen.

12. Nov 8, 2013

### Mentallic

It's not the multinomial that I have a problem with, it's the many applications of the multinomial. If we had 5 colours to use, and we wanted at least 1 of the first colour, 2 of the second, ... and 5 of the last, with 30 spots available spots, that'd get pretty horrendous.

True, but as in my last example, it's neither simple for that case or its complement. To arrange 5 colours amongst 15 spots (30 available position minus 15 [at least] fixed positions) we would have 515 ways to do that.

edit: Actually, while thinking about it, it'd probably just be easier and more realistic to find an approximate probability to the problem by running random trials on a computer.

Last edited: Nov 8, 2013
13. Nov 9, 2013

### Ray Vickson

I disagree. While you might not be able to do it manually in any realistic time frame, if you can use a computer you can easily get it to evaluate a sum of a few hundred to a few thousand multinomial terms, and do it orders of magnitude faster and more accurate than simulation. Of course, there are some much tougher probability problems that are truly hopeless without simulation, but yours is not one of them. You could do it via a spreadsheet, or Matlab, or Maple or Mathematica, etc.

14. Nov 9, 2013

### Mentallic

So we don't agree that the latest problem I mentioned in post #12 will in fact have $5^{15} \approx \text{30 billion}$ multinomials to calculate?

The trouble I'm having with these larger scale problems is figuring out a process of how to produce all the multinomials without missing or duplicating any configurations.

Also, the probability calculated in a simulation would converge to the true probability from both above and below, while all the multinomials are all positive and summed together, so each term calculated only slowly works its way from 0 to the answer. I was curious to know how these probabilities are calculated - hence this thread - but since I'm going to have larger examples to figure out and a simulation program of this type is easily adaptable, while in my opinion, figuring out the multinomials isn't, and most importantly, I don't need exact probabilities, only rough estimates to within 1% of the true value.

15. Nov 10, 2013

### Staff: Mentor

If there is no clever way to do it analytically within a reasonable time: after 5000 simulations, you are within 1% of the real value in at least ~2/3 of the simulations. After 20000, this increases to at least 95% and after 50000, more than 99,8%. If the probability is close to 0% or 100%, it converges even quicker.

16. Nov 12, 2013

### haruspex

If there are c colours, s spots, and the prescribed minimum counts add up to n <= s, how many cases are there to consider?
It's how many ways we can partition the remaining s-n count into c colors.
$^{s-n+c-1}C_{c-1}$