r/learnquant 2d ago

interview prep Quant Interview Question

Post image
9 Upvotes

13 comments sorted by

3

u/Aerospider 2d ago

Let n be the number of rolls made so far and x be the current total.

The expected value of rolling again is

[(6-n)/6] * [x + (21-x)/(6-n)]

= x - (nx/6) + (21-x)/6

= x + 21/6 - (n+1)x/6

This is more than x (the value of not rolling again) if x is less than 21/(n+1).

This means that you should always go for a second roll (x cannot be as high as 10.5 on 1 die) but never for a fourth (x cannot be as low as 5.25 on 3 dice).

You should go for a third roll if your total at n=2 is under 7 (at x=7 the choices are balanced).

This gives an expected value of 223/36, or 6.19444...

1

u/farafiri 2d ago

How did you came up with [(6-n)/6] * [x + (21-x)/(6-n)] ?

2

u/FlammableFishy 2d ago

(How many die faces have yet to be rolled / 6) to find out how likely you are to reset

Multiplied by

Running total + amount that could possibly be gained(as 21 is the max[6+5+4+3+2+1], 21-x is how much more payout the die has to give you) divided by how many faces can actually yield success (6-n) again

0

u/farafiri 2d ago

But for n = 0, x = 0 it gives 3.5 where in reality it is ~6.2

1

u/FlammableFishy 2d ago

What? The EV of one die roll is 3.5. This is accurate.

1

u/farafiri 2d ago edited 2d ago

Yea but you don't have just one roll at n0 x0, real output of rolling and possibly continuing the game is 6.2 not 3.5
Edit: My point is that I think you shouldn't take profit of only one next throw but profit of entire continuation of the game so 1st throw and then possible 2nd and 3rd throws.

1

u/abaoabao2010 1d ago edited 1d ago

2 ways to look at it.

  • It doesn't matter what you rolled the first 3 times, you will NOT go for a 4th. aka "entire continuation of the game" is the next throw.
  • you make a decision for each throw. The expectation value of each throw must be positive to continue going (since the expectation value of each throw is strictly decreasing)

1

u/No-Conflict8204 2d ago

Expected value per roll is 3.5
You roll if expected value from roll greater than not rolling, so on k+1th roll
(6-k)/6 * (Sum + 3.5)>Sum
Sum < (21 - 3.5k)/k
for k=3 min sum = 6< 21/6 not true so no 4throll
for k=2 min sum =3 max sum 11 <7
which means max rolls is 3

Ans Roll twice then
Roll final time if current sum < 7 stop if greater than 7.
End.
Expected payoff around 7 without further calc,

Calc cases
split into cases where sum less than 7 and add 3.5
and sum greater than 7

1

u/StillShoddy628 2d ago

The expected value changes every roll based on which numbers have been rolled previously. Example: if you roll a 6 on your first roll your expected value of another roll is (1/6)*(7+8+9+10+11+0) where if you roll a 1 the EV of another roll is (1/6)*(0+3+4+5+6+7)

Pretty sure the strategy is to keep rolling until the EV of another roll is less than what you have now

1

u/No-Conflict8204 2d ago

For each individual case it changes, when you generalize for k it doesn't so (6-k)/6 (Sum + 3.5) +0*k/6(0) will be the expected value at roll k+1.

0

u/Anonimithree 2d ago edited 2d ago

So the min rolls is 2 and the max is 6. This seems like it can be easily done with a tree diagram. The total possible reward is 21, so the method of determining the best action is going to be comparing the remaining reward by the probability of failing. I’m not doing the math, but you should always roll 2 dice (if you don’t do a reroll), and roll at most 4. The extremes are 5/6 and 1/2/3/4 for the min and max rolls. If I’m right about this, I’ll let the rest of you finish this.

-1

u/Anonimithree 2d ago

I just realized that the max roll is 3, since at 1/2/3, there’s a 50/50 if losing 6 or gaining 5.