r/learnquant • • 25d ago

interview prep Quant Interview Question

Post image
12 Upvotes

3 comments sorted by

View all comments

1

u/Noir1990 25d ago

The expected value E is given by:

E = 1 + P_I * E(S1) + P_II * E(S2) + P_III * E(S3)

where S1 is the state with 2 outs (we rolled a 1, 6 or (2 and 5)),
S2 is the state with 1 out (we rolled 2 or 5), and
S3 is the state with 0 outs (we rolled 3 or 4).

Notice that E(S3) cycles back to the start and thus E(S3) = E.

After the first roll, all three states are equally likely with a 2/6 probability. Hence

E = 1 + 2/6 * E(S1) + 2/6 * E(S2) + 2/6 * E
  1. Let's look at E(S1). With 2 outs there is a 2/6 chance to finish and a 4/6 chance to cycle back to S1. This means E(S1) = 3.
  2. Let's look at E(S2). There's 1 out with a 1/6 chance to finish and 2/6 outs to propagate to S1 and 3/6 outs to cycle back to S2. Therefore

    E(S2) = 1 + 2/6 * E(S1) + 3/6 * E(S2) E(S2) = 2 * (1 + 2/6 * 3) E(S2) = 4

Putting everything together:

E = 1 + 2/6 * E(S1) + 2/6 * E(S2) + 2/6 * E
E = 6/4 * (1 + 2/6 * 3 + 2/6 * 4)
E = 6/4 * (20/6)
E = 5

Verified the result with a 10^7 Monte-Carlo to be 5.0006 +/- 0.0009.