Permutations after shuffling and drawing multiple cards from a deck

501 Views Asked by At

I'm trying to calculate the number of possible configurations of "starting game states" for a game that starts with shuffling a deck of 60 cards and drawing 7 cards. Some of the cards in the 60-card deck may be functional duplicates.

Here's what I understand:

If the question is, "How many permutations can I have when shuffling this deck of 60 cards," it's pretty straightforward. If they're all unique cards, then it's simply $60!$.

If I have 40 unique cards plus 20 duplicates, then I take $60!/20!$ (with the denominator basically accounting for the number of cases that aren't "unique" due to all of the configurations that are duplicates of each other; this is intuitively obvious when you have two dupes, dividing by 2! to arrive at half the number of permutations). And if I have 30 unique cards, 20 dupes of type A, and 10 dupes of type B, then it's $60!/(20! \cdot 10!)$, if I have 45 uniques plus 5 dupes of A, B, and C, then it's $60!/(5!\cdot 5!\cdot 5!)$, and so on. I understand this much, pretty straightforward stuff.

On a related note:

Now let's say I'm playing a game, and I want to calculate the number of possible "game state" permutations if the game starts with me shuffling the deck, drawing 7 cards off the top of the deck (and then drawing 1 card at a time from that point forward). In this case, I care about the order of the bottom 53 cards, but I don't care about the order of the top 7 cards that I draw at the start, because regardless of whether a card is 2 cards down or 5 cards down, it's going to be part of my starting hand. It's sort of like having 7 duplicates, so if I have a deck of 60 unique cards, I can calculate this as $60!/7!$ Likewise, if I only care about the possible number of starting hands (essentially saying, "I don't care about the ordering of the 53 cards that aren't in my hand") it's $60!/(53! \cdot 7!)$

Here's where things get tricky:

However...what if I have a deck that is 40 unique cards, 20 duplicates, and I want to determine the number of possible states for a game that starts with me drawing a 7 card hand?

It's tempting to jump to $60!/(20! \cdot 7!)$

But you can't just multiply the 7! and 20! together in the denominator, because what if your starting hand contains multiple dupes? The "possibility that two cards could be functionally identical" is "priced in" to both 7! and 20!, so if you multiply these by each other, you're essentially "double dipping." (For an intuitive example of why this doesn't work, let's say I have a deck that consists of 60 identical cards. Number of possible permutations for a deck of identical cards is one, both from intuition and 60!/60!=1, and obviously, the number of possible game states can't be $60!/(60!\cdot 7!)$, because this would be less than one.)

So...what do I do here? If I have a 60-card deck that consists of a mixture of cards (some unique, some dupes), how do I determine the number of possible "starting game states" for a game that starts with me shuffling the deck and drawing a 7-card hand?

I'd like to solve for the following cases. (I'm pretty sure that, if I could figure out case A, it would be pretty easy for me to derive the remaining cases, but I'll list them all; the first case is what I really care about, and cases B and C are sort of just a way for me to test my understanding of the core principles here.)

Case A: the order of the deck matters

Let's say, as an example case, that my 60-card deck involves 30 uniques, 20 dupes of type A, and 10 dupes of type B, and that I'm interested in discovering the number of unique "starting game states" that can be generated from this, where "starting game state" is defined as a hand of 7 cards (whose ordering does not matter), plus a remaining deck of 53 cards (whose ordering does matter).

Case B: How many possible starting 7-card hands are there?

If I have my 60 card deck (which includes 30 unique cards, 20 dupes of type A, and 10 dupes of type B), how many starting hands of 7 are possible? (This is basically the same as disregarding the order of the 53 cards remaining, I don't care about "permutations" in this case, I only care about combinations: either a card is in my hand, or it isn't.)

Case C: adding a second player who also draws a hand, the order of the deck matters

I shuffle the 60-card deck (consisting of 30 unique cards, 20 dupes of A, and 10 dupes of B), I draw a hand of 7 cards, then my opponent draws a hand of 13 cards. In this case: I care about the combination (but not sequence) of 7 cards that go into my hand, I care about the combination (but not sequence) of 13 cards that go into my opponent's hand, and I care about the sequence of the remaining 40 cards in the deck. How many possible permutations of this "starting game state" are there?

2

There are 2 best solutions below

2
On

You basically have to catalog the cases and compute each in turn. It is easiest to start with Case B. Make a list of the number of A's and B's that are possible. One case is that you have three A's, two B's and two other cards. There are $30 \choose 2$ of those hands. For each possibility it is $30$ choose the number of unique cards. Then you can add them up.

Having done Case B, it is easy to extend it to Case A. In my example, the remaining deck has $17\ A$'s, $8\ B$'s and $28$ unique cards, so the number of orders is $\frac {53!}{17!8!}$. You can go through your list from Case B and extend each to its contribution to Case A.

Case C can be solved the same way, but it is a big mess of computation.

2
On

I'll just discuss case A, since you say you think that's the key. Let's say the top $7$ cards comprise $a$ cards of type A, $b$ of type B, and $7-a-b$ uniques. Note that $a$ can take any value from $0$ to $7$, and then $b$ can take any value from $0$ to $7-a.$ There are then ${30\choose7-a-b}$ ways to choose the uniques in the $7$-card hand. There remain $20-a$ cards of type A and $10-b$ cards of type B, so the remainder of the deck can come in ${53!\over(20-a)!(10-b)!}$ ways.

Altogether, we have $$\sum_{a=0}^7\sum_{b=0}^{7-a}{30\choose7-a-b}{53!\over(20-a)!(10-b)!}$$ possible states. I haven't been able to find a way to simplify this.