# Selecting $2$ cards from a full deck of cards.

I thought of a problem earlier and I am quite clueless on how to solve it, or begin solving it, because I cannot find a way to easily compute the amount of combinations of $$2$$ cards that sum to a certain value $$x$$. Anyway, the first part of the problem is as follows

We have a full deck of $$52$$ cards, and randomly select $$2$$ cards from this deck. We look at the cards and compute the sum of the values of the cards, ace being $$1$$ and K, Q and J being $$13$$, $$12$$ and $$11$$ respectively. We then shuffle the cards back into the deck and randomly select $$2$$ cards once more. What is the probability that the sum of the value of these $$2$$ cards, is the same as the sum of the values of the first $$2$$ selected cards?

This brought me to think of another problem, which is comparable. It is as follows

Let's say we have a full deck of $$52$$ cards, we randomly select $$2$$ cards, and we do this twice, yielding $$2$$ sets of $$2$$ cards. What is the probability that the sum of the values of the cards in the first set, equals the sum of the values of the cards in the second set?

Again, I'm quite confused about this problem, because I cannot think of an easy way to compute the amount of possible configurations of two cards, that sum to some value $$x$$.

Any help on solving these problems is appreciated. Furthermore, what would be a good guesstimate for these probabilities that could be given without any computations?

• Have you tried to work out the number of combinations for any specific sums? How many combinations add up to $2?$ What about $3?$ Try a few examples and look for pattern. – saulspatz Feb 17 at 17:34
• I'm thinking a decent guesstimate is in the area of $1/338 = 1/(2 \cdot 13^2)$. – Robert Shore Feb 17 at 17:35
• @robjohn As a guesstimate or as a result of a computation? – S. Crim Feb 17 at 18:29
• @S.Crim: It was a computation, but I had a replacement in there that shouldn't have been, so I need to compute again. – robjohn Feb 17 at 18:35
• @saulspatz I've managed to solve the first problem, but am now stuck on the second problem because it is confusing to me what happens when the sum is unknown. – S. Crim Feb 17 at 18:36

For an interview, I'd try to compare the second scenario to the first.

Say that you draw $$6$$ and $$3$$ the first time. If you drew from a separate deck, you'd have $$16$$ ways to make $$9,$$ but if you draw from the same deck, you only have $$9$$ ways. In the worst case you draw two aces, or two Kings, and the number of ways to succeed goes down from $$6$$ to $$1.$$ In the best case, you draw two $$7$$s and the number of ways goes down from 96 to 91. $$102$$ to $$97$$.

Of course, the better cases, near the middle will occur more frequently than the worse cases, near the ends, so I would guess that the probability of success in the second case might be about $$\frac34$$ of the probability of success in the first case.

Drat! Now I'm going to have to work them out and see how close I came.

EDIT

In response to the OP's that we don't have an explicit answer for the first problem either, in an interview, I would do the same kind of estimation. There are $${52\choose2}={52\cdot51\over2}\approx 1300$$ ways to chose two cards. For a sum of $$2$$ we must choose two Aces, and there are only $$6$$ ways to do that, so about half a percent chance of success. If the sum is $$14,$$ we have $$102$$ chances of success, so around $$8\%.$$ Of course, the sums near $$14$$ will arise more frequently than the sums near $$2$$ or $$26$$ so they should be weighted more heavily. I'd guess around $$5$$ percent.

With one deck, the probability of success is $${328888\over6497400}\approx .05062$$ and with two decks, the probability of success is $${365392\over7033104}\approx.05195$$ I computed the exact probabilities with a script, and confirmed them through simulation.

• Hah! That sounds good. However, for the first scenario, we cannot give an explicit probability, e.g. 60%, right? Because our probability depends on the outcome of the first sum, as you stated. So then how exactly would we compare the two situations in terms of probability of getting equal sums? – S. Crim Feb 17 at 20:30
• @S.Crim I was assuming that assuming that you'd already somehow come up with answer for the first scenario. In one of your comments, you said "I've managed to solve the first problem." I'll add some more to my answer. – saulspatz Feb 17 at 21:38
• Yeah I solved the first problem to the point where, knowing the outcome of the sum, I can compute the probability of drawing this sum again after reshuffling the drawn pair back in. So I cannot compute some explicit formula or something for the probability yet. – S. Crim Feb 17 at 21:56

Hint:

$$\begin{array}{|l|l|l|l|l|l|l|l|l|l|l|l|l|l|} \hline + & \color{red}{1} & \color{red}{2} & \color{red}{3} & \color{red}{4} & \color{red}{5} & \color{red}{6} & \color{red}{7} & \color{red}{8} & \color{red}{9} & \color{red}{10} & \color{red}{11} & \color{red}{12} & \color{red}{13} \\ \hline \color{red}{1} & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline \color{red}{2} & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline \color{red}{3} & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 \\ \hline \color{red}{4} & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 \\ \hline \color{red}{5} & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 \\ \hline \color{red}{6} & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 \\ \hline \color{red}{7} & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 \\ \hline \color{red}{8} & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 \\ \hline \color{red}{9} & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 \\ \hline \color{red}{10} & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 \\ \hline \color{red}{11} & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 \\ \hline \color{red}{12} & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 \\ \hline \color{red}{13} & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 \\ \hline \end{array}$$

