6

Given a random permutation of all 52 cards in a standard deck, what is the probability that it contains exactly one pair with the same rank? For example AA counts as one pair whereas AAA counts for two pairs. Cards with the same rank but different suits are considered different.

Say we make a pair from the 5s. We select a 5 and then we are left with a multiset with 3*(remaining cards with rank 5) and four cards for each of the other 12 ranks. Then we are tasked with counting one line permutations of these 51 cards with no adjacent ranks. After that we could choose where the selected 5 forms the pair, this would give all permutations with exactly one pair which is of rank 5.

I was aware that one can use the adjacency matrix for a directed graph to count such one line permutations, but in this case each node has to be visited a fixed (3/4) amount of times.

  • Wrong but perhaps close: the probability that a particular set of two cards have the same rank is $\frac{3}{51}=\frac{1}{17}$ so the expected number of pairs is $3$. With the false assumption these are independent, the probability of exactly one pair would be ${51 \choose 1}\frac{16^{50}}{17^{51}} \approx 0.145$ – Henry May 23 '25 at 09:47
  • What do you mean "cards with the same rank but different suits are considered different"? Of course $K\spadesuit$ and $K\diamondsuit$ are different cards...are you saying that $K\spadesuit K\diamondsuit$ would not be a valid $AA$ pair? – lulu May 23 '25 at 09:51
  • Ignoring that confusion, I would sample to get a sense. Then I would compute the variance of the desired number to get another estimate of the desired value. An exact computation is probably not in the picture. – lulu May 23 '25 at 09:54
  • What do you mean by “contain”? Are you asking about the fifty-one pairs of consecutive cards? If so, then you should edit your question to clarify that. – Paul Tanenbaum May 23 '25 at 09:55
  • K♠K♢ would be a valid pair, I intended to say that K♠K♢ would be different from K♢K♠. – electronic May 23 '25 at 09:55
  • Simulation suggests the $\approx 0.145$ is quite good. – Henry May 23 '25 at 09:58
  • No by contain I mean in the one-line permutation of the 52 cards there is exactly one occurence of 2 consecutive cards with the same rank. – electronic May 23 '25 at 09:59
  • Thank you for the estimates! I see that an exact computation might not be what I should look for. – electronic May 23 '25 at 10:05
  • 3
    I suspect the exact answer is $$\frac{10971520051677934201049084030392994189}{75785709744934025854899427497123046875} = 0.14477030153315068$$. I got this using this methods: https://math.osu.edu/sites/default/files/perfect%20shuffle.pdf except we calculate the generalized rook polynomial and then using it the generating polynomial of the amounts with $j$ hittings on the "forbidden board" using the formula $\sum_j c_j (52-j) (x-1)^j$, where $c_j$ are the coefficients of the rook polynomial. This seems to work for the generalized rook polys too! – ploosu2 May 23 '25 at 10:52
  • @ploosu2 It seems that you answered an earlier duplicate question at https://math.stackexchange.com/a/4909940/6460 – Henry May 23 '25 at 22:32
  • @Henry Ha, I had forgotten about that, thanks. I guess the "gluing" can be done generally with the formula I mentioned in earlier comment, btw (for usual rook polys) a combinatorial proof for it is given in this video: https://www.youtube.com/watch?v=mRKtv-IEkB4 – ploosu2 May 24 '25 at 04:05

1 Answers1

2

Wrong but perhaps close: the probability that a particular set of two cards have the same rank is $\frac{3}{51}=\frac{1}{17}$ so the expected number of pairs is $3$. With the false assumption these are independent, the probability of exactly one pair would be ${51\choose 1}\frac{16^{50}}{17^{51}}\approx 0.1447$.

Simulation of the number of pairs (so with some simulation noise) suggests this may be quite good. Using R:

set.seed(2025)
suits <- 4
ranks <- 13
cards <- rep(1:ranks, suits)
cases <- 10^6
countpairs <- function(){ sum(diff(sample(cards)) == 0) }
pairs <- replicate(cases, countpairs())
mean(pairs) # should be about suits-1
# 3.001516
table(pairs)/cases
# pairs
#        0        1        2        3        4        5        6        7 
# 0.045523 0.144438 0.225555 0.231106 0.173531 0.102360 0.048600 0.019503 
#        8        9       10       11       12       13       14 
# 0.006728 0.001965 0.000542 0.000123 0.000017 0.000007 0.000002 

which, when compared to the suggested binomial approximation (red points), would look like

simulations and approximation

using

plot(table(pairs)/cases)
points(0:max(pairs), dbinom(0:max(pairs), suits*ranks - 1, 
                           (suits - 1) / (suits*ranks - 1)), col="red")
Henry
  • 169,616
  • ploosu2's exact result of $0.14477030\ldots$ seems to confirm the binomial approximation of $0.14476858\ldots$ is very good. – Henry May 23 '25 at 11:00