So, the number of ways to select $k$ objects from $n$ unique objects is equal to the binomial coefficient $\binom{n}{k}$.
Now assume that not all $n$ objects are unique, but there are $m$ groups of unique objects $x_m$, each group consisting of $n_m$ identical objects ($n_m \geq 1$), so that $$ n = n_1 + n_2 + n_3 + \cdots + n_m $$ and the set $X$ of all unique objects is $$ X = \{ x_1, x_2, x_3, \cdots, x_m\} $$ In this case, what is the equivalent of $\binom{n}{k}$, i.e. the number of unique ways to choose $k$ ($ 0 \leq k \leq n$) objects out of the $n$ objects?
It's easy to see that $\binom{n}{0} = 1$, $\binom{n}{n} = 1$, and $\binom{n}{1} = m$, but is there a general function $f(n_1, n_2, n_3, \cdots, n_m, k)$ to calculate this?
Example:
What is the number of unique ways to choose $k$ pieces from all chess pieces? There are 32 chess pieces, so if all of them were unique, the answer would've been $\binom{32}{k}$. However, there are 8 identical white pawns, 8 identical black pawns, 2 identical white bishops, 2 identical black bishops etc. Therefore,
$$
X = \{\mathrm{wP, wB, wN, wR, wQ, wK, bP, bB, bN, bR, bQ, bK}\} \\
n = 8 +2+2+2+1+1+8+2+2+2+1+1
$$
with w: white, b: black, P: pawn, N: knight, B: bishop, R: rook, Q: queen, K: king