The row of red numbers is the possible values for the 1st card, the column of red numbers is the possible values for the 2nd card. How many ways are there to get, say, a total sum of $$9$$?

• I see, very helpful. This is probably a good tool for me to try and find the solution. Thanks alot! – S. Crim Feb 17 at 18:14
• This allowed me to find the solution to first scenario, but I'm still stuck on the second one. Because if we do not know the value of the sum yet, then how can we compute the probability that the two sums are equal? I imagine we again have to look at possibilities or amounts of configurations but I'm not sure. – S. Crim Feb 17 at 18:20
• Use the Law of Total Probability. – Graham Kemp Feb 18 at 22:46

On the problem you thought about

We select cards $$c_1, c_2, c_3, c_4$$ from the same deck; there are $$U:=52\cdot 51\cdot 50\cdot 49= 6497400$$ possible cases, and we wish to count the cases for which $$N(c_1)+N(c_2)=N(c_3)+N(c_4) \label{eq1}\tag{1}.$$

Let $$V$$ denote the count of cases that satisfy $$(\ref{eq1})$$, and let us start by figuring out how many cases there are that satisfy $$N(c_1)+N(c_2) =n= N(c_3)+N(c_4),\label{eq2}\tag{2}$$ for some fixed $$n$$:

As robjohn says, there are $$W(n)=208-16\,|n-14|-4\,[\,2\mid n\,]$$ ways we can select $$c_1, c_2$$ so that they sum to $$n$$. (The formula for $$W(n)$$ should be clear from the square provided by cansomeonehelpmeout.) Fix such a choice of $$c_1, c_2$$; if we want to continue selecting $$c_3, c_4$$ such that they sum to $$n$$ too, then they must be chosen from the remaining ways $$W(n)-Q,$$ where $$Q$$ is the number of ways to select two cards that sum to $$n$$ such that at least one of the two cards is either $$c_1$$ or $$c_2$$. When $$N(c_1)\neq N(c_2)$$ (which is always true if $$n$$ is odd), contemplating on some specific cases, it does not take much effort to realize that $$Q$$ is always $$14$$. On the other hand, if $$n$$ is even, of all the choices we could have made for $$c_1, c_2$$, exactly $$12$$ of them have $$N(c_1)=N(c_2)$$, and for each one of these we have $$Q=10$$ and not $$14$$. Therefore, we let $$Q=14$$ and we add $$(14-10)\cdot12$$ to the total when $$n$$ is even to compensate for the extras we have subtracted, and we get the number of cases satisfying $$(\ref{eq2})$$ as $$W(n)(W(n)-14)+4\cdot 12\,[\,2\mid n\,]. \label{eq3}\tag{3}$$

All we need to do now is to sum $$(\ref{eq3})$$ over all possible $$n$$: $$V=\sum_{n=2}^{26}\left(W(n)(W(n)-14)+4\cdot 12\,[\,2\mid n\,]\right).$$ The probability that we get $$(\ref{eq1})$$ will then be: $$\frac{V}{U}.$$

Note: The computation by hand is time consuming. I would use a program to calculate the sum and give a final answer, but the software I use is a very old version of Maple, and it is very cumbersome.

Ways to draw $$n$$ with $$2$$ cards: $$W(n)=\overbrace{208-16\,|n-14|}^{16\,(13-|n-14|)}-4\,[\,2\mid n\,]$$ That is, there are $$13-|n-14|$$ ways to choose $$1\le a,b\le13$$ so that $$a+b=n$$. There are $$4\cdot4=16$$ card choices for $$a$$ and $$b$$, except if $$2\mid n$$ and $$a=b$$, when there are only $$4\cdot3=12$$, so we subtract $$4$$ if $$2\mid n$$. $$\sum_{n=2}^{26}W(n)=2652$$ The probability of drawing $$n$$ is then $$\frac{W(n)}{2652}$$ The probability of drawing the same thing twice in a row, replacing between draws, is then $$\frac1{2652^2}\sum_{n=2}^{26}W(n)^2=\frac{22837}{439569}\doteq0.051953$$

• Thanks alot for the answer. Could you elaborate a little more on the formule you gave for $W(n)$? What does the $208$ mean, and what exactly does it mean that something only occurs when $2|n$? Perhaps I am just unfamiliar with notations. – S. Crim Feb 18 at 15:08
• @S.Crim: I have hopefully made the explanation better. – robjohn Feb 19 at 8:05
• Thanks alot, that indeed clarifies some things. – S. Crim Feb 19 at 14:45
• @S.Crim: Is something still unclear? $[\dots]$ are Iverson Brackets and $a\mid b$ means that $a$ divides $b$; e.g. $[\,2\mid n\,]$ is $1$ when $n$ is even and $0$ when $n$ is odd. – robjohn Feb 19 at 15:05
• I think I get it now, yeah. Thanks for the clarifications on the notation. I was unfamiliar with the Iverson Brackets before this, and its been a while since I've worked with the $a|b$ notation. Thanks alot! – S. Crim Feb 19 at 17:45