Is there a formula for this problem?

OW_Toronto

New member
Joined
Apr 28, 2021
Messages
5
How many ways can you put 4 identical balls into 3 different basket? This question is easy. The answer is 12. But I run into difficulty when I try to tackle the general question with the same method:

How many ways to put n identical balls into m different baskets?

Can there be a formula? I would appreciate very much anyone who helps me with this problem.

Thank you very much.
 
Yes, there is a formula. I myself don't memorize the formula, but just apply the technique called "stars and bars", which can be used for several similar problems (e.g., whether you do or do not allow any baskets to be empty).

Can you show me how you got 12, so I can be sure how you are interpreting the problem?
 
Last edited:
May fewer than than all of the balls be distibuted?

If so, I get an answer for your example of 4 indistinguishable balls and 3 distinguishable baskets much greater than 12 ways.

1 way to distribute none.
3 distinguishable ways to distribute 1 ball.
3 distinguishable ways to distribute 2 balls, both in the same basket.
3 distinguishable ways to distribute 2 balls, each in a different basket.
3 distinguishable ways to distribute 3 balls, all in the same basket.
6 distinguishable ways to distribute 3 balls, two in the same basket.
1 distinguishable way to distribute 3 balls, each in a different basket.
3 distinguishable ways to distribute 4 balls, all in one basket.
6 distinguishable ways to distribute 4 balls, three in the same basket and one in another.
3 distinguishable ways to distribute 4 balls, two in one basket and two in another.
3 distinguishable ways to distribute 4 balls, two in one basket, and the other two in different baskets.

That comes to 35 ways, not 12.

If all the balls must be distributed, I get 15 (not 12) ways, 3 ways to put all 4 into 1 basket, 6 ways to put 3 in 1 basket and 1 in a different basket, 3 ways to put 2 balls into 1 basket and 2 in another, and 3 ways to put 2 balls in 1 basket and 1 ball in each of the other 2 baskets.

So the answer may be easy, but it is not 12 ways. Consequently, I may not understand the question? Please clarify!
 
Yes, there is a formula. I myself don't memorize the formula, but just apply the technique called "stars and bars", which can be used for several similar problems (e.g., whether you do or do not allow any baskets to be empty).

Can you show me how you got 12, so I can be sure how you are interpreting the problem?
May fewer than than all of the balls be distibuted?

If so, I get an answer for your example of 4 indistinguishable balls and 3 distinguishable baskets much greater than 12 ways.

1 way to distribute none.
3 distinguishable ways to distribute 1 ball.
3 distinguishable ways to distribute 2 balls, both in the same basket.
3 distinguishable ways to distribute 2 balls, each in a different basket.
3 distinguishable ways to distribute 3 balls, all in the same basket.
6 distinguishable ways to distribute 3 balls, two in the same basket.
1 distinguishable way to distribute 3 balls, each in a different basket.
3 distinguishable ways to distribute 4 balls, all in one basket.
6 distinguishable ways to distribute 4 balls, three in the same basket and one in another.
3 distinguishable ways to distribute 4 balls, two in one basket and two in another.
3 distinguishable ways to distribute 4 balls, two in one basket, and the other two in different baskets.

That comes to 35 ways, not 12.

If all the balls must be distributed, I get 15 (not 12) ways, 3 ways to put all 4 into 1 basket, 6 ways to put 3 in 1 basket and 1 in a different basket, 3 ways to put 2 balls into 1 basket and 2 in another, and 3 ways to put 2 balls in 1 basket and 1 ball in each of the other 2 baskets.

So the answer may be easy, but it is not 12 ways. Consequently, I may not understand the question? Please clarify!

Yes, you are right. If all the balls are distributed, there should be 15 ways, not 12. Sorry for my mistake. Do you think the method can be applied to the general case so that we can write a formula?

Thank you very much.
 
Yes, there is a formula. I myself don't memorize the formula, but just apply the technique called "stars and bars", which can be used for several similar problems (e.g., whether you do or do not allow any baskets to be empty).

Can you show me how you got 12, so I can be sure how you are interpreting the problem?

Sorry, the right answer should be 15. I missed 3 cases. Could you have a look at my response to JeffM? Thanks.
 
Yes, there is a formula. I myself don't memorize the formula, but just apply the technique called "stars and bars", which can be used for several similar problems (e.g., whether you do or do not allow any baskets to be empty).

Can you show me how you got 12, so I can be sure how you are interpreting the problem?
Thank you for reminding me of the "stars and bars" method. I think I can apply the idea to my problem.
 
How many ways to put n identical balls into m different baskets?
\(\dbinom{n+m-1}{n}\) But unless you understand how we get that, you will forget it.
Lets model your example of four balls and three different baskets.
\(\underbrace {\_\_\_}_1|\underbrace {\_\_\_}_2|\underbrace {\_\_\_}_3\) so the string \(***|~~|*\)
models having three balls in basket one, no balls in basket two and one ball in basket three.
There are four stars and three minus one bar in this model: \(****|~|\) (stars and bars)
\(\binom{4+3-1}{4}=\dfrac{6!}{4!\cdot 2!}=15\) SEE HERE and HERE
 
\(\dbinom{n+m-1}{n}\) But unless you understand how we get that, you will forget it.
Lets model your example of four balls and three different baskets.
\(\underbrace {\_\_\_}_1|\underbrace {\_\_\_}_2|\underbrace {\_\_\_}_3\) so the string \(***|~~|*\)
models having three balls in basket one, no balls in basket two and one ball in basket three.
There are four stars and three minus one bar in this model: \(****|~|\) (stars and bars)
\(\binom{4+3-1}{4}=\dfrac{6!}{4!\cdot 2!}=15\) SEE HERE and HERE
Thank you very much.
 
Top