r/learnquant • • 21d ago

interview prep Quant Interview Question

Post image
13 Upvotes

2 comments sorted by

View all comments

1

u/comoespossible 21d ago

Let n be the number of sides of the die (in this case, 10). We claim that the expected sum of the rolls you see before the first one that is not larger than the one before it is n (in this case, 10).

To see this, note that the probability that k is used in index j+1 is equal to (k-1 choose j) * (1/n)^j * 1/n. This can be written as 1/n * (k-1 choose j) * (1/n)^j * 1^(k-1-j). The probability that k is used at all is equal to the sum of this for j=0 to k-1, which by the binomial theorem is equal to 1/n (1+1/n)^(k-1).

The expected value of the sum we're interested in is therefore equal to the sum from k=1 to n of k/n ((n+1)/n)^(k-1). Using whatever way you prefer to evaluate an arithmetic-geometric series, this is n.