R Help For Martingale Simulation

前端 未结 2 892
遇见更好的自我
遇见更好的自我 2021-01-27 20:53

I\'m trying to make a martingale simulation in R where I bet an amount and if I win I bet the same amount but if I lose, I bet double the amount. I do this until I run out of mo

2条回答
  •  广开言路
    2021-01-27 21:43

    Check out the line where you write:

    if(runif(1) = p){}
    

    Shouldn't that be a double equals sign?

提交回复
热议问题