Distinguishable subsets of the 52-card blackjack deck

103 Views Asked by At

I need to find, for $n = 0, 1, . . . , 52$, the number of distinguishable subsets of size n. Blackjack deck has $4$ cards for each value from $1$ to $9$ and $16$ cards of value $10$, color doesn't matter.

I know that the total number of combinations is $5^9*17$, but when I'm trying to find subsets they don't reach that, there's always more or less. Until $n=5$ it's trivial.

Then, until $n=16$ I'm calculating number of combinations of max $4$ cards of each value and adding combinations with more than $4$ $10$s, e.g. for $n=8$ I have $22110$ combinations of max $4$ cards of each value $+ 220$ combinations for 10,10,10,10,10,x,x,x, which gives $22330$.

Then, for $n = (17,...,26)$ I'm using similar strategy. E.g. for $n=18$ I have $780175$ combinations with max $4$ cards of each value $+ 264220$ combinations for 10,10,10,10,10,x,x,x,x,x,x,x,x,x,x,x,x,x (where in place of x I can still put only $4$ $10$s) $+22110$ combinations for 10,10,10,10,10,10,10,10,10,10,x,x,x,x,x,x,x,x $+210$ combinations for 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,x,x,x (where in place of x I can put only $1$ $10$) $=1066715$.

I did it also with the same strategy, but when adding assuming there's no limit for $10$s, then subtracting combinations with more than $16$ $10$s - I got the same result $(780175+286550-10=1066715)$.

For bigger $n$s I used recursive logic - e.g. for $n=50$ I can only choose $2$ cards, so it's $55$ again, as for $n=2$, so it goes.

With this method I'm missing 1287 counts. What am I doing wrong?

2

There are 2 best solutions below

0
On BEST ANSWER

I found the missing counts. For $n=22$ we have $780175$ (max 4 of each card) $+ 886399$ (combinations for $n=17$) $-1992$ (instead of $-1993$) $= 1664582$ (instead of $1664581$)

From $n=23$ I needed to subtract $1905$ (instead of $-1915$), and so on, until $n=26$. It was the calculation error, the method itself works, if someone will need it in the future.

PIE with $a+b+c+...+j=n$ and $a,b,...,i∈[0,4], j∈[0,16]$ also works perfectly, repeating the result.

0
On

If you don’t want to think about it too much, the ordinary generating function is the way to go. In your case, the coefficient of $x^n$ in $$ f(x)=(1+x+x^2+x^3+x^4)^9 \cdot (1+x+\ldots+x^{15}+x^{16}) $$ is your answer. Equivalently, $$ f(x)=\frac{(x^5-1)^9 (x^{17}-1)}{(x-1)^{10}}. $$ As a bonus, it’s clear (from the first form) that the sum of all the coefficients is $f(1)=5^9\cdot 17$, which is your checksum.