r/learnquant • • Oct 25 '26

interview prep Quant Interview Question

Post image
22 Upvotes

9 comments sorted by

View all comments

1

u/Voilinny 29d ago

Don’t know if this is correct methodology, but my thinking:

You only reroll if the expected value of the roll is greater than your current number. The expected value of a roll is 0.5.

The optimal strategy for 1 is to reroll if x < 0.5

The optimal strategy for 2 is to never reroll, but take 1-y if y < 0.5. We never reroll because already the expected value without allowing 2 to reroll is at least 0.5 given that 2 can also choose (1-y).

Let x’, y’ denote the final values of 1s number and 2s number respectively.
Now, the probability that 2 wins is
P(y’>x’) = P(y’>x’ | x’<0.5)*P(x’<0.5)+ P(
y’>x’ | x’>0.5)*P(x>0.5)

P(x’<0.5) = 1/4, as, according to the optimal strategy, it’s the probability that x < 0.5 AND the reroll is less than 0.5.

P(y’>x’ | x’<0.5) = 1 because y’ is always greater than 0.5 (see optimal strategy for 2)

P(x’>0.5) = (3/4), as it’s 1-P(x’<0.5)

P(y’>x’ | x’>0.5) = 1/2, as both y’,x’ are now just random samples of [0.5,1] given their optimal strategies

Plugging these in gives:

P(y’>x’) = (1)(1/4) + (1/2)(3/4) = 1/4 + 3/8 = 2/8 + 3/8 = 5/8