# How many options do we have to divide $k$ balls to $n$ cells (2 conditions)

How many options do we have to divide $k$ balls to $n$ cells if $k\geq n$ and:

CONDITION 1: Every cell will have at least one ball.

CONDITION 2: different $k$ balls, different $n$ cells, and there is significance to how we sort the balls in the cells.

Well, I divided the solution to two parts:

PART 1: if $k = n$, then we have $k!$ options.

PART 2: if $k > n$, then we put one ball to every cell, for that we have $k!$ options, and then we have left $k-n$ balls to divide to $n$ cells. which is $(k-n)^n$ options.

Then we sum it all: $k! + k!(k-n)^n$ options.

What do you guys think?

Btw, there's a BONUS question to that, what will be your answer if we change from different $n$ cells to, these $n$ cells are now identical.

Well, I believe it will be $\frac{k!}{k}$ for $k = n$, and will be $\frac {k! + k!(k-n)^n}{k}$ for $k > n$.

Thoughts?

There are $k!$ ways to line up the balls. Now we want to insert separators into $n-1$ of the $k-1$ gaps between balls. This can be done in $\binom{k-1}{n-1}$ ways, for a total of $k!\binom{k-1}{n-1}$.
• I think it is by $n!$. – André Nicolas Dec 15 '15 at 22:29