# If a deck of 54 cards (including 2 jokers) is evenly split into 3 groups of 18, what is the probability that any one group contains both jokers?

I was just asked this interview question on combinatorics:

A deck of 54 cards (includes 2 jokers) are split into 3 equal groups of 18. What is the probability of any single group having both jokers?

I only had time to think of a solution post-interview, but please check whether my answer is correct:

$$P = \frac{\text{Ways to form group with 2 jokers} \times \text{Ways to form 1st non-joker group} \times \text{Ways to form 2nd non-joker group}}{\text{Ways to form 3 equal groups}}$$

$$P = \frac{{2 \choose 2}{52 \choose 16} \times {36 \choose 18} \times {18 \choose 18}}{{54 \choose 18}{36 \choose 18}{18 \choose 18} / 3!}$$

I'm not sure whether I need to divide by $$3!$$ in the denominator, since it seems the numerator will also have this and it cancels out?

• Note that you don't say that the splitting into 3 equal groups is random. You could make the probability almost anything you want if it's not random. Dec 8, 2023 at 15:18
• I find the phrasing of the question almost voluntarily ambiguous. If "any single" were "a single" or "any", it would clearly be asking for the probability that either the first, second, or the third group contains the two jokers. With "any single" it seems to be interested in a given previously selected group (so a probability one third of the former interpretation), but without clearly saying so (as could be done by adding "given", or simply by talking about the third group). Dec 9, 2023 at 9:14

As Shreya says, you are out by a factor of 2. Another way to see this is that $$\frac{\binom22\binom{52}{16}\binom{36}{18}\binom{18}{18}}{\binom{54}{18}\binom{36}{18}\binom{18}{18}}$$ is the probability that when you divide the cards into three ordered groups, the jokers are both in the first group. Since there are three groups the jokers could be in, you need to multiply this by $$3$$ (not $$3!$$). Of course you can simplify the above to $$\frac{\binom{52}{16}}{\binom{54}{18}}=\frac{17\times 18}{54\times53}=\frac{17}{53\times 3},$$ so the answer is $$17/53$$.

However, a simple way to get this is as follows. We'll shuffle the cards and then put the first $$18$$ in the first group and so on. Wherever the first joker is, $$17$$ of the remaining $$53$$ places are in the same group. Since the other joker is equally likely to be in any of the $$53$$ possible places, it has probability $$17/53$$ of being in the same group.

• Your explanation is intuitive, but I have trouble generalizing this. I understand the denominator is divided by 3! and the numerator by 2! because we want the groups to be unordered, but why isn't the numerator also divided by 3! ? How do I know what factorial to divide by for other problems? Dec 7, 2023 at 15:00
• @Darrel I find it easier to treat the groups as ordered, and then you need to multiply the numerator by 3 because the jokers could be in any of the three groups. But if you are treating them as unordered, then the denominator has three interchangeable groups, so you need to divide by $3!$, whereas the numerator only has two interchangeable groups (the one with the jokers in being different). Dec 7, 2023 at 15:26
• +1 for including the simpler approach.
– RLH
Dec 7, 2023 at 22:51
• Even more intuitively, and useful for checking answers: one card out of 54 is "not much", so the answer should be "about a third". Wherever the first joker is, the other joker is in each of the three groups with almost equal probability. The deck has to have fewer than 24 cards before the true answer becomes less than 30%. Dec 8, 2023 at 8:21
• @hobbs Oh ok so the existence of the first joker in a group slightly reduces the chance the second one will be in the same group I get it now thanks!
– DJ.
Dec 9, 2023 at 4:37

I'm not sure whether I need to divide by 3! in the denominator, since it seems the numerator will also have this and it cancels out?

If you're in a rush (and sometimes even if not), it can be very helpful to be able to make a quick estimate. In this case, you can choose one joker arbitrarily and say that whatever group it is assigned to, there is approximately a 1/3 chance that the other is assigned to the same group. (Only approximately because there are 18 slots to choose from in the two other groups, but only 17 in the one to which the other joker is already assigned.)

