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
Check out the line where you write:
if(runif(1) = p){}
Shouldn't that be a double equals sign?