# Card game: If I draw four cards randomly and you draw six, what is the probability that my highest card is higher than your highest?

As stated in the title, say if I draw randomly 4 cards and you draw 6 from the same deck, what is the probability that my highest card beats your highest card?

How will this change if we draw from different decks?

Thanks!

• Is this a home work? – Aksakal Sep 8 '15 at 17:34

This simple question has a complicated answer. The complications are due to two factors:

1. The cards are drawn without replacement. (Each draw therefore changes the contents of the deck that are available for subsequent draws.)

2. A deck usually has multiple cards of each value, making a tie for the highest card possible.

Since complications are inevitable, let's address a reasonably broad generalization of this problem and then look at special cases. In the generalization, a "deck" consists of a finite number of cards. The cards have $m$ distinct "values" that can be ranked from lowest up to highest. Let there be $n_i \ge 1$ of the values that are ranked $i$ (with $i=1$ the lowest and $i=m$ the highest). One player draws $a\ge 0$ cards from the deck and a second player draws $b\ge 1$ cards. What is the chance that the highest ranked card in the first player's hand is strictly greater in value than the highest ranked card in the second player's hand? Let this event be called $W$: a "win" for the first player.

One way to figure this out begins by noting that the procedure is equivalent to drawing $a+b$ cards from the deck, taking the first $a$ out of those to be the first player's cards, and the remaining $b$ to be the second player's cards. Among these cards let $j$ be the highest value and let $k \ge 1$ be the number of cards of that value. The first player wins only when she holds all $k$ of those cards. The number of ways in which those particular cards can be found among $a$ cards is $\binom{a}{k}$, while the number of ways of positioning those $k$ cards among all $a+b$ that were drawn is $\binom{a+b}{k}$.

Now the chance that $j$ is the highest value and there are $k$ such cards is the chance of selecting $k$ out of $n_j$ cards of value $j$ and selecting the remaining $a+b-k$ out of the lower $n_1 + n_2 + \cdots + n_{j-1} = N_{j-1}$ values. Because there are $\binom{N_m}{a+b}$ equiprobable draws of the $a+b$ cards, the answer is

$$\Pr(W) = \frac{1}{\binom{N_m}{a+b}}\sum_{j=1}^m \sum_{k=1}^{n_j} \frac{\binom{a}{k}}{\binom{a+b}{k}}\binom{n_j}{k}\binom{N_{j-1}}{a+b-k}.$$

(In this expression, $N_0=0$ and any binomial coefficient whose top value is less than its bottom value, or whose bottom value is negative, is taken to be zero.) It's a relatively efficient calculation, taking time proportional to the number of cards in the deck. Because it involves binomial coefficients exclusively, it is amenable to asymptotic approximations for large values of $a$ and $b$.

In some cases you might want to modify the definition of a "win". This is readily done: by interchanging the values of $a$ and $b$, the same formula calculates the chance that the second player wins outright. The difference between $1$ and the sum of those two chances is the chance of a tie. You may assign that chance of a tie to the players in any proportion you like.

In many conventional decks of playing cards $m=13$ and $n_i=4$ for $i=1, 2, \ldots, m$. Let us therefore consider any deck in which all the $n_i$ are the same value, say $n$. In this case $N_{j-1} = (j-1)n$ and the preceding formula simplifies slightly to

$$\Pr(W) = \frac{1}{\binom{m n}{a+b}}\sum_{k=1}^{n}\frac{\binom{a}{k}}{\binom{a+b}{k}}\binom{n}{k}\sum_{j=1}^m \binom{(j-1)n}{a+b-k}.$$

For instance, with $m=13$ and $n=4$ in a common 52 card deck of 13 ranks, $a=4$, and $b=6$, $\Pr(W) = \frac{12297518}{38720339}\approx 0.3176$. A simulation of 100,000 plays of this game produced an estimate of $0.3159$, which is precise to almost three significant figures and not significantly different from what the formula states.

The following R code is easily modified to estimate $\Pr(W)$ for any deck: simply change a, b, and deck. It has been set to run only 10,000 plays, which should take less than a second to execute and is good for two significant figures in the estimate.

a <- 4
b <- 6
deck <- rep(1:13, 4)
set.seed(17)
cards <- replicate(1e4, sample(deck, a+b))
win <- apply(cards, 2, function(x) max(x[1:a]) > max(x[-(1:a)]))
m <- mean(win)
se <- sqrt(m*(1-m)/length(win))
cat("Estimated Pr(a wins) =", round(m, 4), "+/-", round(se, 5), "\n")


The output in this instance is

Estimated Pr(a wins) = 0.3132 +/- 0.00464

• great answer! Can I ask what you think if each player draws from a different deck -- will this change the answer？ – Wudanao Sep 8 '15 at 19:02
• Yes, it will change the answer because what one person draws will be independent of what the other player draws. In some ways that is an easier question, because the answer is a straightforward calculation of the chance that one random variable exceeds the value of another that is independent of it. – whuber Sep 8 '15 at 20:43
• Note that, if there weren't any ties, the answer would trivially be $\frac{a}{a+b}$: out of the $a+b$ cards drawn, one must be highest, and its chance of ending up in the first player's hand is $a$ out of $a+b$. But as you note, the presence of multiple cards with the same value in the deck complicates things. – Ilmari Karonen Sep 8 '15 at 23:03
• @Ilmari That's right. (And it's this insight that originally suggested the solution I presented.) With no ties, $n_i=1$ always, the sum of $k$ goes away, and the fraction $\binom{a}{k}/\binom{a+b}{k} = \binom{a}{1}/\binom{a+b}{1} = a/(a+b)$ factors out, showing how the general formula reduces to this simple one. – whuber Sep 8 '15 at 23:11
• @WernerCD True, but that effect has been explained: if the suits have a ranking, then there are no ties, and so the formula reduces to what limari's comment describes. – Brilliand Sep 9 '15 at 3:10