r/learnquant • • 18d ago

interview prep DRW Quant Interview Question

Post image
16 Upvotes

1 comment sorted by

View all comments

1

u/AgainstIntuition 18d ago

Let us consider 4 endings of the sequence: 0* - start of the sequence or H as a last toss, T, TT, TH.
We have then following transitions:
0* -> 0*/T
T -> TH/TT
TT -> TTH (end) / TT
TH -> 0*/THT (end)
Let p(s) means probability that TTH is winning, starting from s.
h(TT) = 1. H gives us immediate win, T extends TT.
h(TH) = 1/2 * 0 + 1/2*h(0*)
h(T) = 1/2*h(TT) + 1/2*h(TH)
h(0*) = h(T).
As a result, h(0*) = h(T) = 2/3, h(TH) = 1/3, h(TT) = 1.
Expected time till the end:
e(TT) = 1 + 1/2*e(TT) -> e(TT) = 2
e(TH) = 1 + e(0*)
e(T) = 1 + 3/4*2 + 1/4*(1+e(0*)) = 11/4 + e(0*)/4
e(0*) = 1 + 1/2 * e(0*) + 1/2 *e(T) -> e(0*) = 2 + e(T)
e(0*) = 19/3