# place three balls in three boxes.

question:three balls are placed at random in three boxes, with no restriction on the number of balls per box. how many possible outcomes?

my solution: for the first box, we have 4 choices:place 0,1,2,or 3 balls in the first box.

If I placed 0 ball in the first box, then one of the following is possible:

(1) zero ball in the 2nd box, 3 balls in the 3rd box

(2) 1 ball in the 2nd box, 2 balls in the 3rd

(3) 2 balls in the 2nd box, 1 ball in the 3rd

(4) 3 balls in the 2nd box, 0 ball in the 3rd

Therefore, if i placed 0 ball in the first box, i would have 4 possible outcomes.

If I placed 1 ball in the first box, then one of the following is possible:

(1) 0 ball in the 2nd, 1 ball in the 3rd

(2) 1 ball in the 2nd, 1 ball in the 3rd

(3) 2 ball in the 2nd, 0 ball in the 3rd

Therefore, if i placed 1 ball in the first box, then i would have 3 possible outcomes.

Similarly, if i placed 2 balls in the first box, then i would have 2 possible outcomes. if i placed 3 balls in the first box, then i would have 1 possible outcomes.

so, i conclude that i would have 4+3+2+1=10 outcomes in total.

but this is not the correct answer.

the correct solution given by my Prof is the following: so the total number of outcomes should be 27.

but i do not think i am wrong... can anyone tell me what's wrong with my solution?

• Are the balls considered indistinguishable? If so, then the outcomes $112$, $121$ and $211$ are actually the same. If the balls are distinct, then $3^3$ is the correct answer. – G Tony Jacobs Oct 14 '17 at 23:30
• @GTonyJacobs So if the balls were indistinguishable, then my answer would be correct? and if the balls were distinct, then the prof's answer would be correct? is that what u mean? the question did not tell me if the balls were distinct or not, maybe my prof is assuming they are distinct... – bbw Oct 14 '17 at 23:38
• That's correct. I'm writing up an answer now that explains it in more detail. – G Tony Jacobs Oct 14 '17 at 23:38

There are two ways of interpreting this question. Either the balls are indistinguishable, so we're really just asking how to get three numbers to add up to $3$ (the numbers of balls in each box), or else the balls are distinguishable, so putting the red ball in box $1$ and the green and blue balls in box $2$ is considered a different outcome from putting the blue ball in box $1$, and the red and green balls in box $2$.

Case 1: Balls indistinguishable

This is what you counted, and you got the correct answer, $10$, for this interpretation. The usual way of doing that calculation is to set up a "stars and bars problem". We have three "stars" ($*$), representing the three balls, and two "bars" ($|$), representing the divisions between the boxes. We can arrange them all in a row in different ways:

$$|**|*$$

The above arrangement represents $0$ balls in box $1$ (left of the first bar), two balls in box $2$ (between the bars), and one ball in box $3$ (right of the second bar). Similarly, all of the balls in box $1$ would be represented as:

$$***|\,|$$

To count the number of such arrangements, we just need to count, when arranging $5$ symbols, how many ways can we pick which $2$ of them will be bars? Thus $\binom52=10$.

For $k$ balls in $n$ boxes, this would be $\binom{n+k-1}{n-1}$.

Case 2: Balls distinguishable

In this case, we can use the rule of products. We have $3$ choices for where the red ball goes, $3$ choices for where the blue ball goes, and $3$ choices for where the green ball goes. That's a total of $3\times3\times3=27$ options.

For $k$ balls in $n$ boxes, this would be $n^k$.