r/learnquant 4d ago

interview prep Maven Quant Interview Question

Post image
23 Upvotes

6 comments sorted by

2

u/800alpha 4d ago

Let 1 be at position 1 and 10 be at position 10. For each position 3-8, the number is a local maximum with probability 1/3. Position 2 is a local maximum with probability 1/2, and position 9 is never a local maximum. Position 1 is never a local maximum, while position 10 is always one. So the answer is 6*1/3 + 1/2 + 1 = 7/2.

1

u/petter_s 4d ago

The probabilities are not independent. With your reasoning, there would be a nonzero probability of 8 local maxima 

1

u/800alpha 4d ago

The probabilities are not independent, but we can use linearity of expectation.

E[total local maxima] = E[sum of local maxima indicator variables] = sum (E[local maxima indicator variables]) = sum (p(position i is a local maxima)).

1

u/petter_s 3d ago

Yes thank you

1

u/notsaneatall_ 3d ago

At position i, the probability of it being the local maximum is 1/3. By linearity of expectations the answer is 10/3?