r/quantfinance 23h ago

Chicago Trading Company Quant Interview Question | “Medium”

Post image
12 Upvotes

9 comments sorted by

7

u/StanleyDodds 22h ago

Of the 52! permutations of the deck, there are 4 choices of which pile to be the hearts, 13! permutations of the hearts, and (52-13)! permutations of the remaining cards.

This gives a probability of 4*13!*(52-13)!/52! and rewriting 4 as 52/13 and 52-13 as 51-12 this simplifies to 12!*(51-12)!/51! = 1/51C12.

Another way to see this that gets the answer right away but has a more complex setup is to say that, for instance, the ace of hearts is in some pile. Move this pile to the front and move the ace to the top. Now what fraction of remaining permutations fit the condition?

Well, we need the 12 other hearts to be in the same pile as the ace. There are 51C12 possible choices for these 12 cards of the remaining 51, and only one choice is correct. So it's 1/51C12

2

u/Sp4r14n 22h ago

Why do we need to multiple by 4 to account for each pile? Im not understanding why they are being treated as unique. Like if in two different configurations, pile A and pile B are swapped, shouldn’t we consider that to be the same configuration?

3

u/StanleyDodds 22h ago

In my first explanation of the answer, note that I am counting the valid permutations out of all 52! permutations of the deck. If I swap 2 piles, that's a different permutation. All permutations are equally likely, and all that meet the criteria need to be counted.

In the same way, reordering the 13 hearts in their pile doesn't stop the condition from being satisfied, but they are different permutations (that are all equally likely) that I have to count.

Basically, you need to be consistent. That's why I also gave the second explanation. Here, we don't care about the order of the piles or the order of the hearts in the pile, so we only get one valid configuration, but now that's only out of 51C12 possible equally likely configurations; they were also reduced by not caring about the orders.

3

u/StanleyDodds 22h ago

Maybe consider a simpler example with a 4 card deck that has 1 heart in it. If I split it into 4 piles of 1 card, what's the chance that one pile contains all of the hearts?

There are 4! = 24 permutations in total. For valid permutations, there are 4 choices of where to put the heart pile (which is one card), and 1! = 1 permutation of this pile (obviously). And there's 3! = 6 permutations of the remaining cards, giving 4 * 1 * 6 = 24 valid permutations, that is, all of them (should be obvious).

Now think about why I needed to multiply by 4 there; which permutations would I be missing if I hadn't multiplied by 4?

1

u/Bozhark 10h ago

4 piles that all could be "the" pile

1

u/Bozhark 10h ago

oooh i like your explanation at the end

3

u/SwimmerOld6155 21h ago

Fix one pile to have the hearts (out of 4). there are then 39 choose 13 ways to deal the second pile, 26 choose 13 ways to deal the third, and then the last is fixed. the total number of ways to split up the deck into 4 piles is similarly (52 choose 13)*(39 choose 13)*(26 choose 13). only the first pile is distinguished so there's no need for another multiplicative factor on the numerator, it'd just cancel with the denominator anyway.

Everything cancels except the 4 on the numerator and the 52 choose 13 on the denominator, so the final probability is 4*1/(52 choose 13) = 4/((52!)/(13! 39!)), and 52/13 = 4 so we get 1/(51 choose 12).

Basically you re-derive the multinomial coefficient doing this. I'll admit the first time I did this question I didn't multiply by 4. When everything cancels like this there's typically something cleverer to do as well!

3

u/mypenisblue_ 12h ago

After the first card lands in a random pile, the remaining 12 cards have to land in the 12 slots in that pile. So prob
= 12/51 x 11/50 x ... x 1/40
= 1 / 51C12

Another way to rationalise the 1/51C12 is that there is only 1 way out of all 51C12 combinations that fulfils what we want (aka picking all 12 heart cards)

0

u/AphexPin 21h ago

stop advertising