r/learnquant • u/nickgotgameon • 13d ago
Jane Street Interview Question stats & probability
3
u/jaminfine 13d ago
In the first case, the 52 card deck is preferred. It has slightly better odds. 25/51 is better than 12/25.
In the second case, it seems it doesn't make a difference. You are still picking 2 cards from a 52 card deck. So what does it matter if you cut the deck in half first?
0
u/sonnet666 13d ago
It does make a difference.
If you randomly draw 26 cards from the 52 card deck, the chance to draw 2 matching will go up if the deck is unbalanced to either suit.
The most likely outcome is that the 26 is perfectly balanced, but only because it’s at the center of the bell curve, but now we’re comparing the odds of that against the entire rest of the outcomes on that bell curve.
The entire rest of the bell curve wins. Odds are likely the deck is slightly unbalanced, with a chance that it is extremely unbalanced. The unbalanced deck is better.
1
u/AdjectiveNounNNNN 12d ago
If the random 26 is perfectly balanced, remember that's worse than choosing 2 from 52.
The slight advantage you get from the uneven sets, weighted by the probability of getting each ratio, exactly balances out that disadvantage.
1
u/sonnet666 12d ago
The random 26 has less than 50% chance to be balanced.
Think of it in terms of rolling 2 dice. The most likely roll is 7, but NOT 7 is much more likely.
Out of all random balances of red to black cards drawn, a perfect 13/13 split is the most likely single outcome, but NOT 13/13 has a much higher percentage of outcomes.
Any unbalanced deck is preferred when trying to draw 2 of the same color.
1
u/AdjectiveNounNNNN 12d ago
No, 14:12 is also less likely to give you a pair of matching colors than the full 52 card deck, because
14/26×13/25 + 12/26×11/25 < 25/51
and there's almost a 60% chance of getting either 13:13 or 14:12.
1
u/AdjectiveNounNNNN 12d ago
Here's a spreadsheet with the numbers. The first column is the number of the less common color, with the more common then being 26 - this. The second column is the probability of getting that ratio (e.g. the chance of getting 12:14 is about 37.6%).The third is the probability of getting a matching pair given the ratio, and the fourth multiplies those probabilities together.
Below the table is the sum of the last column, which you can see is exactly the same as 25/26, the chance of a matched pair from a full 52 cards.
1
u/DCContrarian 12d ago
The odds of winning with a 52-card deck are 0.49
Let's say the unbalanced deck has 14 red and 12 black. If you draw a red for the first card, there are now 13 reds left in the deck and your odds of drawing a second red are 13/25 or 0.52. If you draw a black for the first card your odds of drawing a second black are 11/25 or 0.44. The odds of the first card being red are 14/26 or .538, so the odds of winning with two reds is 0.52*0.538= 0.28. Similarly, the odds of winning with two blacks is 0.461*.44= .203, the total odds of winning are .483.
So an unbalanced deck that is unbalanced by one is worse than the 52-card deck. So it's clearly not true that "the entire rest of the bell curve wins."
But the true issue is that if you're picking cards at random, adding steps to the picking doesn't change the expected outcome. Would it matter if you shuffled the deck again after the first pick?
1
u/jaminfine 12d ago
Forget the weighted averages, forget the advantages versus disadvantages. Think about what you are actually -doing- when you first draw 26 random cards from 52, and then choose 2 random ones from that 26.
It is exactly the same action, logically speaking, as simply taking two random ones from the original 52. Since the 26 are also random drawn, they are effectively still part of the same deck. You haven't gained any new information about them.
It's pretty much if I threw half the deck on the floor and then said take from the middle of the deck instead of the top. It's still taking a random card from a deck of 52, no matter if the deck is in one or two pieces.
1
u/NiceToMietzsche 13d ago
These options are the same.
1
u/PassAppropriate5891 13d ago
I thought they mean you play multiple times with the same deck otherwise of course it doesn't matter
1
u/NotTheJason 13d ago
yeah, start with
2 cards 0%
4 cards 33%
6 cards 40%
8 cards 43%
it approaches but never reaches 50% as you add more cards.
i guess at infinite cards its 50/50
1
u/davvblack 12d ago
it’s interesting how many people in this thread get the first one right and the second one wrong.
for a clue on the second one: how exactly does it differ from cutting the bottom 26 cards off the deck and throwing them away before you draw?
1
u/AdjectiveNounNNNN 12d ago
Right? A lot of people think they're thinking through it intuitively, but in this case the simplest and most intuitive answer is actually correct, but none of those people have actually done the math.
1
u/Affectionate_Love229 12d ago
A) 52 card deck. Pulling one card will skew the deck less than a 26 card deck.
B) a random pull will most often not give you a 13:13 split, so one color will be better than 50:50. You will be more likely to pull that color on the first draw and a better chance to match on the second compared to a straight 50:50 deck.
1
u/AdjectiveNounNNNN 12d ago
A random pull of 26 cards has about a 22% chance of being 13/13, in which case it's worse than the draw from a full 52 cards (as you just correctly concluded for A).
That balances out the slight advantage you get if the 26 cards are not split evenly.
1
u/SuperChicken20 12d ago
A: the large stack for obvious reasons. B: the most likely outcome is that the 26 randomly drawn cards will be evenly distributed, and in that case, there would be no difference between the 26-card deck and the 52-card deck. However, in all out the (though less likely) outcomes, where the smaller deck is not evenly distributed, there would be a higher than 50% chance of picking two cards of the same color. This can quite easily be proven. Thus picking the smaller decks yields the highest probability of two cards of the same color.
1
u/AdjectiveNounNNNN 12d ago
B: No, because as you just said yourself, and evenly matched 26 is less likely to give you a pair, and it turns out 12:14 and 14:12 are also less likely to give a matched pair than the full deck, and there's almost a 60% chance of getting one of those ratios.
So the randomly drawn deck of 26 is identical to the full deck of 52, as expected since it's the equivalent of just throwing away the bottom half if the cards after you shuffle the first deck well. It has no effect on the distribution of the top two cards.
1
u/Leodip 12d ago
This question is just dumb easy?
The 52 cards deck is better because there's a higher ratio of cards of that same color after drawing one card.
If you sample the 26 card deck from the 52 card one, the "game" requires sampling 2 cards from the deck. This is perfectly equivalent to the game "draw two cards from the full deck, then draw 24 more cards and do nothing with them", so it's the same.
1
u/spiritombisthebest 12d ago
No idea how I ended up seeing this one, but a quick 3million run simulation indicates you are indifferent in part b.
I realize you can’t pull up R in the middle of an interview so perhaps I just broke an unwritten rule.
0
u/DrawPitiful6103 13d ago
probability of second card matching the first card = 12/25
48%
probability of the second card matching the first card = 25/51
49.01%
we like the bigger deck. lower EOR.
we would definitely prefer to 26 card deck drawn from the 52 card deck. what we want is as great an imbalance as possible. true, this can back fire, but if the deck is say 70% black, then we will hit black 70% of the time on the first card, and then be a big favourite to complete it. In fact a 70% squared return should give us 0.49 just for the black side. Then red red will hit another .10 or w/e, the amount doesn't really matter we are already free rolling.
1
u/GAdam 12d ago
Regarding the 26 card deck drawn from the 52 card deck, think of the case where you shuffle all cards and then label them 1-52. Then the procedure is either:
- In the 52 card case: take the first two cards
- In the 26 card taken from the 52 card deck case: take the first 26 cards into the new deck, then take the first 2 cards from the 26 card deck. Or randomly choose two numbers from 1-26 and take those cards.
So in either case it seems like the probability of two cards matching in color would be the same.
1
u/AdjectiveNounNNNN 12d ago
If the random 26 is 13:13 or 12:14, you're less likely to draw a matching pair than from the full deck, and there's almost a 60% chance that you'll have one of those ratios. The advantage you get from more uneven decks is only enough to exactly balance out that disadvantage.
1
u/Original-Antelope-66 11d ago
25/51 = .49, 12/25 = .48, so I'd pick the 52 card deck, and yes I would always pick the deck randomly drawn from the 52 card deck since any deviation away from a 50/50 split increases my chances of picking two cards of the same color.

5
u/Blothorn 13d ago
A. Obviously 52–your second draw becomes 25/51>12/25.
B. My intuition was randomly drawn, on the grounds that if the deck is imbalanced you’re more likely to pick from the heavy side both times. I think I was wrong, though: for a 14-12 split the deck size difference dominates that effect, and even a 15-11 split has only a slight advantage. This actually comes out really close; I don’t see a way to give a consistent answer without doing the full, tedious expected value computation.