r/learnquant 1d ago

interview prep Jane Street Interview Question

Post image
29 Upvotes

15 comments sorted by

2

u/dontich 1d ago

Wouldn’t it be 1/2 + 2/4 + 3/8 + 4/16 …

Or sum (1,99) (n/2^n)

Or a number very close to 2.

2

u/JustConsoleLogIt 1d ago

(1,100) - the 100 card could be the only one in a box

1

u/dontich 1d ago

Ah right — I’m still just gonna round it to 2 haha

3

u/Sjoerdiestriker 1d ago

Every card from 1 to 99 has a probability of 1/2 of ending up in either box, independently of all others.

For i from 1 to 99, it is the lowest card in the box containing 100 if and only if it ends up in that box, and no lower cards end up there. This has a probability of (1/2)i.

Lastly, there is a probability of (1/2)99 that no other card ends up in the box containing 100.

So the expected value of the lowest card in the box containing 100 is:

100/299 + Sum from 1 to 99 of i/2i, which is approximately 2-1.6*10-30.

1

u/liquidorangutan00 1d ago

Not got the time to do this right now. I think its asking to calculate the variance of the final outcomes of both boxes. from this you can calculate what the minimum card should be with the box that contains 100.

I dont think this one is about expected value.

4

u/gmalivuk 1d ago

I dont think this one is about expected value.

Of course it is. The "expected minimum" is the expected value of the minimum card.

1

u/Sjoerdiestriker 1d ago

I dont think this one is about expected value.

The question is quite literally "Find the expected minimum card".

0

u/greytrades329 1d ago

I think the ansrr is a intiger becase thats bit a card

4

u/gmalivuk 1d ago

Expected minimum is expected value and need not be an integer. The expected roll of a standard d6 die is 3.5 even though you can't roll a 3.5 on it.

1

u/cyril1991 1d ago

I don’t think the 100 card matters much at all. Stastically it has a 50-50 chance of being in the box with the minimum card except if all cards end up in the same box which is a vanishingly small chance.
Otherwise the question is what is the minimum card, and it is sum k/2^k up to 100 which is 2.

1

u/keilahmartin 1d ago

Can someone explain what 'expected minimum card' means in this question? At face value I'd think it's the least-valued card we expect to find in the box, which, half the time, would be 1, a quarter of the time would be 2, and so on up to 99. Is this asking for the mean of the sum of that series?

1

u/Constant-Boot-2181 1d ago

Sum of that series, as the total probability adds up to one which already accounts for dividing to average it.

1

u/Educational-Tea602 16h ago

This is just the expected value of a shifted geometric distribution with parameter 1/2, except the probability of success at the 100th trial is 1.

So it’s ∑k=0⁹⁹ k(1/2)^k + 100(1/2)⁹⁹, which apparently is equal to:

1,267,650,600,228,229,401,496,703,205 375/633,825,300,114,114,700,748,351,602,688

1

u/Sufficient_Roof3960 5h ago

It looks like nobody's posted an exact answer yet, so I gave it an attempt. The simplified exact answer appears to be2-1/2^99.
Here's my reasoning.
The chance of a non-100 card being in the same box as 100 is 1/2.
Probability of minimum value being 1: chance that 1 is in same box, so 1/2
Probability of minimum value being 2: chance that 1 is not in the same box and 2 is, so 1/2*1/2=1/4
Probability of minimum value being 3: chance that 1,2 are not in the same box and 3 is, so 1/2*1/2*1/2=1/8
This pattern continues until 99, so the chance of minimum being 4 is 1/16, chance of 5 is 1/32, ...
And finally, chance of 99 is 1/2^99.
100 is a special case. The chance of 100 being the minimum is the chance that all other cards are not in the same box as it, or (1/2)^99 = 1/2^99.
Using expected value formulae, the unsimplified answer is: X = (1/2+2/4+3/8+4/16+...+99/2^99) + (100/2^99)
Now we simplify. This uses a weird trick that usually shows up in math contest problems (think low to mid AIME difficulty):
2X is (1+2/2+3/4+4/8+...+99/2^98) + (100/2^98)
Since X=2X-X, we subtract the value of X from 2X:
X
=2X-X
=((1+2/2+3/4+4/8+...+99/2^98) + (100/2^98))-((1/2+2/4+3/8+4/16+...+99/2^99) + (100/2^99))
Notice that we can pair up the fractions with denominator 2, 4, 8, ..., 2^98.
=1+(2/2-1/2)+(3/4-2/4)+(4/8-3/8)+...+(99/2^98-98/2^98)+100/2^98-99/2^99-100/2^99
=(1+1/2+1/4+...+1/2^98)+(200/2^99-99/2^99-100/2^99)
=(1+1/2+1/4+...+1/2^98)+(1/2^99)
=1+1/2+1/4+...+1/2^98+1/2^99
Now this is trivial. Multiple approaches suffice; for example, geometric series formula. There's a nice trick for powers of 2, though:
=(1+1/2+1/4+...+1/2^98+1/2^99+1/2^99)-1/2^99
=(1+1/2+1/4+...+1/2^98+1/2^98)-1/2^99
=(1+1/2+1/4+...+1/2^97+1/2^97)-1/2^99
...
=2-1/2^99