# Combinatorics, Dont seem to get it right

In how many ways can I give out n white balls(identical), and n colored balls(different colors), to 2n boxes so that in each box:

1) at most one ball

2) at most one white ball(there can be several colored balls)

3) at most one colored ball(there can be several white balls)

4) equal number of white and colored balls

Hints:

1) So everybody gets exactly one ball. Label the colours $C_1$ to $C_n$. The ball $C_1$ can be assigned in $2n$ ways. For each such way, the ball $C_2$ can be assigned in $2n-1$ ways. And so on.

2) Ball $C_1$ can be assigned in $2n$ ways. For each such way, ball $C_2$ can be assigned in $2n$ ways. And so on. For every way of assigning the coloured balls, how many ways are there to choose the boxes that will receive a white?

3) Count the number of ways to assign the coloured balls. We have already mentioned how to find this. For each way, how many ways are there to assign the whites? (This component of the calculation is done using Stars and Bars.)

4) The only thing that matters is the coloured balls.

For 1), the coloured balls are all distinct. The ball coloured $C_1$ can be put in any one of the $2n$ boxes. A box can contain at most one ball. So for every way of assigning a box to ball $C_1$, there are $2n-1$ ways to assign a box to ball $C_2$. And now there are $2n-2$ ways to assign a box to ball $C_2$, and so on.
Thus there are $(2n)(2n-1)(2n-2)\cdots(2n-n+1)$ ways to assign boxes to all the coloured balls. If you wish, this number can be written alternately as $\frac{(2n)!}{n!}$. Once we have assigned boxes to the coloured balls, there is only one way to assign boxes to the white balls, since every box is supposed to hold exactly one ball. Thus the answer to 1) is $\frac{(2n)!}{n!}$.
One can do problem 1) in other ways. For example, we can choose which boxes will hold white balls. This can be done in $\binom{2n}{n}$ ways. For every way of deciding which boxes hold white balls, the remaining $n$ coloured balls can be assigned to the remaining $n$ boxes is $n!$ ways. That gives a total of $\binom{2n}{n}n!$, which can be simplified in various ways, for example to $\frac{(2n)!}{n!}$.
For problem 2), there are no restrictions except that a box can contain at most one white. So ball $C_1$ can be assigned a box in $2n$ ways. Since a box can hold more than one coloured ball, the ball $C_2$ can now be assigned a box in $2n$ ways, and so on for a total of $(2n)^n$ ways. For every one of these ways, we can choose the boxes that will hold a white ball in $\binom{2n}{n}$ ways, for a total of $(2n)^n \binom{2n}{n}$.
{"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": 0, "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, "url": "https://math.stackexchange.com/questions/620712/combinatorics-dont-seem-to-get-it-right", "fetch_time": 1642919681000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-05/segments/1642320304134.13/warc/CC-MAIN-20220123045449-20220123075449-00458.warc.gz", "warc_record_offset": 461989663, "warc_record_length": 33329, "token_count": 754, "char_count": 2623, "score": 4.5, "int_score": 4, "crawl": "CC-MAIN-2022-05", "snapshot_type": "latest", "language": "en", "language_score": 0.9195849299430847, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00020-of-00064.parquet"}