Depending on the nature of the interview, "approximately 1/3" might even be a good final answer to the question, but if you want to compute the exact answer then such an estimate gives you a way to check your work. If you suppose that you otherwise worked the problem correctly, that would certainly tell you that dividing by 3! can't be right, but dividing by 3 might be.

• I completely argue with the argument that it's good practice to make quick estimates to be able to check the sanity of our work. Especially since the OP's formula with binomial coefficients is quite long, so it would be extremely easy to forget a factor or count a factor twice, and when typed into a calculator it can easily contain typos. Funnily enough your approximation and the parenthesized comment that follow it immediately already give the exact answer. You're basically saying "the answer is approximately 1/3 (only approximately because the exact answer is 17/53, not 18/54)"
– Stef
Dec 8, 2023 at 15:36

There is a minor error in your logic. The denominator must be divided by $$3!$$ as you are counting each way $$6$$ times in different orders, that part is correct. Similarly, you have to divide the numerator by $$2!=2$$ as the first and second non-joker groups are not distinct. They are interchangeable and counted twice in different orders.

This is, of course, assuming that the groups are not distinct. If they are, then the answer will be different.

• I'm trying to understand the 2! part further: Is the number to factorial + divide by always equal to the number of interchangeable groups? So 8 groups of same size would need to be divided by 8! ? Dec 7, 2023 at 12:13
• Yes. If you have to divide 8n objects into 8 groups of n each, then you will have to divide by 8! as they are interchangeable. Dec 8, 2023 at 10:37

We have $$3$$ groups of size $$18$$. The probabilty of the first joker being in the first group is $$\frac{18}{54}$$ and the probabilty of the second joker being in the first group is $$\frac{17}{53}$$. Hence the probabilty of the both jokers being in the first group is $$\frac13\times\frac{17}{53}=\frac{17}{159}.$$ Similarly for the second and the third groups. Therefore, the probabilty of the both jokers being in the same group is $$3\times\frac{17}{159}=\frac{17}{53}.$$

• Especially Lime suggested this way. Dec 8, 2023 at 22:16

This is actually simpler than the answers here are making it. Looking at the question a different way, we want the probability that both jokers are in the same group of 18 cards.

Call the jokers J1 and J2. J1 is in one of the three groups: call this Group_1.

Now we just want the probability that J2 is in Group_1. But this is just 17/53 (there are 17 spots left in Group_1 and 53 cards left in the deck).

• If you read the top-voted answer to the end you will find the same argument. And it also answers the actual question, which is whether the OPs reasoning is correct. Dec 9, 2023 at 12:56
• @Carsten S: The top voted answer starts with the expression $3\times\frac{\binom{2}{2}\binom{52}{16}\binom{36}{18}\binom{18}{18}}{\binom{54}{18}\binom{36}{18}\binom{18}{18}}$ and simplifies to $3\times\frac{\binom{52}{16}}{\binom{54}{18}}$ before arriving at the answer. It's not the same argument at all. As for addressing the OP's reasoning, other answers have already covered that (as you just pointed out yourself). Dec 10, 2023 at 3:03
• Read from "However, a simple way to get this is as follows." Dec 10, 2023 at 8:21
• @Caarsten S: Oh, okay. Sorry, you're right. I was skimming the answers and must have missed that part. (I wouldn't have expected to find the simplest solution tacked on the end of a more complicated one like that.) Dec 11, 2023 at 0:05
• I fully understand. Your first sentence rubbed me the wrong way, but that’s also on me. Dec 11, 2023 at 14:47

A major issue in combinatorics questions is keeping track of what states are considered "equivalent", and keeping that equivalence constant throughout all of the calculations. In this case, there's the question of whether swapping groups results in an "equivalent" situation. That is, if you pick up all the cards that were in the first group and put them in the second group, and take all the cards that were originally in the second group, and put them in the first group, have you meaningfully changed the situation?

