# Distributing $3$ blue and $4$ green and $9$ red balls into $3$ distinct urns

You have $$16$$ balls, $$3$$ blue, $$4$$ green, and $$9$$ red. You also have $$3$$ distinct urns. For each of the balls, you select an urn at random and put the ball into it. What is the probability that each urn contains all three colors?

Put $$1$$ each $$B, G, R$$ in all urns. Put remaining $$6 \, R$$ in $$3$$ urns in $$^{6+3-1} C_{3-1}$$ ways. Similarly for $$B, \, G$$. The required probability is $$\frac{^{3} C_{2} \times {^{8}C_{2}}} {^{5} C_{2}\times {^{6} C_{2}}\times {^{11} C_{2}}}$$

Please tell where is the mistake. Thanks.

• You need to account for probability of initial setup (R,B,G) in each urn). – herb steinberg Apr 17 at 17:46
• @herb steinberg Thanks. – Vinay Deshpande Apr 17 at 17:53

The question is equivalent to finding the probability that while distributing the balls of a color there is no empty urn. At the end the probabilities should be multiplied so that the probability in question is:

$$\prod_{i=R,G,B}\frac {3!}{3^{n_i}}{n_i \brace 3}=\frac{48400}{531441}\approx0.091,$$ where $${p\brace q}$$ stays for the Stirling number of the second kind.

• I did not understand why you used stirling numbers of second kind , because as far as i know it is used for distributing distinguishable objects into indistinguishable boxes – Bulbasaur Apr 17 at 20:38
• @Bulbasaur Try to understand the meaning of the factor $3!$ in the given formula. – user Apr 17 at 20:42
• I see that you used $3!$ to make the urns different , but how did you manage to make balls distinguishable – Bulbasaur Apr 17 at 20:46
• @Bulbasaur They are distinguishable by the process of distributing. Namely by the order in which they are taken and put into the urn. This explains also the overall number of ways to distribute the balls $3^n$. – user Apr 17 at 20:49
• @RobertTheTutor $\frac{48400}{531441}$. – user Apr 17 at 21:28

Here is an answer that considered different approaches, some of them wrong, and I am curious to have someone point out the flaws in my reasoning...

First of all, it is $$3$$ separate issues for the three colors, as each is assigned independently and so we should be able to simply multiply the probabilities for each.

Considering the blue balls as distinct, there are $$3^3$$ ways they can go, and only $$3! = 6$$ of those options lands one ball in each. So that is $$6/27 = 2/9$$. Alternatively, P(1st ball okay) = $$1$$, P(2nd blue ball is okay) = $$2/3$$, and $$P(3$$rd ball is okay$$) = 1/3$$, giving $$2/9$$ again.

Counting the green arrangements: there are $${6 \choose 2} = 15$$ ways to distribute the identical balls, but only $$3$$ of those ways are successes. So $$P($$green in all three$$) = 3/15 = 1/5$$. This answer is incorrect!

Alternate method for green: a tree, branching on the number of urns containing green at each step. Working that way I find $$4/9$$ instead of $$1/5$$.

A third method for green: consider all $$81$$ possible outcomes, labeled by urn number. $$(1,1,2,3)$$ has $$12$$ permutations, and likewise $$(1,2,2,3)$$ and $$(1,2,3,3)$$, for $$36/81 = 4/9$$ again, so it appears the first approach is miscounting somehow.

For the red: placing $$9$$ balls in $$3$$ urns is too many to count every option. The method that failed for green proceeds as follows:

$$11 \choose 2$$ ways to arrange the balls and bin boundaries, and if we consider $$3$$ placed, that leaves $$6$$ to place, so $${8 \choose 2}$$ ways to arrange successfully. That gives $$56/110 = 28/55$$. Somehow that is apparently a miscount.

Another approach would be to use inclusion exclusion: the probability of avoiding urn $$1$$ with all $$9$$ balls would be $$(\frac{2}{3})^9$$, and likewise for the second and third urns. If I total those, I have overcounted by the number of ways to have all $$9$$ end up in a single urn, which is $$3^{-8}$$, giving $$\frac{512\cdot3-3}{3^9} \approx 0.077884$$, and so the probability of reaching all $$3$$ urns should be $$\approx 0.9221155$$

Putting it all together, I find $$\frac{2}{9}\cdot\frac{4}{9}\cdot\big(1 - \frac{1533}{3^9}\big) \approx 0.09107313...$$ which according to @user is the correct answer.

So where did the stars and bars argument go wrong? I'm guessing that some things I thought equally likely aren't.