Combinatorics help Say there are infinite marbles of k colors and we have to pick n marbles out of them. The marbles must be picked up such that we have at least k different colored marbles. What are the possibility. Assume that marbles of equal color can't be distinguished, and the order of the marbles is irrelevant.
My solution is as follows but turned out to be wrong.
Since k different color marbles are required, the problem drops down to choosing any $n - k$ marbles. Isn't that equal to $k^{n-k}$?
Thanks 
 A: This is a rewording of a standard Stars and Bars problem. We have $n$ candies, and want to distribute them among $k$ kids, with every kid getting at least one candy. 
Or if you prefer equations to kids and candies, it is the number of solutions $(x_1,x_2,\dots,x_k)$ of the equation $x_1+x_2+\cdots+x_k=n$ in positive integers. 
The number of ways to do this is $\binom{n-1}{k-1}$. The explanation of "Stars and Bars" in the Wikipedia article linked to above is good. There are also many explanations of the idea on MSE. 
Remark: The suggestion $k^{n-k}$ will not work. For one thing, it treats the "remaining" $n-k$ marbles as distinct. The problem explicitly says that marbles of the same colour are to be treated as identical. 
A: This problem is equivalent to number of solutions of equation $c_1+c_2+\cdots+c_k=n$ with $c\geq 1$ and $c$ integer, you can use the "generating function" (see book of combinatorial of Brualdi or Grimaldi), the number of posibilities is the coeficient in $(x+x^2+x^3+\cdots x^n+\cdots)^k$ of $x^n$, but this same, is the coeficient of $x^{n-k}$ in $(1+x+x^2+\cdots x^{n-1}+x^n+\cdots)^k$, 
 $$(1+x+x^2+\cdots x^{n-1}+x^n+\cdots)^k=\frac{1}{(1-x)^k}=\sum_{i=0}^\infty\binom{k+i-1}{i}x^i$$
Then the number posibilities is $\binom{k+n-k-1}{n-k}=\binom{n-1}{n-k}=\binom{n-1}{k-1}$
God bless
