# Distribute 12 balls into 5 boxes.

If there are 12 balls, 3 red, 3 green, 3 black, and 3 white. How many ways can we distribute theses balls into 5 boxes such that each box contains exactly one ball?

I was thinking to do this by cases.

Case 1: 3 boxes contain one color (for example red). the other two boxes contain another color(for example white).

There would be ${4 \choose 1}{5 \choose 3}{3 \choose 1}$ many ways for this case.

Case 2: Three boxes contain only one color (for example red). one boxes contain another different color(for example white) and the last box another different color(for example black).

There would be ${4 \choose 1}{5 \choose 3}{3 \choose 1}{2 \choose 1}{2 \choose 1}$ many ways for this case.

Case 3: Two boxes contain only one color(for example red). Another two contain a different color. Last one contains a different color.

there would be ${4 \choose 1}{5 \choose 2}{3 \choose 1}{3 \choose 2}{2 \choose 1}$ many ways for this case.

Case 4: Two boxes contain only one color(for example red). Another one contains a different color. Another one contains a different color. Last one contains a different color.

there would be ${4 \choose 1}{5 \choose 2}{3 \choose 1}{3 \choose 1}{2 \choose 1}{2 \choose 1}{1 \choose 1}{1 \choose 1}$.

Adding all of these up would give the answer.

Is this correct? If not what am I missing and how can I fix this solution?

• The term "distribute" here is a little confusing, implying you want to place all the balls in the boxes. What you want is to place $5$ balls, one per box? Mar 30 '15 at 1:26
• Yes place 5 balls one ball in each box. how many different ways can i do this? Mar 30 '15 at 1:29

## 2 Answers

You must enumerate all the case (as you did I find the same as yours).

Case 1 : (2,3) 3 boxes with 1 color and 2 boxes with another color.

Case 2 : (1,1,3) 3 boxes with 1 color, 1 box with another color and another 1 box with another color.

Case 3 : (1,2,2)...

Case 4 : (1,1,1,2)...

Now how many choices do I have in each case (here I get different calculations) ?

For the case 1, I choose one color for the three and then one for the two. That is :

$${5 \choose 1}{4 \choose 1}=20$$

For the case 2, I choose one color for the three and then two colors for the remaining boxes. That is :

$${5 \choose 1}{4 \choose 2}=30$$

For the case 3, I choose two colors for the two pairs of boxes and then one color for the remaining box. That is :

$${5 \choose 2}{3 \choose 1}=30$$

For the case 3, I choose one colors for two boxes and then three colors for the three remaining boxes. That is :

$${5 \choose 1}{4 \choose 3}=20$$

On the whole I get 80 ways to do this. Here I assumed that the boxes were unlabelled.

If I wanted to sum up the arguments I used, first you reduce to some cases. Then to compute all the way to distribute the colored balls it suffices to choose a color for each set of boxes which are assumed to be colored in the same way.

From your handling of cases I have got the impression that the boxes are labeled, as are the colors, but balls of the same color are undistinguishable.

If there were enough balls of all colors we could just assign a color to each of the boxes. This can be done in $4^5=1024$ ways.

But assignments where the some color is chosen $\geq4$ times are forbidden. There are $4$ assignments were the same color is chosen for all five boxes. There are $60$ assignments where the same color is chosen for four boxes: We can chose this color in four ways, then we can chose the second used color in $3$ ways, and we can chose the deviant box in $5$ ways.

In all there are $1024-4-60=960$ admissible assignments.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7810684442520142, "perplexity": 316.8888479037104}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320304572.73/warc/CC-MAIN-20220124155118-20220124185118-00276.warc.gz"}