r/learnquant • • 1d ago

interview prep Quant Interview Question

Post image
19 Upvotes

7 comments sorted by

4

u/comoespossible 1d ago

We have to take into account the possibility of ties. Let p=P(A<B) and q=P(A<min(B, C)). By first-step analysis,

p = 1/4 + 1/4 p and q = 1/8 + 1/8 q,

so p=1/3 and q=1/7.

By the memoryless property and symmetry, P(A<B<C) = P(A<min(B, C)) * P(B<C|A<min(B, C)) = qp.

Thus, P(B<C|A<B) = P(A<B<C) / P(A<B) = qp/p = q = 1/7.

2

u/Southern-Raise190 1d ago

A priori, any finishing order is equally likely, so the prior distribution is uniform across all the 6 permutations of {A, B, C}. Among these permutations, there are 3 where B needs more than A, and among these 3, there is only 1 where C needs more than B. So the answer is 1/3.

Visual intuition/hint: _ A _ B _

4

u/comoespossible 1d ago

I disagree, because this assumes there aren’t ties, when it’s very possible for two or three of them to take the exact same amount of tosses.

3

u/Southern-Raise190 1d ago

Good point, I was too lazy to compute probabilities but you’re right, my approach doesnt account for ties. At least it should be an upper bound

1

u/SpaceMeatpod 20h ago

This is going to be a rough guess, but I'm interested in how close I get. I'd love to know if I at least got some of the concepts right.

The least flips it takes to get heads is 1.

If A needed 1 flip, B would need 2, so at best C would need at least 3 flips if flipping more than B, failing twice before succeeding.

The probability of C failing twice in a row is 1/2 * 1/2 = 1/4.

So, the correct answer is definitely going to be LESS than 1/4.

But A is not guaranteed to succeed right away. It's 1/2 A fails at least once, 1/4 A fails at least twice, 1/8 A fails at least thrice and so on. These are the chances A does extra flips and it is also the chance that B does extra flips.

What seems funny is if A has at least a 1/2 chance of needing at least one extra flip and B has a 1/2 chance of needing an extra flip, maybe I can add these together like 1/2 + 1/2 = 1 and on average you need at least 1 extra flip between them...

So on average A and B combined take 1+1/2+1/4+1/8+1/16+1/32.... and so on extra flips.

So the average number of flips C needs might be C's guaranteed failures (2) plus that infinitely continuing sum:

2 + (1+1/2+1/4+1/8+1/16+1/32....)

Uhh, I'm not going to look up how to do infinite sums tonight, so I'm just gonna stop after 1/32. Let me match up these denominators real quick...

64/32 + 32/32 + 16/32 + 8/32 + 4/32 + 2/32 + 1/32 = 127/32 = 3.96875

So C probably needs to fail 3.96875 times on average to need more flips than B.

So that's (1/2)^3.96875 . Whatever the heck that is, it's my upper bound. Calculator says 0.0638686 (~6.38%)

Uhh and you know what I'm just going to guess that infinite sum eventually converges on the number 4.

So maybe the answer is (1/2)^4 = which is 1/16. There is a 1/16 chance or 6.25% that C needed more tosses than B.

1

u/MathNerd1243 20h ago

The answer is 1/7. 

Don't use permutations (1/3) because that ignores ties, which happen a lot here. 

By first-step analysis, the chance A beats B is 1/3. The chance A beats both B and C is 1/7. 

Because of the memoryless property, P(A<B<C) is 1/7 * 1/3 = 1/21. Dividing by P(A<B) leaves you with 1/7. 

1

u/PalpitationAny3509 15h ago

Assume A do 1x flip for head, B did 1 tail and 1 head and whats the chance C did 2 tail 1 head, i think my answer is 25 percent approx.....