# Dual 52 card deck, pair of exact card match (position and rank) probability

Suppose we have 2 well shuffled decks and alternately draw 1 card from each deck without replacement, placing the cards in a 2 deep 52 wide pattern, and looking for exact card matches between the 2 decks. For example, if at the 3rd pair of cards, we see K of spades in both decks, that is a single match between the decks.

What I am looking for is if we do this for the entire deck, what is the probability that at least 2 pairs of cards will match exactly between the 2 decks? For example, if the 3rd pair of cards are both K of spades and the 51st pair of cards are both 4 of hearts, now we have a "winning" combo that we are trying to count.

Note that if more than 2 pair of exact matches are found that is still considered a "win" and we want to count that. For example, if we see 3 pair of matching cards between the decks, we count that the same as if we saw only 2 pair of matching cards.

So what is the probability of this happening?

If that is too easy to solve, then as a bonus 2nd question, what is the probability that EXACTLY 2 pair of cards match between the 2 decks? Realize that any # of card pairs can match, including possibly all 52 pairs, but we only want to count the cases where EXACTLY 2 card pairs match.

Hint:

Assume without loss of generality that the first deck is in production order and only the second deck was well shuffled (decreasing the size of the sample space from $$(n!)^2$$ down to just $$(n!)$$).

Consider the opposite event, that either no cards match or exactly one pair of cards match.

Remember that no cards matching would be an example of a derangement which is a well studied special case of a permutation with formulas listed in the linked article. Next, try to come up with an expression for exactly one pair of cards matching. Combine these expressions to find the total number of ways you can have exactly zero or exactly one pair of cards matching and divide by the sample space size and subtract this away from $$1$$ to get the probability you were originally interested in.

To count the number of arrangements where exactly $$k$$ cards match:

• Pick the values of the $$k$$ cards which match simultaneously.

• Then, pick a derangement for the remaining cards

Apply multiplication principle and conclude.

$$\binom{52}{k}\times !(52-k)$$

This gives a final total probability of having at least two matches as being:

$$1 - \frac{!52 + 52\times !51}{52!}\approx 0.2642$$

• !52 is something like $2.967$ x $10^{67}$. – David Jan 17 at 2:06
• @David yes, and $52!$ is around $8.06\times 10^{67}$. You have $\frac{!n}{n!}\approx \frac{1}{e}\approx 0.3679$ for large enough $n$. – JMoravitz Jan 17 at 2:09
• @David: In fact, since $|!n - n!/e|\le 1/2$, the relative error in replacing $!n$ by $n!/e$ will be vanishingly small. So you can easily divide all your relevant counts by $50!$ and get a quite simple expression for an extremely good approximation to the true probability. – Henning Makholm Jan 17 at 2:13
• @David added more details. – JMoravitz Jan 17 at 2:17
• The above approximation leads to the fact that the probability of a random $n$-permuation having exactly $k$ fixed points is very close to $e^{-1}/k!$. Note that this expression does not contain an $n$. The approximation is valid as long as $k\ll n$ -- the relative error should be on the order of $1/(n-k)!$. – Henning Makholm Jan 17 at 2:25