We have a standard 52-card deck, and are looking at the possible shuffles/permutations of this deck. However, we have rubbed off the suits from the cards, so for every rank (aces, tens, etc.) all 4 cards are indistinguishable. Furthermore, if we can transform one permutation into another just by relabeling ranks, we regard the permutations as equal. For example, looking at the first 6 cards, A52343 and 5234A4 are to be counted as the same permutation.

Two cards of the same rank cannot be adjacent to each other, so AA2343... is not permissible (adjacent aces). We can assume the first and last card are adjacent to make the question easier.

How many distinct permutations exist of the 52-card deck?

My attempt:

Let us assume the first card is an ace of diamonds. We generally have $52!$ permutations for a deck of cards. However, since all suits are equal, we have $\frac{52!}{3!}$. All ranks are symmetrical, so we have $\frac{52!}{3!\times12!}$.

I'm not sure how to take into account the adjacent pairs rule.

P.S. I have almost no knowledge of combinatorics, I asked because of this answer by @RobWatts.

  • 1
    $\begingroup$ What do you mean by "all ranks are symmetrical"? Your example, A52343 and 5234A4, does not really make it all that clear what you are trying to say... $\endgroup$ – 5xum May 29 '15 at 8:47
  • $\begingroup$ @5xum I mean that if you have A52343, it basically means we have 5 different ranks, and then a card with the same rank as the fourth one. Same is true for 5234A4. $\endgroup$ – ghosts_in_the_code May 29 '15 at 8:49
  • $\begingroup$ Another example would be that AA2 and 226 are the same but AA2 and 266 are not. We are interested in only the order of the cards, and not the exact numbers on them. $\endgroup$ – ghosts_in_the_code May 29 '15 at 8:50

Ignoring your no neighboring pairs rule, and assuming that you have a unique starting point, there are $\frac {52!}{4!^{13}13!}=14778213400262135041705388361938994140625\approx 1.5\cdot 10^{40}$ permutations. The $52!$ is the number of orders of a complete deck. We divide by $4!=24$ for each rank, as we can put the four cards in any order. We divide by $13!$ for your equivalence of ranks-we can just list the ranks in the order of the first time we see each one.

I don't see an easy way to incorporate the neighboring pairs rule exactly. I will make the incorrect but probably not far wrong assumption that the event of one pair matching is independent of any other pair matching. The chance that one given pair matches is $\frac 3{51}=\frac 1{17}$ because having drawn the first card there are $3$ matching cards out of the remaining $51$ cards. The chance that a given permutation has no matches is then $(\frac {16}{17})^{52}\approx 0.042746$, giving about $6.3171\cdot 10^{38}$ permutations matching your requirements.

  • $\begingroup$ So there are still too many for brute-force. Maybe you could try getting the exact answer, but I don't need it, the approximation is enough. $\endgroup$ – ghosts_in_the_code May 30 '15 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.