Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(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.

share|cite|improve this question
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
up vote 4 down vote accepted

(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.

share|cite|improve this answer
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..

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.