0

There are 3 containers with different color, having 3 balls each with the same color as the container. How to find the no of combinations to pick 3 balls out of these 3 container.

Extending the above problem How to find the no of combinations to pick n balls out of these n container of different color, each having n balls with the same color as the container.

Eg:

Containers : R, G, B

R - have 3 red ball

G - have 3 green ball

B - have 3 blue ball

I have to pick three balls out of this. Possible picks (R,R,R),(R,G,B),(R,R,B).....

(G,B,G) is same as (B,G,G)

and I was able to come up with the count 10 for the above example, I want mathematical formula for the same.

Thanks.

Sabari
  • 3
  • 1
  • 3
  • Hi and welcome to the site! Since this is a site that encourages learning, you will get much more help if you show us what you have already done. Could you edit your question with your thoughts and ideas? – 5xum Jun 16 '14 at 07:26
  • So, the question is like: black box has 3 three black balls, etc.? What have you tried. Where are you stuck? – tpb261 Jun 16 '14 at 07:27
  • No restrictions? just the number of total options to pick up 3 balls out of those 3 containers? – DanielY Jun 16 '14 at 07:27
  • @DanielY It giving me wrong answer – Sabari Jun 16 '14 at 07:40
  • @DanielY I think we need to ignore the repeats of colors. As in RRB will be same RBR. The edited question mentions it, too. :) – tpb261 Jun 16 '14 at 07:44
  • yeah I just saw that now @tpb261, thanks :). I'll correct my guess – DanielY Jun 16 '14 at 07:44
  • Try this: You can pick 0,1,2 or 3 balls from each. You need a total of 3 balls. That would be the coefficient of x^3 in the expansion of $(x^0+x^1+x^2+x^3)^3$. Now try to generalize that. – tpb261 Jun 16 '14 at 07:46
  • I've tried with other numbers others than three, and I came up with the following formula: $3n \choose n$ / n. The division is in order the ignore repetitions. – DanielY Jun 16 '14 at 07:51
  • I think this will do n+n(n-1)+(n-1)(n-2)+...+1 till any of the (n-x)<(n/2) I dont know how to sum this up into a reduced form. – Sabari Jun 16 '14 at 09:37

1 Answers1

1

The answer to the general question is the number of ways to get $n$ nonnegative integers to add up to $n$, which is the coefficient of $x^n$ in $$(1+x+\dots)^n=(1-x)^{-n}$$ and by the Binomial Theorem the answer is $\displaystyle{2n-1\choose n-1}$. Note that for $n=3$ this gives $5\choose2$, which is 10, as desired.

Gerry Myerson
  • 179,216
  • For n = 4 the binomial theorem representation gives 35 but in manual count answer comes to 23. – Sabari Jun 19 '14 at 06:55
  • I don't think so. Let's write abcd to indicate a balls of color 1, b of color 2, c of color 3, and d of color 4. Then you can have 4000, 0400, 0040, 0004: that's 4. You can have 3100, 3010, ..., 0013: that's another 12. 2200, 2020, ..., 0022: another 6. 2110, 2101, ..., 0112: another 12. And 1111. All told: $4+12+6+12+1=35$. – Gerry Myerson Jun 19 '14 at 07:16
  • Are you still there? – Gerry Myerson Jun 20 '14 at 10:05
  • Thanks, I got my manual counting wrong. – Sabari Jun 22 '14 at 15:12