I'm trying to calculate the number of poker deals with the following suit configuration:
- Pocket: 2 spades
- Flop: 1 spade, 2 other cards of unmatched suit
The order of the cards within a round of dealing does not matter. And the specific suits don't matter -- I'm trying to calculate the number of isomorphic hands. An example deal would be: KsAs|9s9c10d. KsAs are the pocket cards. 9s9c9d are the flop. This would be considered the same deal as KsAs|9s10c9d -- the flop has a 9s and 9, 10 off suit.
I'm approaching this as $\text{pocket combinations}*\text{flop combinations}=\text{total}$.
For the 13 spades for the pocket combinations: $$ \text{pocket combinations}=\binom{13}{2} =78 $$
For the flop with 11 remaining spades and 13 cards for all other suits, I use a generating function. The first part is the 11 ranks that can be chosen up to 3 times for any of the suits. The second term is the 2 ranks that can only be chosen as the non-spades suits. Define $[x^k]$ as the operator to extract the coefficient on $x^k$ for the polynomial.
$$ \text{flop combinations}=[x^3](1+x+x^2+x^3)^{11}(1+x+x^2)^{13-11} =453 $$
This gives me $78*453=35,334$ combinations.
But brute forcing to iterate through all deals that match this suit configuration results in 78,078 combinations.
Any idea what I'm doing wrong for the non-brute force approach that is causing it to under count combinations?
The number of non-isomorphic deals matching your description is $$ \binom{13}2\times \binom{11}1\times \left[\binom{13}2+ \binom{13}1\right]= 78,\!078. $$ There are $\binom{13}2$ ways to choose the two spades for the pocket, then $\binom{11}1$ ways to choose the spade for the flop from the remaining $11$ spades. For the off-suit cards, there are two cases. If the ranks are different, then the two different ranks can be chosen in $\binom{13}2$ ways. If the ranks are the same, then there are $\binom{13}1$ ways to choose the rank.
Note that $$ \binom{13}2+ \binom{13}1=[x^2](1 + x + x^2 + x^3)^{13} $$ This is because there are $13$ ranks, each with three non-spade cards, so each rank can contribute either $0,1,2,$ or $3$ cards to the two off-suit cards. However, you cannot include the spades in the generating function like you tried to do, because while the other suits are considered identical for this problem, the spade suit is singled out as special.