0

Number of ways of arranging 4 unique/distinct balls into 3 boxes. Note that a box can contain zero balls.

Of course the easiest way of solving this problem is simply:

$3^4$

since there are 3 options for each ball, so 3 AND 3 AND 3 AND 3 = 81 (using the product principle).

However, I was trying to use the stars and bars formula with this. Of course the limitation is that now the stars are distinct. I am aware that someone has posted an answer to this already, but I did not follow this explanation.

I am looking for a fix to the stars and bars approach. Here is what I have done so far:

$\binom{n+k-1}{n}\times n!=\binom{6}{4} \times 4!$

because we want to permute (position/order matters) the 4 balls amongst 6 spaces. While the balls are distinct, the bars are not, so of course we need to divide by two.

This gives me:

$\frac{\binom{6}{4}\times 4!}{2} = 180$

which is not the correct answer. Please advise!

  • If you are actually resposting this, then this violates the policies of the site: you should not repost the same question. If you are not actually "reposting", then don't put that label on the post. – Arturo Magidin May 13 '21 at 20:11
  • Is that better? It is sort of a repost but the question is slightly different and I just didnt understand the answer and the op was 10 months ago. – ThePhysicsOverthinker May 13 '21 at 20:14
  • $3^4$ counts the number of ways of distributing 4 distinguishable balls into 3 distinguishable boxes. Are your boxes distinguishable, or not distinguishable? I also don't understand what you think you are counting in your second approach. – Arturo Magidin May 13 '21 at 20:15
  • @Arutro If the boxes were not distinguishable, wouldn't it still be $3^4$ ? In my second approach I do stars and bars formula but then instead of nCr I do nPr because the order matters now that they are distinguishable. – ThePhysicsOverthinker May 13 '21 at 20:22
  • If the boxes are indistinguishable, then the answer is certainly not $3^4$: you have only one way of putting all balls into a single box, whereas that count would consider that 3 times, once for each of the possible boxes containing all balls. – Arturo Magidin May 13 '21 at 20:23
  • I know what the things you are computing are in terms of permutations and combinations. That is not my question. You are trying to apply "stars and bars"... What is playing the role of the stars? What is playing the role of the bars? What are the "extra" arrangements that you are trying to count using the $4!$ factor? What are the overcounts that you are trying to account for when you divide by $2$? I don't understand what you think you are counting. Of course, that depends on whethe the boxes are distinguishable or not. – Arturo Magidin May 13 '21 at 20:25
  • @ArturoMagidin But there isn't only one box, there are still 3 possible boxes, just each box is the same as the other(just 3 plain old cardboard boxes). I guess I see what you are saying now, they are still different boxes even if they look the same as each other, right? – ThePhysicsOverthinker May 13 '21 at 20:26
  • Make up your mind. they can't be "indistinguishable" and also "different boxes." When you count it as $3^4$, you are essentially labeling the boxes as $1$, $2$, and $3$, and then assigning a number to each ball, giving you which box they'll go into. But in that case, you count giving all balls the label "1" as being different from giving all of them the label "2". But if the boxes are indistinguishable, then putting all balls in box 1 is exactly the same as putting all balls in box 2, yet you've counted those two equal outcomes as different. – Arturo Magidin May 13 '21 at 20:28
  • @ArturoMagidin The stars are the balls, the bars are the boxes-1 because that divides them into 3 sections. The extra arrangements are the $n!$ ways of arranging $n$ objects. Here there are 4 objects, so $4!$ . Since the 2 bars are identical, I am overcounting for each permutation of 6 objects (4+2) by a factor of 2, so I divide by 2. – ThePhysicsOverthinker May 13 '21 at 20:29
  • You are overcounting. Consider the case in which balls 1 and 2 are in box 1, and balls 3 and 4 are in box 2 (with box 3 empty). When you multiply by $4!$, you counting as different the case in which balls 2 and 1 are in box 1 and balls 4 and 3 are in box 2; but that is the same distribution as the first one. But you've counted them multiple times. You can't just multiply by $4!$. The case where all balls are in the same box, you've counted $4!$ times, when it is only one way to distribute them. that factor is just way off. – Arturo Magidin May 13 '21 at 20:32
  • That's why the post you link to has to consider different cases. Here you would need to consider the cases where all balls are in one box (that one should have no extra factor); the cases where three balls are in one box and one ball in the other (that one needs a factor of $4$ to account for which ball is by itself); the ones where you have two and two has a different factor; and the one where you have two balls in one box, and the other two balls in boxes by themselves yet a different factor. – Arturo Magidin May 13 '21 at 20:34
  • @ArturoMagidin You are completely right RE multiplying by $4!$, thanks that helps a lot. RE indistinguishable v distinguishable, you are also right, they are distinguishable. I'd be grateful if you could tell me what the correct factor is and why? – ThePhysicsOverthinker May 13 '21 at 20:34
  • It's not a single factor; and that's why trying to use stars and bars, which is specifically designed to deal with cases where one of the two sets consist of indistinguishable things, is the wrong approach to use. – Arturo Magidin May 13 '21 at 20:35

1 Answers1

1

You are clear regarding the balls. They are unique/distinct, as you say. Let us instead use the word labeled which avoids any other possible interpretation.

Regarding the boxes, you are not clear whether they are labeled or unlabeled Depending on this, they are two separate problems altogether

Labelled balls and labeled boxes

The answer is simple: Each ball has three choices for boxes, hebce $3^4 = 81$ ways

Labeled balls and unlabeled boxes

It is exactly the same as forming unlabeled teams of various sizes

To solve your problem completely, the answers for each case would be:

  • $4-0-0:\binom44 = 1$

  • $3-1-0:\binom43\binom11 = 4$

  • $2-2-0: \binom42\binom22/2! = 3$

  • $2-1-1: \binom42\binom21\binom11/2! = 6$, adding up to $14$

A more efficient way once you understand the approach is to just compute it as the sum of multinomial coefficients, viz

$\dbinom{4}{4,0,0} +\dbinom{4}{3,1,0} + \dbinom{4}{2,2,0}\Big/2! + \dbinom{4}{2,1,1}\Big/2! = 14$


PS

Stars and bars is used for placing unlabeled objects into labeled boxes, whereas here it is the reverse

  • Thanks, but what I was trying to ask was a fix to the stars and bars approach for labelled balls and labelled boxes. As I said in my question, I knew already that it was $3^4$ but I was trying to ask for a fix to the stars & bars approach. – ThePhysicsOverthinker May 14 '21 at 11:32
  • 1
    Alas, that is not possible, because this is not a stars and bars problem, – true blue anil May 14 '21 at 16:01