• Support PF! Buy your school textbooks, materials and every day products Here!

How many ways can you arrange 5 identical balls into 4 boxes?

  • Thread starter jumbogala
  • Start date
  • #1
423
2

Homework Statement


Say you have 5 identical balls. You want to put them into 4 different boxes. What is the total number of ways the balls can be arranged?

For example, you could have all 5 balls in one box. You could have 3 balls in one box and 2 balls in another, etc.


Homework Equations





The Attempt at a Solution


Since the balls are identical, order doesn't matter and this is a combination. So I drew it out, and figured out the correct number of ways - basically by doing a tree diagram.

But what I'm actually trying to figure out is what the equation looks like. I want to generalize it so that it works for m boxes and n balls, so I thought I'd make up a more concrete example to help me.
 

Answers and Replies

  • #2
11
0
In questions like these, it's good to consider one ball at a time:

Take one ball, how many possible options are there? Four, since there are four boxes in which it could be placed.

Take the second ball, how many possible options are there? Four again. So in total, for the two balls, I have 4 x 4 = 16 different combinations.

If you keep going, what do you end up with?
 
  • #3
HallsofIvy
Science Advisor
Homework Helper
41,833
955
That is, of course, for "distinguishable boxes". If the boxes were NOT distinguishable, that is if "3 balls in boxe A and 2 balls in box B" were counted as only one way, divide by 5!.
 
  • #4
Hurkyl
Staff Emeritus
Science Advisor
Gold Member
14,916
19
In questions like these, it's good to consider one ball at a time:

Take one ball, how many possible options are there? Four, since there are four boxes in which it could be placed.

Take the second ball, how many possible options are there? Four again. So in total, for the two balls, I have 4 x 4 = 16 different combinations.

If you keep going, what do you end up with?
The wrong answer -- your method would work for distinguishable balls (and distinguishable boxes). However, the following two sequence of choices are the same outcome in the problem:

  • 11234
  • 43211

In problems like these, once you think you have a way to model the actual problem with descriptions you can count, it's usually a good idea to actually check the two sets are bijective: every actual outcome corresponds to some description, every description corresponds to some outcome, and that the two correspondences are actually inverses.

For your method, if you thought about how to turn an outcome into a description, you probably would have noticed the problem.

But now that I've thought about it, it gives me an idea... (@ the opening poster) the answer is 56, right?

(... process the idea ... remove a redundant part ...)

Lay the five balls out in a row:
* * * * *​
Now, the first box begins on the left. Put a mark '|' in the space where the first box ends and the second box begins, and so forth. 3 marks in all.

Edit: Oh, hrm, it might have been even better to invert that: put the box edges in:
| | |​
and now add 5 '*' marks in the spaces where the balls go.
 
Last edited:
  • #5
ehild
Homework Helper
15,494
1,876
But now that I've thought about it, it gives me an idea... (@ the opening poster) the answer is 56, right?

(... process the idea ... remove a redundant part ...)

Lay the five balls out in a row:
* * * * *​
Now, the first box begins on the left. Put a mark '|' in the space where the first box ends and the second box begins, and so forth. 3 marks in all.
This is exactly the way as "combination with repetitions" is explained in books. :smile: And the result is indeed 56.


ehild
 
  • #6
uart
Science Advisor
2,776
9
For example, you could have all 5 balls in one box. You could have 3 balls in one box and 2 balls in another, etc.
I'm not sure from some of what the OP said that the boxes are even distinguishable? (jumbogala you need to clarify this).

So the answer may be 56, but then again it might be just 6.
 
  • #7
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
16,178
6,188
I'm not sure from some of what the OP said that the boxes are even distinguishable? (jumbogala you need to clarify this).

So the answer may be 56, but then again it might be just 6.
I'm going with 6 based on the wording of the problem.
 
  • #8
423
2
Sorry everyone, the boxes are distinguishable.

I believe the result is 56 then.
 
  • #9
ehild
Homework Helper
15,494
1,876
You are right. You can imagine that the boxes are ordered in a row, box 1 first, then box 2, and so on along with the balls, but the walls of the boxes can be placed at different positions, and the walls are indistinguishable, as Hurkyl explained in post 4. There has to be one wall at the front and one wall at the end, so you can set tree walls. You have then arrangements of 3 indistinguishable walls and 5 indistinguishable balls, these are permutations of 8 elements, from which 3 is one kind and 5 is an other kind.

ehild
 
  • #10
423
2
Thanks everyone! This makes a lot of sense. I understand now =)

A general formula would then be (n + m -1 )! / (n!)(m-1)!

Where n = number of indistinguishable balls, and m = number of distinguishable boxes.
 
  • #11
ehild
Homework Helper
15,494
1,876
Thanks everyone! This makes a lot of sense. I understand now =)

A general formula would then be (n + m -1 )! / (n!)(m-1)!

Where n = number of indistinguishable balls, and m = number of distinguishable boxes.
Very good! You are :cool:! I needed very long time to understand these problems first, and after a couple of years, I have to think very hard to understand it again.

ehild
 
  • #12
754
1
I can come up with 96 distinct combinations!
 
  • #13
754
1
Scratch that ... make it 126 distinct combinations!

(That is, assuming the boxes can be individually identified)
 
Last edited:
  • #14
754
1
Pardon me, I incorrectly red "5 boxes!"
 

Related Threads on How many ways can you arrange 5 identical balls into 4 boxes?

Replies
7
Views
1K
Replies
14
Views
1K
Replies
14
Views
2K
Replies
16
Views
2K
Replies
3
Views
1K
Replies
10
Views
2K
Replies
3
Views
2K
Replies
3
Views
6K
Replies
10
Views
2K
Top