Serving the Quantitative Finance Community

 
User avatar
sungju1203
Topic Author
Posts: 0
Joined: December 11th, 2010, 4:13 am

Financial Math Programming HELP

November 4th, 2011, 1:16 am

My professor assigned me an extra credit and I want to do it by using programming.Can anyone give me some hint how should I approach this problem using excel?You will likely need to use a programming language to complete this bonus problem, check it out below:You are given a unique investment opportunity. Starting with $1 of capital, you can choose a fixed proportion, f, of your capital to bet on a fair coin toss repeatedly for 1000 tosses.Your return is double your bet for heads and you lose your bet for tails.For example, if f  = 1/4, for the first toss you bet $0.25, and if heads comes up you win $0.5 and so then have $1.5. You then bet $0.375 and if the second toss is tails, you have $1.125.Choosing f to maximize your chances of having at least $1,000,000,000 after 1,000 flips, what is the chance that you become a billionaire?All computations are assumed to be exact (no rounding), but give your answer rounded to 12 digits behind the decimal point in the form 0.abcdefghijkl
 
User avatar
Hansi
Posts: 41
Joined: January 25th, 2010, 11:47 am

Financial Math Programming HELP

November 4th, 2011, 9:24 am

Should be trivial in any programming language. Just do it in R or VBA. Heck you can just do it directly in Excel without programming.You really shouldn't need much help for this. Check back on specifics if you get stuck. Is this a high school assignment?
 
User avatar
acastaldo
Posts: 14
Joined: October 11th, 2002, 11:24 pm

Financial Math Programming HELP

November 4th, 2011, 4:47 pm

For the random toin cosses use something like this =IF(RAND()<=0.5,0,1)
 
User avatar
gomer767
Posts: 0
Joined: September 28th, 2011, 1:43 pm

Financial Math Programming HELP

November 4th, 2011, 5:36 pm

Isnt this just the Kelly Formula?Do a quick google search of it.....
 
User avatar
bwarren
Posts: 0
Joined: February 18th, 2011, 10:44 pm

Financial Math Programming HELP

November 5th, 2011, 4:23 am

Kelly says not to bet anything because you do not have an advantage. Winning $1B is virtually impossible, so I really doubt a simulation will give you the precision you're looking for.To maximize your chances, you want to choose a bet size that minimizes the number of wins required to get $1B. From here, it is not difficult to calculate the probability (binomial distribution), although the first 10 decimal places are 0. Edit: I missed the part where you have 2:1 odds. You can still use the same method, though.
Last edited by bwarren on November 4th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
bwarren
Posts: 0
Joined: February 18th, 2011, 10:44 pm

Financial Math Programming HELP

November 5th, 2011, 4:53 am

In this case, you can virtually always make $1B, but Kelly does not apply because the goal is not to maximize wealth.