• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

blackrock phone interview - dice roll

Joined
6/8/13
Messages
2
Points
11
You have the option to throw a dice up n times. You will earn the face value of the dice. You have the option to stop after each throw and walk away with the money earned. What should be your strategy, and What is the expected payoff of this game? I know that for 1st roll, expected payoff is (1+2+...+6)/6=$3.5, for 2nd roll, if I get 4,5,6 which is >$3.5, stop rolling, else roll 2nd time, expected payoff for 2nd roll is 0.5(4+5+6)/3+0.5*3.5=$4.25; for 3rd roll, if get 5,6 which is >4.25, stop rolling, if not, roll 4th time. This is fine. But I was asked if I need to do a macro for this, how should I program for the nth roll? I wasn't able to answer it...Can anyone help me?
 
Essentially, you need the following:

E(N) = P(N < E(N - 1)) * E(N - 1) + (P(N > E(N - 1)) * (0.5 * floor(E(N - 1), integer) + 3.5))

P(N < E(N - 1)) * E(N - 1)
This part means that if you roll less than the value of one less roll, you will roll again.

(P(N > E(N - 1)) * (0.5 * floor(E(N - 1), integer) + 3.5))
This part means that if you roll greater than the value of one less roll, you keep it. Moreover, the second portion of the expression gives you the expected value of a roll that is greater than the expected value of one roll less.

For example, after N = 3...

E(3) = P(roll 3 < 4.25) * 4.25 + (P(roll 3 > 4.25)) * (0.5 * floor(4.25, integer) + 3.5))
E(3) = (2 / 3) * 4.25 + (1 / 3) * (0.5 * 4 + 3.5))
E(3) = (2/3) * 4.25 + (1/3) * (5.5) [In other words, you only keep a 5 or 6.]
E(3) = 14/3
 
Back
Top