I have 3 buckets, 1st bucket has 5 red balls, 2nd bucket has 3 green balls and 3rd one has 2 blue balls. so I have total 10 balls in 3 buckets.

I need to know, what are the possible combination available if I need to pick up 4 balls( irrespective of colors) from 3 buckets. i.e I can pick up 4 from bucket 1 , or I can pick them up from different buckets as well.i.e 2 red, 1 green, 1 blue or 4 red or 2 green and 2 blue or 2 blue and 2 red...etc..what will be the mathematical formulation

  • $\begingroup$ What tools do you have available to you? (What similar problems have you seen in class?) $\endgroup$ – rogerl Oct 13 '14 at 17:07
  • 1
    $\begingroup$ The question isn’t entirely clear: are you supposed to find the number of different combinations of colors that you can draw? For instance, you can draw $4$ red balls, but you can’t draw $4$ green or $4$ blue balls. $\endgroup$ – Brian M. Scott Oct 13 '14 at 17:15
  • $\begingroup$ yes, actually I need to know the different combinations of colors. i.e 2 red, 1 green, 1 blue or 4 red or 2 green and 2 blue or 2 blue and 2 red...etc..what will be the mathematical formulation $\endgroup$ – user38375 Oct 13 '14 at 17:29

We assume that balls of the same colour are identical. Let $r$ be the number of red we pick, $g$ the number of green, and $b$ the number of blue. We want to find the number of solutions of the equation $r+g+b=4$ in non-negative integers.

This would be taken care of by a general formula ("Stars and Bars") if there were $4$ or more balls in each bucket. However, there are only $2$ blue balls, so for example the solution $(0,1,3)$ is not possible.

I do not know whether you are expected to use a "general" procedure, or just plain count. We will do the latter, in a reasonably organized manner.

Divide into cases.

4 red: There is only $1$ way to do this.

3 red: We can pick a green, or a blue, $2$ ways.

2 red: We pick $2$ green, or $2$ blue, or $1$ of each, a total of $3$ ways.

1 red: We pick $3$ green, or $2$, or $1$, and the rest blue, a total of $3$ ways.

0 red: We pick $3$ green, or $2$, and the rest blue, a total of $2$ ways.

Add up.

Remark: Since the blues are fewest, it is obviously more efficient to let the cases be $2$ blue, $1$ blue, $0$ blue. You should do it that way, in order to make the solution "your own."


This is a stars and bars problem. Let $r,g$, and $b$ be the numbers of red, green, and blue balls, respectively, in the set of $4$ that you draw. In effect you’re being asked for the number of solutions in integers to the equation $r+g+b=4$ subject to the conditions that $0\le r\le 5$, $0\le g\le 3$, and $0\le b\le 2$. The standard approach to solving such problems is to use the method explained quite well at the link to calculate the number of solutions in non-negative integers without regard to the upper bounds, then use the same basic method to calculate the number of solutions that violate the bounds and subtract that from the first number. In some problems this requires an inclusion-exclusion argument, but this problem is easier, since a set of $4$ balls cannot violate more than one of the conditions. This solution to a similar problem gives a pretty full explanation.

The numbers in your problem are so small, however, that it might well be quicker to solve the problem by brute force. You can have

  • $4$ red balls;
  • $3$ red balls and $1$ green ball;
  • $3$ red balls and $1$ blue ball;
  • $2$ red balls and $2$ green balls;
  • $2$ red balls and $2$ blue balls;
  • $2$ red balls, $1$ green ball, and $1$ blue ball;

and so on. If you list the possibilities systematically, as I’ve begun to do here, you’ll finish pretty quickly.

  • $\begingroup$ hi , thanks for responding so (n+k-1)!/n!(k-1)! shall be the no of ways? so here n=4,k=3 , so I get 15 ways...but manually I am getting 11 ways.. $\endgroup$ – user38375 Oct 14 '14 at 9:55
  • $\begingroup$ @user38375: No, $\binom{n+k-1}{k-1}$ would be the number of ways if you had at least $4$ balls of each color available. You have to use an inclusion-exclusion argument to modify that number to account for combinations like $4$ green balls: they’re counted in $\binom{n+k-1}{k-1}$, but they’re not actually available, since you don’t have enough green balls. $\endgroup$ – Brian M. Scott Oct 14 '14 at 19:04

Since you don't care about colors, you will need to find possible combinations of choosing 4 balls from 10 balls. $10!/6!4!=210$ combinations


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.