Risk to ruin?

Ruin : r
Success: m
Kelly Factor: k 

def gambler_ruin(r, m, p):
    if r == 0:
        return 1
    if m == 0:
        return 0
    else:
        return p*gambler_ruin(r-1, m, p) + (1-p)*gambler_ruin(r, m-1, p)

Does this look good? Its a risk to ruin method I found online. Do you have any material on this? Risk to ruin* 



def gambler_ruin(r, m, p):

    return (1-r**(1-2/p))/(m**(1-2/p)-r**(1-2/p))



They look good but they give me wild values instead of 1-100 or 0-.99 Both methods give me negative numbers at times.

 

Hi Jane,



You might find this learning track helpful.



Thanks,

Rushda

Do these courses cover that (Risk to Ruin using Monte Carlo Simulation)?

Thank you,

Namaste.

No, unfortunately our courses don't cover what you're looking for.



Thanks

Ok thanks for the response, I appreciate it. But it would be an amazing addition to the curriculum. 





Please truly consider it,



Much thanks as always.