11
$\begingroup$

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?

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – Mathaddict
    Dec 8, 2023 at 15:18
  • $\begingroup$ 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). $\endgroup$ Dec 9, 2023 at 9:14

10 Answers 10

29
$\begingroup$

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.

$\endgroup$
7
  • $\begingroup$ 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? $\endgroup$
    – Darrel
    Dec 7, 2023 at 15:00
  • 1
    $\begingroup$ @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). $\endgroup$ Dec 7, 2023 at 15:26
  • 5
    $\begingroup$ +1 for including the simpler approach. $\endgroup$
    – RLH
    Dec 7, 2023 at 22:51
  • 3
    $\begingroup$ 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%. $\endgroup$
    – hobbs
    Dec 8, 2023 at 8:21
  • 1
    $\begingroup$ @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! $\endgroup$
    – DJ.
    Dec 9, 2023 at 4:37
8
$\begingroup$

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.

$\endgroup$
1
  • 2
    $\begingroup$ 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)" $\endgroup$
    – Stef
    Dec 8, 2023 at 15:36
4
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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! ? $\endgroup$
    – Darrel
    Dec 7, 2023 at 12:13
  • 1
    $\begingroup$ 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. $\endgroup$ Dec 8, 2023 at 10:37
3
$\begingroup$

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}.$$

$\endgroup$
1
  • $\begingroup$ Especially Lime suggested this way. $\endgroup$
    – Bob Dobbs
    Dec 8, 2023 at 22:16
1
$\begingroup$

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).

$\endgroup$
5
  • $\begingroup$ 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. $\endgroup$
    – Carsten S
    Dec 9, 2023 at 12:56
  • $\begingroup$ @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). $\endgroup$
    – pyrocrasty
    Dec 10, 2023 at 3:03
  • $\begingroup$ Read from "However, a simple way to get this is as follows." $\endgroup$
    – Carsten S
    Dec 10, 2023 at 8:21
  • $\begingroup$ @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.) $\endgroup$
    – pyrocrasty
    Dec 11, 2023 at 0:05
  • $\begingroup$ I fully understand. Your first sentence rubbed me the wrong way, but that’s also on me. $\endgroup$
    – Carsten S
    Dec 11, 2023 at 14:47
1
$\begingroup$

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}$.

$\endgroup$
0
$\begingroup$

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}$$

$\endgroup$
0
$\begingroup$

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$$

$\endgroup$
-1
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – Carsten S
    Dec 10, 2023 at 11:47
-2
$\begingroup$

None of these are correct, in my opinion for the following reasons: First, consider what is the probability(P) of just one of the jokers being in "either" one of two groups? If each of the two groups have 2 jokers (favorable outcomes) of the total 54 cards (total possible outcomes), divided into two groups of 27 in each group, then your setup for that P would be 2/27 + 2/27 = 4/27. (In an "either"/ "or" probability situation, you add the probability ratios to arrive at the P.) So logically, the P could never be greater than this as you restrict the outcomes more and more; instead, the P is "exponentially" decreased, not by dividing by 3 or by dividing by anything else! So in the above example, now consider the same scenario of only two groups, but instead of just one joker being in one of the groups, you are restricting your outcome of both jokers appearing in only one of the groups. Now your probability has just diminished, not by 1/2, but "exponentially" by the P of the one, 2/27 multiplied by the its occurrence in the second one, so now you have 2/27 x 2/27 = 4/27 x 27. So as you limit or restrict your outcomes more and more, your probability of your "favorable" outcomes is less likely to occur, not more, right? This is why the above answers are not logical, much less not correct. Any additional conditions/ limitations/ restrictions you add to a P problem, know that your final outcome, the least likely to occur, can never exceed the most likely outcome, that being one of the highest probabilities to occur, that being in this scenario, 2 jokers out of 54 cards, 2/54 = 1/27.

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – Carsten S
    Dec 9, 2023 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .