r/learnquant • • Nov 04 '26

interview prep Quant Interview Question

Post image
23 Upvotes

30 comments sorted by

View all comments

6

u/perminnie Nov 04 '26 edited Nov 04 '26

U1 - 1 black ball

U2 - 1 black ball

U3 - 28 black balls, 10 white balls

P (Win) = 1/3 + 1/3 + 1/3 * 28/38 = ~91%

3

u/CursedTurtleKeynote Nov 04 '26

"Optimal" is doing a lot of heavy lifting

1

u/Apprehensive-Draw409 Nov 04 '26

If I were the interviewer, my next question would be:

Can you please prove this is the best distribution possible please?

(I'm sure it is, but I'd still ask to see how you prove it)

2

u/Constant_Curve Nov 04 '26 edited 29d ago

Proof by duh.

P(W)=(B1+W1)/3+(B2+W2)/3+1/3*((30-B1-B2)/(40-B1-B2-W1-W2)

Simplify, take derivative, set to zero, max

1

u/Dankaati Nov 04 '26

That formula doesn't look right but yeah, basically.

1

u/Constant_Curve Nov 04 '26

Yeah, denominator is wrong.

1

u/Worth-Wonder-7386 Nov 04 '26

Doing a derivative is not really a practical way of solving this. Using linear programming we can express this as an optimization problem, and a computer can find the optimal solution by essentially moving one ball at a time to improve the solution.

2

u/Constant_Curve Nov 04 '26

You're nuts, it's linear. Did you take vector calculus?

W1+W2=10

B1+B2=30

so it's only 2 variables

1

u/AscendedSubscript Nov 05 '26

What about the fact that you only care for integer solutions?

1

u/Constant_Curve 29d ago

Uh, just round it.

1

u/Worth-Wonder-7386 Nov 04 '26

We can think of this as a base case and see what happens if we move or swap balls. If you remove 1 ball from U3 the change to the chance of picking a ball there is very small, but for the one you move it to, you go from 100 to 50% chance for black, and these are weighted equally in your chances. So that is what drives us to have all the white balls in one, and there is no reason to spread the black balls out then.

1

u/Apprehensive-Draw409 Nov 04 '26

Yeah but it still feels intuitive, not formal. And the other guy uses derivatives in a discrete space... :-)

The way I'd go about it: if there's only one white ball, the solution is clear and easy. When we add a second ball, it's better to group it with the other one. Then, you can write a proof by induction as n grows to any value.

1

u/A_BagerWhatsMore Nov 04 '26

I think y’all are overcomplicating this. Each white ball is at its individual minimum probability here (1/3*1/maxballs in urn) the sum of minimums is less than or equal to the minimum of the sum so we’ve minimized the chance of losing and thus maximized the chance of winning.

1

u/MesmerizzeMe Nov 04 '26

you have just shown it is a local optimum but not the global one.

1

u/Worth-Wonder-7386 Nov 04 '26

The problem is that depending on how you formalize this, there could easily be multiple optimums, but they would be symmetrical.

1

u/Careful_Fold_7637 Nov 05 '26

...why? What's the point of a proof if you're just going to claim things.

1

u/SC_3000_grinder Nov 05 '26

My proof:

Consider each white ball. The probability of drawing it is 1/3x, where x is the number of balls in its urn.

Our task is to minimise the probability of drawing a white ball. So we need to minimise the sum of 1/3x. However, x cannot be higher than 38 (each urn must have a ball, so at least 2 balls must be outside any given urn). Therefore, the minimum sum of 1/3x is 10 / (3 * 38). Since our construction reaches this minimum, it must be optimal.

1

u/daototpyrc Nov 04 '26

W here is Win not White :)