2

I am thinking a question of picking $k$ objects out of $n$($n>k$). But among the $n=4m$ objects, only $m$ distinguishable objects. For example, a deck of poker cards, total $n=52$ cards, but we consider only $m=13$ are distinguishable. I am trying to calculate the total combination if I pick $k$ out of $n$ without considering the order. To make it simple, I am trying to consider a small problem, when $n=8$, $k=4$, $m=4$.

To start with, I consider all possible combination just by picking 4 objects out of 8 without considering the order, I have

$$ C_n^k = C_8^4 = \dfrac{8!}{4!4!} = 70 $$

But I know if there is only $m=4$ distinguishable objects there, the actual number of combination is much less that 70. I try the computer programming to list all possible combination and it turns out to be 19. I wonder if anyone could give me some hint to work out the general expression to pick out $k$ object out of $n$ but with only $m$ is distinguishable. Thanks.

p.s. I am thinking that the question could be restated in this way: how many unique hand I could have if I pick $k$ cards out of 52 from a poker deck without including the joker.

joriki
  • 238,052
  • When you say $m$ are distinguishable, do you mean the objects fall into $m$ different classes (in analogy with 13 ranks in a deck of 52 cards)? So in your small example, there are four kinds of objects ($m$), two of each ($n/m$) and you pick four? – Ross Millikan Mar 18 '14 at 22:48
  • Yes, that's what I mean. For example, in the small example, I have A, A, B, B, C, C, D, D as the main set, and trying to choose 4 elements out of that set. – user1285419 Mar 18 '14 at 22:52

3 Answers3

2

So you have $4 m$ objects, $4$ of each of $m$ types, of which you want to pick $k$. Set it up as generating functions. Each type can be represented 0 to 4 times, so result is the following coefficient of the generating function: \begin{align} [z^k] (1 + z + z^2 + z^3 + z^4)^m &= [z^k] \left( \frac{1 - z^5}{1 - z} \right)^m \\ &= [z^k] (1 - z^5)^m \sum_{r \ge 0} (-1)^r \binom{-m}{r} z^r \\ &= [z^k] (1 - z^5)^m \sum_{r \ge 0} \binom{m + r - 1}{m - 1} z^r \\ &= \sum_{r \ge 0} \binom{m + r - 1}{m - 1} [z^{k - r}](1 - z^5)^m \end{align} This gets a bit messy, use Iverson's bracket to pick just the right elements: $$ [z^k] (1 + z + z^2 + z^3 + z^4)^m = \sum_{r \ge 0} [5 \mid k - r] \binom{m + r - 1}{m - 1} (-1)^{(k - r)/5} \binom{m}{(k - r) / 5} $$ No closed formula, I'm afraid.

vonbrand
  • 27,812
1

This is equivalent to the problem of distributing $k$ balls over $m$ bins, each of limited capacity $\frac nm$, which can be solved using inclusion-exclusion; see e.g. Balls In Bins With Limited Capacity, or Brian's answer here. The result in your case is

$$ \sum_{t=0}^m(-1)^t\binom mt\binom{m+k-t\left(\frac nm+1\right)-1}{m-1}\;, $$

where, contrary to convention, the binomial coefficient is taken to vanish if the upper index is negative. In your example with $n=8$, $k=4$, $m=4$ this is

$$ \sum_{t=0}^4(-1)^t\binom4t\binom{7-3t}3=\binom73-4\binom43=35-16=19\;. $$

joriki
  • 238,052
1

You are looking for the number of weak compositions of $k$ into $m$ pieces with no piece greater than $n/m$. The "with no piece greater than $n/m$" ruins the nice formula you can get from a stars-and-bars argument, that there are ${k+m-1 \choose m-1}=\frac {(k+m-1)!}{(m-1)!k!}$ of them.

Ross Millikan
  • 374,822
  • thank Ross. In this expression, where is $k$? I choose $k$ elements out of $n$ with $n=4m$. – user1285419 Mar 18 '14 at 23:02
  • Here it is. I meant $k$ where I said $n$. But this still computes $35$ instead of $19$ for your test case, as there are four draws with all the same and twelve with three of one kind and one of another that fail the not more than two test. – Ross Millikan Mar 18 '14 at 23:05
  • What I am solving this problem is quite straightforward, I first list of possible combination for picking k out of n and assuming the set is A1 A2 B1 B2 C1 C2 D1 D2.It gives me total 70 subset if I pick 4 out of 8 from that set. I then remove all duplicate set (for example, A1-A2-B1-C2 and A1-A2-B2-C2 and A1-A2-B2-C1 and A1-A2-B1-C2 and etc. are claimed as the same set and we only count ONCE. After selecting out all those duplicated subset, only 19 left. – user1285419 Mar 18 '14 at 23:13
  • Yes, my last comment validated your number $19$. I don't know how to put the restriction that you can't have too many of one type into the formula. I did agree with the sixteen that are not allowed because you only have two of each type. – Ross Millikan Mar 18 '14 at 23:15
  • See my answer on how to implement the restriction. – joriki Oct 03 '15 at 07:23