Distribute $n$ distinguishable balls into $k$ distinguishable baskets Given a number $n$ and $k$ numbers $n_1,n_2,n_3\ldots, n_k \in \mathbb{N}$ such that
$n_1+n_2+n_3+\ldots+ n_k=n$
How many ways are there to distribute  distinguishable balls into $k$
distinguishable baskets so that exactly $n_i$ balls are placed in each basket $i$ , $i =1,2,\ldots, k$?
Also, how many ways are there to distribute $n$ distinguishable balls into $k$
distinguishable baskets? Let's say if there is no restriction to the number of balls in each basket.
I can't really understand the logic of that. I mean, there are $n$ balls by the given forumla $n_1+n_2+\ldots+n_k=n$ and there are $k$ baskets? So what's the deal with "$n_1, n_2,\dots$ etc."? Why isn't it $x_1,x_2,\dots$ etc.?
How do you think should I do it?
I mean if they were identical balls I would use the $k+n-1\choose{n-1}$ formula.
But here they are different.
I can't really figure out what should I do in both of those questions.
Thanks.
For the second answer it's gonna be $k^n$?
($k$: number of baskets; $n$: number of balls)

Edit: The bins are not identical. I thought about it, and if $n_1,n_2,n_3,\dots,n_k$ are simply numbers which represent the amount of balls in each bin (for example $n_1$ balls in bin number $1$, $n_2$ balls in bin number $2$ and so on), then there is only one option, right? Because we already have the exact amount of balls in each basket.
But maybe it's something fishy because we can find a lot of options for $n_1+n_2+...+n_k=n$ ...
I mean, $n_1$ can be different in each option...
 A: You are correct that the number of ways of distributing $n$ distinguishable balls to $k$ distinguishable bins without restriction is $k^n$ since there are $k$ choices for each of the $n$ balls.
As for the number of ways of distributing $n = n_1 + n_2 + n_3 + \cdots + n_k$ balls to $k$ distinguishable baskets so that exactly $n_i$ balls are placed in basket $i$, $i = 1, 2, \ldots, k$, select which $n_1$ of the $n$ balls are placed in the first basket, which $n_2$ of the remaining $n - n_1$ balls are placed in the second basket, which $n_3$ of the remaining $n - n_1 - n_2$ balls are placed in the third basket, and so forth until you are left with $n_k$ balls to choose from the remaining $n - n_1 - n_2 - \cdots - n_{k - 1}$ to place in the $k$th basket.  This can be done in
$$\binom{n}{n_1}\binom{n - n_1}{n_2}\binom{n - n_1 - n_2}{n_3} \cdots \binom{n - n_1 - n_2 - \cdots - n_{k - 1}}{n_k}$$
ways.  Let's simplify the above expression.
\begin{align*}
& \binom{n}{n_1}\binom{n - n_1}{n_2}\binom{n - n_1 - n_2}{n_3} \cdots \binom{n - n_1 - n_2 - \cdots - n_{k - 1}}{n_k}\\
& \qquad = \frac{n!}{n_1!(n - n_1)!} \cdot \frac{(n - n_1)!}{n_2!(n - n_1 - n_2)!} \cdot \frac{(n - n_1 - n_2)!}{n_3!(n - n_1 - n_2 - n_3)!} \cdots \frac{(n - n_1 - n_2 - n_3 - \cdots - n_{k - 1})!}{n_k!(n - n_1 - n_2 - n_3 - \cdots - n_{k - 1} - n_k)!}\\
& \qquad = \frac{n!}{n_1!n_2!n_3! \cdots n_k!(n - n_1 - n_2 - n_3 - \cdots - n_{k - 1} - n_k)!}\\
& \qquad = \frac{n!}{n_1!n_2!n_3! \cdots n_k!0!}\\
& \qquad = \frac{n!}{n_1!n_2!n_3! \cdots n_k!}
\end{align*}
where we have used the fact that $n = n_1 + n_2 + n_3 + \cdots + n_k$ in the penultimate line.
Why does this answer make sense?
Imagine lining up all $n$ balls in some order.  We can do this in $n!$ ways.  Place the first $n_1$ balls in the first box, the next $n_2$ balls in the second box, the next $n_3$ balls in the third box, and so forth until we place the last $n_k$ balls in the $k$th box.  The factors in the denominator represent the number of orders in which the same $n_i$ balls could be placed in the $i$th box without changing the distribution.
Addendum:  If we impose the additional requirement that there must be at least one ball in each basket, then we must subtract those distributions which leave one or more of the baskets empty.
There are $\binom{k}{j}$ ways to exclude $j$ of the baskets from receiving a ball and $(k - j)^n$ ways to distribute the $n$ balls to the remaining $k - j$ baskets.  Thus, by the Inclusion-Exclusion Principle, the number of ways of distributing $n$ distinguishable balls to $k$ distinguishable baskets so that no basket is left empty is
$$\prod_{j = 1}^{k} (-1)^{j} \binom{k}{j}(k - j)^n$$
This is also the number of surjective functions from a set with $n$ elements to a set with $k$ elements.
A: The number of ways to distribute $n$ distinct objects in $k$ distinct baskets so that there are exactly $n_i$ objects in $i$-th basket ($\sum_i n_i=n$) is
$$
\frac{n!}{\prod\limits_{i=1}^kn_i!}.
$$
