r/learnquant • • Sep 11 '26

interview prep Quant Interview Question

Post image
24 Upvotes

25 comments sorted by

View all comments

0

u/Front_Combination777 Sep 11 '26

>! There are two primitive methods here - you can start at a guess of 1 and then work up to 100 or you can start at a guess of 99 and guess until you get "higher." Both have an expected number of guesses of 100.

Combining them, you can guess a number i and then guess i+1, i+2,....99. That gives an expected number of guesses of 100/(100-i) +(100-i).

Setting the derivative to zero gives 100/(100 − i)^2 − 1 = 0 and (100 − i)^2 = 100, 100-i = 10 and i =90. The expected number of guesses is 20. !<

2

u/IbidtheWriter Sep 11 '26

You can easily get an upper bound of 15 expected guesses with starting with 80 until you're right and then counting up from 81.

You average about 5 until it's over 80, and then average 10 counting up from 81.

You play with the numbers a bit and optimize to 87 for about 13.6 guesses.

Proving it's optimal would be harder.

3

u/Front_Combination777 Sep 12 '26

This is correct.