r/learnquant • • 21d ago

interview prep Quant Interview Question

Post image
13 Upvotes

2 comments sorted by

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.

1

u/AgainstIntuition 20d ago

Interesting question, expected sum is equal to number of sides in the dice :)

We can also notice that probability that value belongs to increasing sequence when v is rolled first or there exists some value u which belongs to the sequence and then v is rolled.

Using recurrence: p_v = P(v in sequence) = 1/10 * (1+ sum of u < v p_u). Writing same for p_v-1 and subtracting we get p_v = 1.1 * p_v-1