4

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

AAriam
  • 143
  • 1
    This is a restricted version of the stars and bars problem https://en.m.wikipedia.org/wiki/Stars_and_bars_(combinatorics) . There's probably a method of solving this using generating functions but I'm not expecting to see an easy formula. – Dustan Levenstein Jun 27 '22 at 15:30
  • 1
    If we let $a_i$ be the number of times that $x_i$ is included in the selection for each $i\in {1,\dots,m}$, then $a_1+\dots+a_m=k$, and $0\le a_i\le n_i$. Therefore, counting the number of ways to choose the items it equivalent to counting solutions to that equation, so this question is a duplicate of https://math.stackexchange.com/q/553960 – Mike Earnest Jun 27 '22 at 15:45

0 Answers0