# Number of permutations from indistinguishable items with $n \neq k$

I have following problem:

In a box are 5 white, 3 red and 10 black balls. Balls of the same color are indistinguishable.

In case we take $n=k=18$ balls we have $\frac{18!}{5! \, 3! \, 10!}$ permutations for the results. But what if $n \neq k$. Let's say we want to take only $10$ balls from the box. If the balls where distinguishable we would have $\frac{n!}{(n-k)!} = \frac{18!}{(18-10)!}$ permutations but in this case the balls are indistinguishable. How do we have to modify the formula above to get the number of permutations where $n \neq k$ for disjunct sets with indistinguishable items?

It is not a pleasant formula: for $0\leq k\leq 18$, $$k!\sum \frac{1}{w! r! b!}$$ where the sum is over all triples of nonnegative integers $(w,r,b)$ such that $w+r+b=k$ with $w\leq 5$, $r\leq 3$, and $b\leq 10$.

• @true blue anil You are right. Thanks! Sep 5, 2016 at 18:44

You can use a generating function, and find the coefficient of $x^{10}$ in

$10!(1+x+{x^2\over 2!}+ {x^3\over 3!}+{x^4\over4!}+{x^5\over5!})(1+x+{x^2\over2!}+{x^3\over3!})(1+x+{x^2\over2!}+{x^3\over3!}+....+{x^{10}\over10!}),$

which is given by $28,713$.

The logic isn't difficult, e.g. if we take $3$ white, $2$ red, $5$ black,
we multiply out $({x^3\over3!})({x^2\over2!})({x^5\over5!}),$ and the coefficient of $x^{10}\; is\; {1\over{3!2!5!}}$

and we are summing up all permissible permutations in this way.

• I changed the wording slightly, but feel free to revert back to the original form if you prefer. Sep 5, 2016 at 21:24
• @user84413: It's fine , thanks. Sep 6, 2016 at 4:12