When you divide by 3! in the denominator, you are implying that you are treating these as being the same situation; since permutating the groups results in essentially the same situation, you divide out by the number of permutations to get the number of equivalence classes. But if you're considering those as being equivalent, then you also have to consider the permutations of the non-Joker groups, and thus you need to divide the top by 2! (there are two non-Joker groups, so there are 2! ways of permuting them).

You could have also not have divided out by these equivalences, in which case you should not have the 3! on the bottom, and you should multiply the top by 3 (there are three different groups that the Jokers could be in). Either will get the right answer, you just have to be consistent.

Especially Lime's last paragraph basically introduces even more equivalences, treating the location of all non-Jokers as irrelevant. In a way, going the other direction and having no equivalences makes the answer even easier to see. There are 54 places the first Joker could be, and once you choose a place for it, there are 17 places that would result in the second Joker being in the same group. There are then 52! places for the remaining cards. This results in

$$\frac{54*17*52!}{54!}$$

and with a little math this reduces to $$\frac{17}{53}$$.

Another (possibly easier) way:

• $$54!/2$$ is number of permutations of all cards
• $$(18\cdot 17)/2$$ is number of permutations of jokers in first $$18$$ cards
• terms are divided by two because two jokers are the same
• $$52!$$ is number of permutations of all non-joker cards

$$3 \cdot \frac{(18\cdot 17)/2 \cdot 52!}{54!/2}=\frac{17}{53}$$

This is redundant, but just in case it's useful: it seemed natural to me to work it out this way (which is exactly what Bob Dobbs did, but with a tiny bit of formal probability notation):

$$P(\text{1st joker}) = 18/54$$

$$P(\text{2nd joker} | \text{1st joker}) = 17/53$$

$$P(\text{both jokers}) = P(\text{2nd joker} | \text{1st joker}) P(\text{1st joker}) = 17/53 * 18/54$$

$$P(\text{both jokers in any group}) = 3 * P(\text{both jokers}) = 17/53$$

I'm not very mathy so downvote away for a lack of greek letters and integrals and such, but this seems like a lot of overthinking. Assuming random distribution and given the simplicity of the scenario, you have a total of six possible outcomes pertaining to the location of the two jokers. Three have a joker card in two groups. Three have one group in possession of both jokers:

$$\begin{array}{c|c|c|} & \text{Group A} & \text{Group B} & \text{Group C} \\ \hline \text{1} & 1 & 1 & 0 \\ \hline \text{2} & 1 & 0 & 1 \\ \hline \text{3} & 0 & 1 & 1 \\ \hline \text{4} & 2 & 0 & 0 \\ \hline \text{5} & 0 & 2 & 0 \\ \hline \text{6} & 0 & 0 & 2 \\ \hline \end{array}$$

If the question intended to ask of all possible distributions of two jokers between three groups, how likely is it that a given distribution involves a group holding both jokers, then the probability is 50% (3 of 6).

If the question intended rather to ask from the perspective of a selected group, what is the probability of that group being the one to possess both jokers, then the probability is 1/6.

Either way, even if it's mathematically correct, your solution would probably be "wrong" in the sense that it obfuscated a simple calculation, to the point where you confused yourself. I imagine the person conducting your interview was probing whether you could/would reduce a seemingly complex problem to a simpler one, akin to determining why a car won't move: did you disassemble the engine before checking to see if the key was in the ignition and the gear wasn't in neutral? Hmm. And also, clarifying/identifying the actual problem you mean to solve is usually good first step.

• Have a look at the last paragraph of the answer by Especially Lime. It contains a simple solution without Greek letters or integrals or such. It is also correct. Your solution of 1/2 (50%) is wrong. Even if we allow for an approximate solution just treating the size of the pack as “large” instead of 54, we should get $1/3$. This is because the first three rows in your table are approximately twice as likely as the last three rows. Dec 10, 2023 at 11:47

• I don’t know what you’re trying to say here. But seeing the $4/27$ near the beginning it seems that for 8 instead of 54 cards you would have arrived at a probability of $4/4$ at that point for the event that you are considering there (I didn’t understand what it was). That should suffice for you to convince yourself that what you are doing is wrong. Dec 9, 2023 at 16:59