# Multiple colored balls in box

I have a box full with $$n$$ balls of different color but only one of each color e.g. 1 red, 1 green, 1 yellow, 1 blue etc.

We pull out balls without laying them back.

Here if we want to compute all possibilities (order doesn't matter) after $$k$$ pulls, the answer is $$\binom{n}{k}$$. This is clear.

But how does the answer change if we allow multiple balls of one color, e.g. the box is filled with 2 red 3 green 1 yellow and 4 blue balls? How many possibilities are now possible?

• If the balls are uniquely labeled, still $\binom{n}{k}$ and if we are wishing to use such an analysis to predict things using probability it is incredibly helpful to pretend that the balls are in fact labeled so as to allow us to use counting techniques to calculate probabilities... even if this were not actually true. If you do wish to treat two outcomes as "the same" for counting (despite the warnings that this makes the outcomes no longer equiprobable for probability purposes) then you can treat this by some mix of stars-and-bars and inclusion-exclusion if you insist. Commented Feb 26 at 15:19
• The easiest though to explain would be by generating functions... looking at the coefficient of $x^k$ in the expansion of $\underbrace{(1+x+x^2)}_{\text{two red balls}}(1+x+x^2+x^3)(1+x)\underbrace{(1+x+x^2+x^3+x^4)}_{\text{four blue balls}}$ Commented Feb 26 at 15:20
• @JMoravitz I'm sorry still in high school, I don't understand. Is there a way to solve this "easily" with the six well known cases of permutation, variation and combination? Commented Feb 26 at 15:22
• No. You need additional tools and understanding, unless you insist on using only the basics at which point you would need to break into cases... at which point you can quickly and easily devolve into "case hell" where there are far too many cases to feasibly track, which is why I suggested the generating functions approach if all you cared about was getting the answer and didn't mind using computer help with what is essentially disguised brute force. Even with stars-and-bars and inclusion-exclusion, the answer to the general problem is far too ugly to take the time to write out. Commented Feb 26 at 15:25
• @JMoravitz Okay interesting, I guess it's a "very easy question" but the answer is way harder than expected. Commented Feb 26 at 15:31

Well there is certainly a "easy" way to to this problem You would first add up all the balls, In this case 2+3+1+4=10

Then you would take the factorial of the number which is 10!

after this the process is quite simple just divide your sum factorial by the factorial of different numbers

$$\frac{(10!)}{2!3!1!4!}$$ Which would give your required answer =12600

Now this would give you the total combinations But if you want to explore more and get into more detail about how to derive the formula you have to apply a PIE (principle of inclusion exclusion). Hope this clears it.

PS- This concepts only applies if the balls are not distinct If the balls are distinct you would use the standard way.

• But that would only be the case if I decide to pull every ball from the box right? (So n=k). If k<n this doesn't work, right? Commented Feb 26 at 17:20
• For that you have to make cases by using systematic counting as well as stars and bars concepts.Typically such big number of cases do not usually come in this question if k<n. But lets say for the sake of it that k=2 then you would have to form the equation x+y+z=2 and then make cases for all the non negative integral solutions. Commented Feb 26 at 19:04
• Such is the beauty of combinatorics as there are no 'easy way' to solve such problems(like just putting it into a formula) Commented Feb 26 at 19:11