# Number of ways to assign numbers $1,2,\ldots, n$ to $x$ red balls and $y$ blue balls, $x+y = n$, in a set of $X$ red and $Y$ blue.

(sorry, I really couldn't make a better title while still descriptive)

There is a box of $X$ red and $Y$ blue balls. There are $n$ labels, named $1,2, \ldots,n$.

We must put $x$ of those on red balls and $y$ of those on blue, where $x+y = n$.

In how many different ways can that be done.

We do distinguish between different balls of the same color.

-
Is $X$ the same thing as $x$, $Y$ as $y$? If they are not, are $x$ and $y$ specified? – André Nicolas Dec 30 '11 at 22:29
If X is the same thing as x and Y is the same thing as y, then look at Aslan986's answer; otherwise, look at mine. – Lopsy Dec 30 '11 at 22:32

## 2 Answers

(I'm going to assume this isn't homework.)

First, choose the $x$ red balls which we're going to label: $\binom{X}{x}$. Then, choose the y blue balls which we're going to label: $\binom{Y}{y}$. Now, we've got all our labels. Since everything is distinguishable, we now have to choose what order to put them in: $n!$.

Multiplying, there are a total of $\binom{X}{x}\binom{Y}{y}n!$ ways.

-
Not hand-in homework, but a question that I asked myself during exam preparation for a simple prob/stat course in uni. – Elvis Jazzmachine Dec 31 '11 at 6:55

If you distinguish you can assign the labels in n! differents way.

You can order the balls, then you can choose beetwen n labels for the first, (n-1) for the second, and so on..

-