I see this question in various formulations so trying to get a general answer:
Let there be $m$ distinct balls (say, of different colors) with $n_i$ number of balls of each type $i$. Let $n=\sum n_i$.
What is the number of ways of selecting $k$ balls?
I want to focus on the part where $k\le m$ and $\min {\{n_1, n_2, \dots,n_m\}}<k< \max{\{n_1, n_2, \dots,n_m\}}$. So that all other cases will be subset of possibilities from this case (right? I think so because now the selection can have $1$ to $k$ distinct balls).
I could get this much:
WLOG let $n_1<n_2<\dots<n_m$. Let $j>0$ be such that, $n_{j+1} \ge k > n_j$.
- So, for selecting $k$ distinct balls, there are ${m}\choose{k}$ ways.
- For $k-1$, two cases: (1) $n_1>1 $, (2) $n_1=1$.
- For (1), it should be ${m\choose{k-1}}(k-1)$.
- For (2), it should be ${m-1\choose k-1}(k-1)+{m-1 \choose k-2}(k-2)$
And so on.
How, if possible, can this be generalized?